about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKevin Butler <haqkrs@gmail.com>2015-11-03 16:34:11 +0000
committerKevin Butler <haqkrs@gmail.com>2015-11-12 05:16:57 +0000
commitd64e551248d73ca9657952e983d3d178d85d3608 (patch)
tree11dcbfcc63cac5274f3cd92bdbe7af1d19b863f9
parenta17f81b4b796123aa4e204145cca870fa270cf81 (diff)
downloadrust-d64e551248d73ca9657952e983d3d178d85d3608.tar.gz
rust-d64e551248d73ca9657952e983d3d178d85d3608.zip
libsyntax: deny warnings in doctests
-rw-r--r--mk/tests.mk2
-rw-r--r--src/libsyntax/ast.rs14
-rw-r--r--src/libsyntax/ext/deriving/generic/mod.rs9
-rw-r--r--src/libsyntax/ext/format.rs7
-rw-r--r--src/libsyntax/lib.rs3
-rw-r--r--src/libsyntax/parse/parser.rs2
-rw-r--r--src/libsyntax/print/pp.rs6
7 files changed, 25 insertions, 18 deletions
diff --git a/mk/tests.mk b/mk/tests.mk
index ed6e2b00344..36199cef23a 100644
--- a/mk/tests.mk
+++ b/mk/tests.mk
@@ -26,7 +26,7 @@ TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system libc \
 		     		  alloc_jemalloc,$(TARGET_CRATES)) \
 			collectionstest coretest
 TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz \
-                log rand rbml serialize
+                log rand rbml serialize syntax
 TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \
 		   		rustc_trans rustc_lint,\
                      $(HOST_CRATES))
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 8c9c8835087..1f34af617d5 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -908,13 +908,15 @@ pub enum Expr_ {
 /// separately. `position` represents the index of the associated
 /// item qualified with this Self type.
 ///
-///     <Vec<T> as a::b::Trait>::AssociatedItem
-///      ^~~~~     ~~~~~~~~~~~~~~^
-///      ty        position = 3
+/// ```ignore
+/// <Vec<T> as a::b::Trait>::AssociatedItem
+///  ^~~~~     ~~~~~~~~~~~~~~^
+///  ty        position = 3
 ///
-///     <Vec<T>>::AssociatedItem
-///      ^~~~~    ^
-///      ty       position = 0
+/// <Vec<T>>::AssociatedItem
+///  ^~~~~    ^
+///  ty       position = 0
+/// ```
 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
 pub struct QSelf {
     pub ty: P<Ty>,
diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs
index 5c6e2fce8ad..5a0fc4fda0c 100644
--- a/src/libsyntax/ext/deriving/generic/mod.rs
+++ b/src/libsyntax/ext/deriving/generic/mod.rs
@@ -54,6 +54,7 @@
 //! following snippet
 //!
 //! ```rust
+//! # #![allow(dead_code)]
 //! struct A { x : i32 }
 //!
 //! struct B(i32);
@@ -88,7 +89,7 @@
 //!
 //! ```rust
 //! trait PartialEq {
-//!     fn eq(&self, other: &Self);
+//!     fn eq(&self, other: &Self) -> bool;
 //! }
 //! impl PartialEq for i32 {
 //!     fn eq(&self, other: &i32) -> bool {
@@ -905,7 +906,7 @@ impl<'a> MethodDef<'a> {
         })
     }
 
-    /// ```
+    /// ```ignore
     /// #[derive(PartialEq)]
     /// struct A { x: i32, y: i32 }
     ///
@@ -1010,7 +1011,7 @@ impl<'a> MethodDef<'a> {
                                       &StaticStruct(struct_def, summary))
     }
 
-    /// ```
+    /// ```ignore
     /// #[derive(PartialEq)]
     /// enum A {
     ///     A1,
@@ -1596,7 +1597,7 @@ pub fn cs_fold<F>(use_foldl: bool,
 /// Call the method that is being derived on all the fields, and then
 /// process the collected results. i.e.
 ///
-/// ```
+/// ```ignore
 /// f(cx, span, vec![self_1.method(__arg_1_1, __arg_2_1),
 ///                  self_2.method(__arg_1_2, __arg_2_2)])
 /// ```
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs
index c56342371c8..af0e7ce5c8d 100644
--- a/src/libsyntax/ext/format.rs
+++ b/src/libsyntax/ext/format.rs
@@ -77,9 +77,10 @@ struct Context<'a, 'b:'a> {
 /// expressions.
 ///
 /// If parsing succeeds, the return value is:
-///
-///     Some((fmtstr, unnamed arguments, ordering of named arguments,
-///           named arguments))
+/// ```ignore
+/// Some((fmtstr, unnamed arguments, ordering of named arguments,
+///       named arguments))
+/// ```
 fn parse_args(ecx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
               -> Option<(P<ast::Expr>, Vec<P<ast::Expr>>, Vec<String>,
                          HashMap<String, P<ast::Expr>>)> {
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index 8b001f2419c..295c3e05bc0 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -23,7 +23,8 @@
 #![crate_type = "rlib"]
 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
-       html_root_url = "https://doc.rust-lang.org/nightly/")]
+       html_root_url = "https://doc.rust-lang.org/nightly/",
+       test(attr(deny(warnings))))]
 
 #![feature(associated_consts)]
 #![feature(drain)]
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index fde1058a785..1e38eebec5d 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3965,7 +3965,7 @@ impl<'a> Parser<'a> {
 
     /// Parses an optional `where` clause and places it in `generics`.
     ///
-    /// ```
+    /// ```ignore
     /// where T : Trait<U, V> + 'b, 'a : 'b
     /// ```
     pub fn parse_where_clause(&mut self) -> PResult<ast::WhereClause> {
diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs
index 7c5a46465f5..cbbd5289a5a 100644
--- a/src/libsyntax/print/pp.rs
+++ b/src/libsyntax/print/pp.rs
@@ -11,8 +11,10 @@
 //! This pretty-printer is a direct reimplementation of Philip Karlton's
 //! Mesa pretty-printer, as described in appendix A of
 //!
-//!     STAN-CS-79-770: "Pretty Printing", by Derek C. Oppen.
-//!     Stanford Department of Computer Science, 1979.
+//! ````ignore
+//! STAN-CS-79-770: "Pretty Printing", by Derek C. Oppen.
+//! Stanford Department of Computer Science, 1979.
+//! ````
 //!
 //! The algorithm's aim is to break a stream into as few lines as possible
 //! while respecting the indentation-consistency requirements of the enclosing