about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>2018-07-13 14:12:58 +0900
committerTatsuyuki Ishi <ishitatsuyuki@gmail.com>2018-07-25 10:25:29 +0900
commite098985939a1ac5baef4314aee44efc9dbf1b820 (patch)
treeea632b74c2c6b0663243e3c2072c02944f2fa6b1 /src
parent4f1d4e4db699d674cae5dec3a8026b1388820895 (diff)
downloadrust-e098985939a1ac5baef4314aee44efc9dbf1b820.tar.gz
rust-e098985939a1ac5baef4314aee44efc9dbf1b820.zip
Deny bare_trait_objects globally
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/bin/rustc.rs3
-rw-r--r--src/bootstrap/check.rs3
-rw-r--r--src/bootstrap/doc.rs1
-rw-r--r--src/bootstrap/test.rs9
-rw-r--r--src/bootstrap/tool.rs30
-rw-r--r--src/build_helper/lib.rs2
-rw-r--r--src/liballoc/lib.rs1
-rw-r--r--src/liballoc_jemalloc/lib.rs1
-rw-r--r--src/liballoc_system/lib.rs1
-rw-r--r--src/libarena/lib.rs1
-rw-r--r--src/libcore/lib.rs1
-rw-r--r--src/libfmt_macros/lib.rs2
-rw-r--r--src/libgraphviz/lib.rs2
-rw-r--r--src/libpanic_abort/lib.rs1
-rw-r--r--src/libpanic_unwind/lib.rs1
-rw-r--r--src/libproc_macro/lib.rs1
-rw-r--r--src/libprofiler_builtins/lib.rs1
-rw-r--r--src/librustc/lib.rs2
-rw-r--r--src/librustc_allocator/lib.rs1
-rw-r--r--src/librustc_apfloat/lib.rs2
-rw-r--r--src/librustc_asan/lib.rs2
-rw-r--r--src/librustc_borrowck/lib.rs1
-rw-r--r--src/librustc_codegen_llvm/lib.rs1
-rw-r--r--src/librustc_codegen_utils/lib.rs1
-rw-r--r--src/librustc_data_structures/lib.rs2
-rw-r--r--src/librustc_driver/lib.rs2
-rw-r--r--src/librustc_errors/lib.rs2
-rw-r--r--src/librustc_incremental/lib.rs2
-rw-r--r--src/librustc_lint/lib.rs2
-rw-r--r--src/librustc_llvm/lib.rs1
-rw-r--r--src/librustc_lsan/lib.rs2
-rw-r--r--src/librustc_metadata/lib.rs2
-rw-r--r--src/librustc_mir/lib.rs2
-rw-r--r--src/librustc_msan/lib.rs2
-rw-r--r--src/librustc_passes/lib.rs2
-rw-r--r--src/librustc_platform_intrinsics/lib.rs1
-rw-r--r--src/librustc_plugin/lib.rs2
-rw-r--r--src/librustc_privacy/lib.rs2
-rw-r--r--src/librustc_resolve/lib.rs2
-rw-r--r--src/librustc_save_analysis/lib.rs1
-rw-r--r--src/librustc_target/lib.rs2
-rw-r--r--src/librustc_traits/lib.rs2
-rw-r--r--src/librustc_tsan/lib.rs2
-rw-r--r--src/librustc_typeck/lib.rs1
-rw-r--r--src/libserialize/lib.rs2
-rw-r--r--src/libstd/lib.rs1
-rw-r--r--src/libsyntax/lib.rs2
-rw-r--r--src/libsyntax_ext/lib.rs2
-rw-r--r--src/libsyntax_pos/lib.rs2
-rw-r--r--src/libterm/lib.rs1
-rw-r--r--src/libtest/lib.rs2
-rw-r--r--src/libunwind/lib.rs2
52 files changed, 34 insertions, 87 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index f2b2f6f1eeb..d31e5382714 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -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 {
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 39c5c832831..dd2a64402b4 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -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);
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
index f71cb119b77..913b8162a44 100644
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
@@ -814,6 +814,7 @@ impl Step for Rustdoc {
             target,
             "doc",
             "src/tools/rustdoc",
+            false
         );
 
         cargo.env("RUSTDOCFLAGS", "--document-private-items");
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 639c96bc208..3bcebd08b1e 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -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");
         }
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index 0969e5abe07..745733e4d4c 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -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())
diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs
index 00e5dee256e..1cbb8e49bfa 100644
--- a/src/build_helper/lib.rs
+++ b/src/build_helper/lib.rs
@@ -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};
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 63cf01a0fac..ef619527e06 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -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
diff --git a/src/liballoc_jemalloc/lib.rs b/src/liballoc_jemalloc/lib.rs
index 413b212281b..b3b20715511 100644
--- a/src/liballoc_jemalloc/lib.rs
+++ b/src/liballoc_jemalloc/lib.rs
@@ -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")]
diff --git a/src/liballoc_system/lib.rs b/src/liballoc_system/lib.rs
index c6c0abefbab..64348e05de7 100644
--- a/src/liballoc_system/lib.rs
+++ b/src/liballoc_system/lib.rs
@@ -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",
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs
index 6f692923c85..0f4a5d16e17 100644
--- a/src/libarena/lib.rs
+++ b/src/libarena/lib.rs
@@ -30,7 +30,6 @@
 #![cfg_attr(test, feature(test))]
 
 #![allow(deprecated)]
