Deny bare_trait_objects globally

This commit is contained in:
Tatsuyuki Ishi 2018-07-13 14:12:58 +09:00
parent 4f1d4e4db6
commit e098985939
52 changed files with 34 additions and 87 deletions

View File

@ -296,8 +296,9 @@ fn main() {
cmd.arg("--color=always");
}
if env::var_os("RUSTC_DENY_WARNINGS").is_some() {
if env::var_os("RUSTC_DENY_WARNINGS").is_some() && env::var_os("RUSTC_EXT_TOOL").is_none() {
cmd.arg("-Dwarnings");
cmd.arg("-Dbare_trait_objects");
}
if verbose > 1 {

View File

@ -222,7 +222,8 @@ impl Step for Rustdoc {
Mode::ToolRustc,
target,
"check",
"src/tools/rustdoc");
"src/tools/rustdoc",
false);
let _folder = builder.fold_output(|| format!("stage{}-rustdoc", compiler.stage));
println!("Checking rustdoc artifacts ({} -> {})", &compiler.host, target);

View File

@ -814,6 +814,7 @@ impl Step for Rustdoc {
target,
"doc",
"src/tools/rustdoc",
false
);
cargo.env("RUSTDOCFLAGS", "--document-private-items");

View File

@ -286,7 +286,8 @@ impl Step for Rls {
Mode::ToolRustc,
host,
"test",
"src/tools/rls");
"src/tools/rls",
true);
// Don't build tests dynamically, just a pain to work with
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
@ -341,7 +342,8 @@ impl Step for Rustfmt {
Mode::ToolRustc,
host,
"test",
"src/tools/rustfmt");
"src/tools/rustfmt",
true);
// Don't build tests dynamically, just a pain to work with
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
@ -1739,7 +1741,8 @@ impl Step for CrateRustdoc {
Mode::ToolRustc,
target,
test_kind.subcommand(),
"src/tools/rustdoc");
"src/tools/rustdoc",
false);
if test_kind.subcommand() == "test" && !builder.fail_fast {
cargo.arg("--no-fail-fast");
}

View File

@ -115,7 +115,15 @@ impl Step for ToolBuild {
_ => panic!("unexpected Mode for tool build")
}
let mut cargo = prepare_tool_cargo(builder, compiler, self.mode, target, "build", path);
let mut cargo = prepare_tool_cargo(
builder,
compiler,
self.mode,
target,
"build",
path,
is_ext_tool,
);
cargo.arg("--features").arg(self.extra_features.join(" "));
let _folder = builder.fold_output(|| format!("stage{}-{}", compiler.stage, tool));
@ -238,6 +246,7 @@ pub fn prepare_tool_cargo(
target: Interned<String>,
command: &'static str,
path: &'static str,
is_ext_tool: bool,
) -> Command {
let mut cargo = builder.cargo(compiler, mode, target, command);
let dir = builder.src.join(path);
@ -247,6 +256,10 @@ pub fn prepare_tool_cargo(
// stages and such and it's just easier if they're not dynamically linked.
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
if is_ext_tool {
cargo.env("RUSTC_EXT_TOOL", "1");
}
if let Some(dir) = builder.openssl_install_dir(target) {
cargo.env("OPENSSL_STATIC", "1");
cargo.env("OPENSSL_DIR", dir);
@ -449,12 +462,15 @@ impl Step for Rustdoc {
target: builder.config.build,
});
let mut cargo = prepare_tool_cargo(builder,
build_compiler,
Mode::ToolRustc,
target,
"build",
"src/tools/rustdoc");
let mut cargo = prepare_tool_cargo(
builder,
build_compiler,
Mode::ToolRustc,
target,
"build",
"src/tools/rustdoc",
false,
);
// Most tools don't get debuginfo, but rustdoc should.
cargo.env("RUSTC_DEBUGINFO", builder.config.rust_debuginfo.to_string())

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
use std::fs::File;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};

View File

@ -72,7 +72,6 @@
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
#![no_std]
#![needs_allocator]
#![deny(bare_trait_objects)]
#![deny(missing_debug_implementations)]
#![cfg_attr(test, allow(deprecated))] // rand

View File

@ -10,7 +10,6 @@
#![no_std]
#![allow(unused_attributes)]
#![deny(bare_trait_objects)]
#![unstable(feature = "alloc_jemalloc",
reason = "implementation detail of std, does not provide any public API",
issue = "0")]

View File

@ -10,7 +10,6 @@
#![no_std]
#![allow(unused_attributes)]
#![deny(bare_trait_objects)]
#![unstable(feature = "alloc_system",
reason = "this library is unlikely to be stabilized in its current \
form or name",

View File

@ -30,7 +30,6 @@
#![cfg_attr(test, feature(test))]
#![allow(deprecated)]
#![deny(bare_trait_objects)]
extern crate alloc;
extern crate rustc_data_structures;

View File

@ -70,7 +70,6 @@
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))))]
#![no_core]
#![deny(bare_trait_objects)]
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]

View File

@ -14,8 +14,6 @@
//! Parsing does not happen at runtime: structures of `std::fmt::rt` are
//! generated instead.
#![deny(bare_trait_objects)]
#![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/",

View File

@ -283,8 +283,6 @@
//!
//! * [DOT language](http://www.graphviz.org/doc/info/lang.html)
#![deny(bare_trait_objects)]
#![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/",

View File

@ -21,7 +21,6 @@
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
#![panic_runtime]
#![allow(unused_features)]
#![deny(bare_trait_objects)]
#![feature(core_intrinsics)]
#![feature(libc)]

