From 2e9521c126214255c8d7a78db4daf431bb5d6320 Mon Sep 17 00:00:00 2001 From: Ivan Petkov Date: Mon, 23 Feb 2015 11:33:52 -0800 Subject: [PATCH] Update missing-doc test to explicitly check errors This way we can be sure the correct error is displayed for the respective code type. --- src/test/compile-fail/lint-missing-doc.rs | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/test/compile-fail/lint-missing-doc.rs b/src/test/compile-fail/lint-missing-doc.rs index f5ce85ab325d..cb2d4e10e6e7 100644 --- a/src/test/compile-fail/lint-missing-doc.rs +++ b/src/test/compile-fail/lint-missing-doc.rs @@ -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() {} } }