-#![deny(bare_trait_objects)]
 
 extern crate alloc;
 extern crate rustc_data_structures;
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index ae0469bfa04..72074e1dbce 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -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)]
 
diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs
index 9952e5f64d6..62e0ffb8b74 100644
--- a/src/libfmt_macros/lib.rs
+++ b/src/libfmt_macros/lib.rs
@@ -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/",
diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs
index 9e71ed4063e..158d0101515 100644
--- a/src/libgraphviz/lib.rs
+++ b/src/libgraphviz/lib.rs
@@ -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/",
diff --git a/src/libpanic_abort/lib.rs b/src/libpanic_abort/lib.rs
index 02ab28507d7..392bf17968f 100644
--- a/src/libpanic_abort/lib.rs
+++ b/src/libpanic_abort/lib.rs
@@ -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)]
diff --git a/src/libpanic_unwind/lib.rs b/src/libpanic_unwind/lib.rs
index f8cd29fc086..5c320bb369e 100644
--- a/src/libpanic_unwind/lib.rs
+++ b/src/libpanic_unwind/lib.rs
@@ -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",
diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs
index 61da9db76f6..bf6e4a3aaa4 100644
--- a/src/libproc_macro/lib.rs
+++ b/src/libproc_macro/lib.rs
@@ -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",
diff --git a/src/libprofiler_builtins/lib.rs b/src/libprofiler_builtins/lib.rs
index 3d91505cd77..6d0d6d115b7 100644
--- a/src/libprofiler_builtins/lib.rs
+++ b/src/libprofiler_builtins/lib.rs
@@ -15,5 +15,4 @@
             reason = "internal implementation detail of rustc right now",
             issue = "0")]
 #![allow(unused_features)]
-#![deny(bare_trait_objects)]
 #![feature(staged_api)]
diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs
index c72952efc61..8050522d066 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc/lib.rs
@@ -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/")]
diff --git a/src/librustc_allocator/lib.rs b/src/librustc_allocator/lib.rs
index 1227936ce96..b217d3665a2 100644
--- a/src/librustc_allocator/lib.rs
+++ b/src/librustc_allocator/lib.rs
@@ -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;
diff --git a/src/librustc_apfloat/lib.rs b/src/librustc_apfloat/lib.rs
index c7cd958016d..08438805a70 100644
--- a/src/librustc_apfloat/lib.rs
+++ b/src/librustc_apfloat/lib.rs
@@ -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/")]
diff --git a/src/librustc_asan/lib.rs b/src/librustc_asan/lib.rs
index 7bd1e98f85d..0c78fd74a23 100644
--- a/src/librustc_asan/lib.rs
+++ b/src/librustc_asan/lib.rs
@@ -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)]
diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs
index d583a32c431..a5a20af0e4e 100644
--- a/src/librustc_borrowck/lib.rs
+++ b/src/librustc_borrowck/lib.rs
@@ -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)]
diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs
index 8aa7902021f..90f96c9687b 100644
--- a/src/librustc_codegen_llvm/lib.rs
+++ b/src/librustc_codegen_llvm/lib.rs
@@ -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)]
diff --git a/src/librustc_codegen_utils/lib.rs b/src/librustc_codegen_utils/lib.rs
index e9031007a4e..f59cf5832fc 100644
--- a/src/librustc_codegen_utils/lib.rs
+++ b/src/librustc_codegen_utils/lib.rs
@@ -20,7 +20,6 @@
 #![feature(box_syntax)]
 #![feature(custom_attribute)]
 #![allow(unused_attributes)]
-#![deny(bare_trait_objects)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
 
diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs
index ef0d57c7b7c..a9e582e510e 100644
--- a/src/librustc_data_structures/lib.rs
+++ b/src/librustc_data_structures/lib.rs
@@ -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/")]
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 2100ceea228..44386d9c3ee 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -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/")]
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index c0f07645f49..67d2aa4d770 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -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/")]
diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs
index 2ef88041d33..3839c133a6e 100644
--- a/src/librustc_incremental/lib.rs
+++ b/src/librustc_incremental/lib.rs
@@ -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/")]
diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs
index 798c289ac2f..78a8c494f48 100644
--- a/src/librustc_lint/lib.rs
+++ b/src/librustc_lint/lib.rs
@@ -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/")]
diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs
index c60016cde0d..741758cb954 100644
--- a/src/librustc_llvm/lib.rs
+++ b/src/librustc_llvm/lib.rs
@@ -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",
diff --git a/src/librustc_lsan/lib.rs b/src/librustc_lsan/lib.rs
index 7bd1e98f85d..0c78fd74a23 100644
--- a/src/librustc_lsan/lib.rs
+++ b/src/librustc_lsan/lib.rs
@@ -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)]
diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs
index d535c1ef903..5cba0387d17 100644
--- a/src/librustc_metadata/lib.rs
+++ b/src/librustc_metadata/lib.rs
@@ -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/")]
diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs
index d58affbae75..92c0a2b475c 100644
--- a/src/librustc_mir/lib.rs
+++ b/src/librustc_mir/lib.rs
@@ -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)]
diff --git a/src/librustc_msan/lib.rs b/src/librustc_msan/lib.rs
index 7bd1e98f85d..0c78fd74a23 100644
--- a/src/librustc_msan/lib.rs
+++ b/src/librustc_msan/lib.rs
@@ -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)]
diff --git a/src/librustc_passes/lib.rs b/src/librustc_passes/lib.rs
index 15d7c0fdaa3..41f1e782965 100644
--- a/src/librustc_passes/lib.rs
+++ b/src/librustc_passes/lib.rs
@@ -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/")]
diff --git a/src/librustc_platform_intrinsics/lib.rs b/src/librustc_platform_intrinsics/lib.rs
index 92e83fd70fa..b57debdd994 100644
--- a/src/librustc_platform_intrinsics/lib.rs
+++ b/src/librustc_platform_intrinsics/lib.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![allow(bad_style)]
-#![deny(bare_trait_objects)]
 
 pub struct Intrinsic {
     pub inputs: &'static [&'static Type],
diff --git a/src/librustc_plugin/lib.rs b/src/librustc_plugin/lib.rs
index b2c492f204f..348aa6a7cef 100644
--- a/src/librustc_plugin/lib.rs
+++ b/src/librustc_plugin/lib.rs
@@ -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/")]
diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs
index 7b13c98b31d..405952065da 100644
--- a/src/librustc_privacy/lib.rs
+++ b/src/librustc_privacy/lib.rs
@@ -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/")]
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index 765016fdc4a..8130c4e8326 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -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/")]
diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs
index c84f194f023..a250d4a3598 100644
--- a/src/librustc_save_analysis/lib.rs
+++ b/src/librustc_save_analysis/lib.rs
@@ -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"]
 
diff --git a/src/librustc_target/lib.rs b/src/librustc_target/lib.rs
index e611d26da56..8f491157439 100644
--- a/src/librustc_target/lib.rs
+++ b/src/librustc_target/lib.rs
@@ -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/")]
diff --git a/src/librustc_traits/lib.rs b/src/librustc_traits/lib.rs
index 2a4cacb5623..d17cf35f181 100644
--- a/src/librustc_traits/lib.rs
+++ b/src/librustc_traits/lib.rs
@@ -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)]
diff --git a/src/librustc_tsan/lib.rs b/src/librustc_tsan/lib.rs
index 7bd1e98f85d..0c78fd74a23 100644
--- a/src/librustc_tsan/lib.rs
+++ b/src/librustc_tsan/lib.rs
@@ -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)]
diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs
index e343fb1a57b..6bf1ec8f697 100644
--- a/src/librustc_typeck/lib.rs
+++ b/src/librustc_typeck/lib.rs
@@ -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)]
diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs
index 7c1bb69434d..a5f4b32b329 100644
--- a/src/libserialize/lib.rs
+++ b/src/libserialize/lib.rs
@@ -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/",
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 0396ba362bd..3c01de2e997 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -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)]
 
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index d241ae1d442..60de94821bb 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -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/",
diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs
index ff76e788b3c..f0d33835cd0 100644
--- a/src/libsyntax_ext/lib.rs
+++ b/src/libsyntax_ext/lib.rs
@@ -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/")]
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs
index cc09a944e4c..61af70af47d 100644
--- a/src/libsyntax_pos/lib.rs
+++ b/src/libsyntax_pos/lib.rs
@@ -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/")]
diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs
index 6b115770237..cf92ce27ee5 100644
--- a/src/libterm/lib.rs
+++ b/src/libterm/lib.rs
@@ -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))]
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index 6b547dff912..76206e2c10d 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -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",
diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
index ea5eee3cc7d..2b3c19c067e 100644
--- a/src/libunwind/lib.rs
+++ b/src/libunwind/lib.rs
@@ -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")]