View File

@ -22,7 +22,6 @@
//! More documentation about each implementation can be found in the respective
//! module.
#![deny(bare_trait_objects)]
#![no_std]
#![unstable(feature = "panic_unwind", issue = "32837")]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

View File

@ -22,7 +22,6 @@
//! See [the book](../book/first-edition/procedural-macros.html) for more.
#![stable(feature = "proc_macro_lib", since = "1.15.0")]
#![deny(bare_trait_objects)]
#![deny(missing_docs)]
#![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",

View File

@ -15,5 +15,4 @@
reason = "internal implementation detail of rustc right now",
issue = "0")]
#![allow(unused_features)]
#![deny(bare_trait_objects)]
#![feature(staged_api)]

View File

@ -36,8 +36,6 @@
//!
//! This API is completely unstable and subject to change.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![feature(rustc_private)]
#[macro_use] extern crate log;

View File

@ -40,8 +40,6 @@
//!
//! This API is completely unstable and subject to change.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![sanitizer_runtime]
#![feature(alloc_system)]
#![feature(sanitizer_runtime)]

View File

@ -13,7 +13,6 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![allow(non_camel_case_types)]
#![deny(bare_trait_objects)]
#![feature(from_ref)]
#![feature(quote)]

View File

@ -23,7 +23,6 @@
#![feature(custom_attribute)]
#![feature(fs_read_write)]
#![allow(unused_attributes)]
#![deny(bare_trait_objects)]
#![feature(libc)]
#![feature(quote)]
#![feature(range_contains)]

View File

@ -20,7 +20,6 @@
#![feature(box_syntax)]
#![feature(custom_attribute)]
#![allow(unused_attributes)]
#![deny(bare_trait_objects)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]

View File

@ -16,8 +16,6 @@
//!
//! This API is completely unstable and subject to change.
#![deny(bare_trait_objects)]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]

View File

@ -14,8 +14,6 @@
//!
//! This API is completely unstable and subject to change.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -10,8 +10,6 @@
//! Support for serializing the dep-graph and reloading it.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -19,8 +19,6 @@
//!
//! This API is completely unstable and subject to change.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -12,7 +12,6 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![deny(bare_trait_objects)]
#![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",

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![sanitizer_runtime]
#![feature(alloc_system)]
#![feature(sanitizer_runtime)]

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -14,8 +14,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
*/
#![deny(bare_trait_objects)]
#![feature(slice_patterns)]
#![feature(slice_sort_by_cached_key)]
#![feature(from_ref)]

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![sanitizer_runtime]
#![feature(alloc_system)]
#![feature(sanitizer_runtime)]

View File

@ -14,8 +14,6 @@
//!
//! This API is completely unstable and subject to change.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -9,7 +9,6 @@
// except according to those terms.
#![allow(bad_style)]
#![deny(bare_trait_objects)]
pub struct Intrinsic {
pub inputs: &'static [&'static Type],

View File

@ -60,8 +60,6 @@
//! See the [`plugin` feature](../unstable-book/language-features/plugin.html) of
//! the Unstable Book for more examples.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -13,7 +13,6 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(custom_attribute)]
#![allow(unused_attributes)]
#![deny(bare_trait_objects)]
#![recursion_limit="256"]

View File

@ -21,8 +21,6 @@
//! one that doesn't; the one that doesn't might get decent parallel
//! build speedups.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -11,8 +11,6 @@
//! New recursive solver modeled on Chalk's recursive solver. Most of
//! the guts are broken up into modules; see the comments in those modules.
#![deny(bare_trait_objects)]
#![feature(crate_in_paths)]
#![feature(crate_visibility_modifier)]
#![feature(extern_prelude)]

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![sanitizer_runtime]
#![feature(alloc_system)]
#![feature(sanitizer_runtime)]

View File

@ -70,7 +70,6 @@ This API is completely unstable and subject to change.
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![allow(non_camel_case_types)]
#![deny(bare_trait_objects)]
#![feature(box_patterns)]
#![feature(box_syntax)]

View File

@ -14,8 +14,6 @@
Core encoding and decoding interfaces.
*/
#![deny(bare_trait_objects)]
#![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/",

View File

@ -221,7 +221,6 @@
// Don't link to std. We are std.
#![no_std]
#![deny(bare_trait_objects)]
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]

View File

@ -14,8 +14,6 @@
//!
//! This API is completely unstable and subject to change.
#![deny(bare_trait_objects)]
#![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/",

View File

@ -10,8 +10,6 @@
//! Syntax extensions in the Rust compiler.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -14,8 +14,6 @@
//!
//! This API is completely unstable and subject to change.
#![deny(bare_trait_objects)]
#![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/")]

View File

@ -45,7 +45,6 @@
html_root_url = "https://doc.rust-lang.org/nightly/",
html_playground_url = "https://play.rust-lang.org/",
test(attr(deny(warnings))))]
#![deny(bare_trait_objects)]
#![deny(missing_docs)]
#![cfg_attr(windows, feature(libc))]

View File

@ -27,8 +27,6 @@
// this crate, which relies on this attribute (rather than the value of `--crate-name` passed by
// cargo) to detect this crate.
#![deny(bare_trait_objects)]
#![crate_name = "test"]
#![unstable(feature = "test", issue = "27812")]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(bare_trait_objects)]
#![no_std]
#![unstable(feature = "panic_unwind", issue = "32837")]