librustdoc: ignore lint warnings when compiling documentation
This commit is contained in:
parent
2249b07ae9
commit
b1ef5302d5
2 changed files with 21 additions and 0 deletions
|
@ -105,6 +105,7 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,
|
||||||
search_paths: search_paths,
|
search_paths: search_paths,
|
||||||
crate_types: vec!(config::CrateTypeRlib),
|
crate_types: vec!(config::CrateTypeRlib),
|
||||||
lint_opts: vec!((warning_lint, lint::Allow)),
|
lint_opts: vec!((warning_lint, lint::Allow)),
|
||||||
|
lint_cap: Some(lint::Allow),
|
||||||
externs: externs,
|
externs: externs,
|
||||||
target_triple: triple.unwrap_or(config::host_triple().to_string()),
|
target_triple: triple.unwrap_or(config::host_triple().to_string()),
|
||||||
cfg: config::parse_cfgspecs(cfgs),
|
cfg: config::parse_cfgspecs(cfgs),
|
||||||
|
|
20
src/test/rustdoc/cap-lints.rs
Normal file
20
src/test/rustdoc/cap-lints.rs
Normal 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,
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue