librustdoc: ignore lint warnings when compiling documentation

This commit is contained in:
Kevin Butler 2015-11-02 23:44:53 +00:00
parent 2249b07ae9
commit b1ef5302d5
2 changed files with 21 additions and 0 deletions

View File

@ -105,6 +105,7 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,
search_paths: search_paths,
crate_types: vec!(config::CrateTypeRlib),
lint_opts: vec!((warning_lint, lint::Allow)),
lint_cap: Some(lint::Allow),
externs: externs,
target_triple: triple.unwrap_or(config::host_triple().to_string()),
cfg: config::parse_cfgspecs(cfgs),

View File

@ -0,0 +1,20 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// This should fail a normal compile due to non_camel_case_types,
// It should pass a doc-compile as it only needs to type-check and
// therefore should not concern itself with the lints.
#[deny(warnings)]
// @has cap_lints/struct.foo.html //pre '#[must_use]'
#[must_use]
pub struct foo {
field: i32,
}