Update missing-doc test to explicitly check errors

This way we can be sure the correct error is displayed for the
respective code type.
This commit is contained in:
Ivan Petkov 2015-02-23 11:33:52 -08:00
parent 717a91d665
commit 2e9521c126

View file

@ -17,15 +17,15 @@
#![doc="More garbage"]
type Typedef = String;
pub type PubTypedef = String; //~ ERROR: missing documentation
pub type PubTypedef = String; //~ ERROR: missing documentation for a type alias
struct Foo {
a: isize,
b: isize,
}
pub struct PubFoo { //~ ERROR: missing documentation
pub a: isize, //~ ERROR: missing documentation
pub struct PubFoo { //~ ERROR: missing documentation for a struct
pub a: isize, //~ ERROR: missing documentation for a struct field
b: isize,
}
@ -36,11 +36,11 @@ pub struct PubFoo2 {
}
mod module_no_dox {}
pub mod pub_module_no_dox {} //~ ERROR: missing documentation
pub mod pub_module_no_dox {} //~ ERROR: missing documentation for a module
/// dox
pub fn foo() {}
pub fn foo2() {} //~ ERROR: missing documentation
pub fn foo2() {} //~ ERROR: missing documentation for a function
fn foo3() {}
#[allow(missing_docs)] pub fn foo4() {}
@ -58,9 +58,9 @@ trait B {
fn foo_with_impl(&self) {}
}
pub trait C { //~ ERROR: missing documentation
fn foo(&self); //~ ERROR: missing documentation
fn foo_with_impl(&self) {} //~ ERROR: missing documentation
pub trait C { //~ ERROR: missing documentation for a trait
fn foo(&self); //~ ERROR: missing documentation for a type method
fn foo_with_impl(&self) {} //~ ERROR: missing documentation for a method
}
#[allow(missing_docs)]
@ -70,8 +70,8 @@ pub trait D {
/// dox
pub trait E {
type AssociatedType; //~ ERROR: missing documentation
type AssociatedTypeDef = Self; //~ ERROR: missing documentation
type AssociatedType; //~ ERROR: missing documentation for an associated type
type AssociatedTypeDef = Self; //~ ERROR: missing documentation for an associated type
/// dox
type DocumentedType;
@ -87,7 +87,7 @@ impl Foo {
}
impl PubFoo {
pub fn foo() {} //~ ERROR: missing documentation
pub fn foo() {} //~ ERROR: missing documentation for a method
/// dox
pub fn foo1() {}
fn foo2() {}
@ -124,9 +124,9 @@ enum Baz {
BarB
}
pub enum PubBaz { //~ ERROR: missing documentation
PubBazA { //~ ERROR: missing documentation
a: isize, //~ ERROR: missing documentation
pub enum PubBaz { //~ ERROR: missing documentation for an enum
PubBazA { //~ ERROR: missing documentation for a variant
a: isize, //~ ERROR: missing documentation for a struct field
},
}
@ -152,14 +152,14 @@ pub fn baz() {}
mod internal_impl {
/// dox
pub fn documented() {}
pub fn undocumented1() {} //~ ERROR: missing documentation
pub fn undocumented2() {} //~ ERROR: missing documentation
pub fn undocumented1() {} //~ ERROR: missing documentation for a function
pub fn undocumented2() {} //~ ERROR: missing documentation for a function
fn undocumented3() {}
/// dox
pub mod globbed {
/// dox
pub fn also_documented() {}
pub fn also_undocumented1() {} //~ ERROR: missing documentation
pub fn also_undocumented1() {} //~ ERROR: missing documentation for a function
fn also_undocumented2() {}
}
}