Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
libsyntax: deny warnings in doctests
  • Loading branch information
Ryman committed Nov 12, 2015
1 parent a17f81b commit d64e551
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion mk/tests.mk
Expand Up @@ -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))
Expand Down
14 changes: 8 additions & 6 deletions src/libsyntax/ast.rs
Expand Up @@ -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>,
Expand Down
9 changes: 5 additions & 4 deletions src/libsyntax/ext/deriving/generic/mod.rs
Expand Up @@ -54,6 +54,7 @@
//! following snippet
//!
//! ```rust
//! # #![allow(dead_code)]
//! struct A { x : i32 }
//!
//! struct B(i32);
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -905,7 +906,7 @@ impl<'a> MethodDef<'a> {
})
}

/// ```
/// ```ignore
/// #[derive(PartialEq)]
/// struct A { x: i32, y: i32 }
///
Expand Down Expand Up @@ -1010,7 +1011,7 @@ impl<'a> MethodDef<'a> {
&StaticStruct(struct_def, summary))
}

/// ```
/// ```ignore
/// #[derive(PartialEq)]
/// enum A {
/// A1,
Expand Down Expand Up @@ -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)])
/// ```
Expand Down
7 changes: 4 additions & 3 deletions src/libsyntax/ext/format.rs
Expand Up @@ -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>>)> {
Expand Down
3 changes: 2 additions & 1 deletion src/libsyntax/lib.rs
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser.rs
Expand Up @@ -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> {
Expand Down
6 changes: 4 additions & 2 deletions src/libsyntax/print/pp.rs
Expand Up @@ -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
Expand Down

0 comments on commit d64e551

Please sign in to comment.