about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-11-03 17:02:13 +0000
committerbors <bors@rust-lang.org>2015-11-03 17:02:13 +0000
commitde11d2aa835ff6bbb0a8b6fcef1ff0a1174418b3 (patch)
treeebeca2e44b631c4b54e93c0a5df1b9a2ffd3190e
parent4aa1f59e1eddbef7d85f7c4c9606f3941036c541 (diff)
parentb1ef5302d5456add7b3314cd871d23a2dc45afb5 (diff)
downloadrust-de11d2aa835ff6bbb0a8b6fcef1ff0a1174418b3.tar.gz
rust-de11d2aa835ff6bbb0a8b6fcef1ff0a1174418b3.zip
Auto merge of #29529 - Ryman:rustdoc-cap-lints, r=alexcrichton
This sets the `cap-lints` setting to 'allow' for all doc compilations. There's precedent for this as rustdoc [already whitelists unstable code](https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs#L112) when compiling documentation, with the expectation being that a regular compile will complain about any problems. I think the same justification applies here.

Problem case in the wild: https://github.com/laumann/compiletest-rs/pull/28

r? @Manishearth 
-rw-r--r--src/librustdoc/core.rs1
-rw-r--r--src/test/rustdoc/cap-lints.rs20
2 files changed, 21 insertions, 0 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs
index 4955951d36e..ae01d6e5426 100644
--- a/src/librustdoc/core.rs
+++ b/src/librustdoc/core.rs
@@ -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),
diff --git a/src/test/rustdoc/cap-lints.rs b/src/test/rustdoc/cap-lints.rs
new file mode 100644
index 00000000000..e7f308a6f0b
--- /dev/null
+++ b/src/test/rustdoc/cap-lints.rs
@@ -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,
+}