libsyntax: deny warnings in doctests

This commit is contained in:
Kevin Butler
2015-11-03 16:34:11 +00:00
parent a17f81b4b7
commit d64e551248
7 changed files with 25 additions and 18 deletions

View File

@@ -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)])
/// ```

View File

@@ -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>>)> {