diff --git a/mk/target.mk b/mk/target.mk index f90b09479c9..32a3eb5c20d 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -17,14 +17,6 @@ export CFG_COMPILER_HOST_TRIPLE export CFG_DEFAULT_LINKER export CFG_DEFAULT_AR -# The standard libraries should be held up to a higher standard than any old -# code, make sure that these common warnings are denied by default. These can -# be overridden during development temporarily. For stage0, we allow warnings -# which may be bugs in stage0 (should be fixed in stage1+) -RUST_LIB_FLAGS_ST0 += -W warnings -RUST_LIB_FLAGS_ST1 += -D warnings -RUST_LIB_FLAGS_ST2 += -D warnings - # Macro that generates the full list of dependencies for a crate at a particular # stage/target/host tuple. # diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 0a232ed0620..403baa4a7b2 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -70,6 +70,7 @@ test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))] #![no_std] #![needs_allocator] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(allocator)] #![feature(box_syntax)] diff --git a/src/liballoc_jemalloc/lib.rs b/src/liballoc_jemalloc/lib.rs index 91d229b819d..b009dfd8c75 100644 --- a/src/liballoc_jemalloc/lib.rs +++ b/src/liballoc_jemalloc/lib.rs @@ -16,6 +16,7 @@ reason = "this library is unlikely to be stabilized in its current \ form or name", issue = "27783")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(allocator)] #![feature(libc)] #![feature(staged_api)] diff --git a/src/liballoc_system/lib.rs b/src/liballoc_system/lib.rs index ffb6999d6e3..8a9e32daa72 100644 --- a/src/liballoc_system/lib.rs +++ b/src/liballoc_system/lib.rs @@ -12,6 +12,7 @@ #![crate_type = "rlib"] #![no_std] #![allocator] +#![cfg_attr(not(stage0), deny(warnings))] #![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 cd2093984e6..46a63390c83 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -27,6 +27,7 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", test(no_crate_inject, attr(deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(alloc)] #![feature(core_intrinsics)] diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 6077a4c0104..a3c05c5a681 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -28,6 +28,7 @@ #![allow(trivial_casts)] #![cfg_attr(test, allow(deprecated))] // rand +#![cfg_attr(not(stage0), deny(warnings))] #![feature(alloc)] #![feature(box_patterns)] diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index e8803976937..f76b8655ad1 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -56,6 +56,7 @@ #![no_core] #![deny(missing_docs)] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(allow_internal_unstable)] #![feature(associated_type_defaults)] diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index a60a1c67e17..f316250d96d 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -22,6 +22,7 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(libc)] #![feature(staged_api)] diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index 7a229ad5222..07d26cddfdb 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -23,6 +23,7 @@ html_root_url = "https://doc.rust-lang.org/nightly/", html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(staged_api)] #![feature(unicode)] diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index 38b45ec0fea..2e26cc1b266 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -280,6 +280,7 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(allow(unused_variables), deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(str_escape)] diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index dbd553acd68..011f5a744dc 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -168,6 +168,7 @@ html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))] #![deny(missing_docs)] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(box_syntax)] #![feature(const_fn)] diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 06f4c8dfd20..9640322a2dd 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -23,6 +23,7 @@ html_root_url = "https://doc.rust-lang.org/nightly/", html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![no_std] #![unstable(feature = "rand", reason = "use `rand` from crates.io", diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs index 913314c4899..8404026df14 100644 --- a/src/librbml/lib.rs +++ b/src/librbml/lib.rs @@ -120,6 +120,7 @@ html_root_url = "https://doc.rust-lang.org/nightly/", html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 4d772de7835..3167deb5cbd 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -19,8 +19,9 @@ #![crate_type = "dylib"] #![crate_type = "rlib"] #![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/")] + html_favicon_url = "https://doc.rust-lang.org/favicon.ico", + html_root_url = "https://doc.rust-lang.org/nightly/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(associated_consts)] #![feature(box_patterns)] diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index 746d3ba07d6..4d8cfc23804 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -28,6 +28,7 @@ #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(box_syntax)] #![feature(libc)] diff --git a/src/librustc_bitflags/lib.rs b/src/librustc_bitflags/lib.rs index e2a929f58e1..e2025eaa8ee 100644 --- a/src/librustc_bitflags/lib.rs +++ b/src/librustc_bitflags/lib.rs @@ -15,6 +15,7 @@ #![crate_type = "rlib"] #![no_std] #![unstable(feature = "rustc_private", issue = "27812")] +#![cfg_attr(not(stage0), deny(warnings))] //! A typesafe bitmask flag generator. diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index d730b383a80..e7f5fddc7bb 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -15,6 +15,7 @@ #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![allow(non_camel_case_types)] diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs index 1fbbdf17455..2983590af32 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -23,6 +23,7 @@ #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(hashmap_hasher)] #![feature(nonzero)] diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 31151e10a5a..9a63751d889 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -21,6 +21,7 @@ #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(box_syntax)] #![feature(libc)] diff --git a/src/librustc_front/lib.rs b/src/librustc_front/lib.rs index b12c41d060a..02ad69e8a7c 100644 --- a/src/librustc_front/lib.rs +++ b/src/librustc_front/lib.rs @@ -19,8 +19,9 @@ #![crate_type = "dylib"] #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", - html_favicon_url = "https://doc.rust-lang.org/favicon.ico", - html_root_url = "http://doc.rust-lang.org/nightly/")] + html_favicon_url = "https://doc.rust-lang.org/favicon.ico", + html_root_url = "http://doc.rust-lang.org/nightly/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(associated_consts)] #![feature(box_patterns)] diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 78252c491ec..6868b4f2ab7 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -26,6 +26,7 @@ #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![cfg_attr(test, feature(test))] #![feature(box_patterns)] diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index fc7fa299fb8..f831232303b 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -21,6 +21,7 @@ #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(associated_consts)] #![feature(box_syntax)] diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index 42332c46969..f416ec75010 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -13,8 +13,9 @@ #![crate_type = "dylib"] #![crate_type = "rlib"] #![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/")] + html_favicon_url = "https://doc.rust-lang.org/favicon.ico", + html_root_url = "https://doc.rust-lang.org/nightly/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(box_patterns)] #![feature(enumset)] diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 9cc40bbc383..4337f62db12 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -17,6 +17,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! #![crate_name = "rustc_mir"] #![crate_type = "rlib"] #![crate_type = "dylib"] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(rustc_private)] diff --git a/src/librustc_passes/lib.rs b/src/librustc_passes/lib.rs index fcdbd6384d5..91bfb19aa9d 100644 --- a/src/librustc_passes/lib.rs +++ b/src/librustc_passes/lib.rs @@ -19,8 +19,9 @@ #![crate_type = "dylib"] #![crate_type = "rlib"] #![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/")] + html_favicon_url = "https://doc.rust-lang.org/favicon.ico", + html_root_url = "https://doc.rust-lang.org/nightly/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(rustc_diagnostic_macros)] #![feature(staged_api)] diff --git a/src/librustc_platform_intrinsics/lib.rs b/src/librustc_platform_intrinsics/lib.rs index e857434682d..6a43ef65d6a 100644 --- a/src/librustc_platform_intrinsics/lib.rs +++ b/src/librustc_platform_intrinsics/lib.rs @@ -13,6 +13,7 @@ #![crate_type = "dylib"] #![crate_type = "rlib"] #![feature(staged_api, rustc_private)] +#![cfg_attr(not(stage0), deny(warnings))] extern crate rustc_llvm as llvm; extern crate rustc; diff --git a/src/librustc_plugin/lib.rs b/src/librustc_plugin/lib.rs index 333c226c2a3..c55e97412bb 100644 --- a/src/librustc_plugin/lib.rs +++ b/src/librustc_plugin/lib.rs @@ -55,8 +55,9 @@ #![crate_type = "dylib"] #![crate_type = "rlib"] #![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/")] + html_favicon_url = "https://doc.rust-lang.org/favicon.ico", + html_root_url = "https://doc.rust-lang.org/nightly/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(dynamic_lib)] #![feature(staged_api)] diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index cfd0540cc60..929ec523f63 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -15,6 +15,7 @@ #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 444c43163e3..b648af7fe2b 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -15,6 +15,7 @@ #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(associated_consts)] #![feature(borrow_state)] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index c1ab0284ade..9ab056a187b 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -21,6 +21,7 @@ #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(box_patterns)] #![feature(box_syntax)] diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 17d71fa7be9..49de0efa61d 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -70,6 +70,7 @@ This API is completely unstable and subject to change. #![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/")] +#![cfg_attr(not(stage0), deny(warnings))] #![allow(non_camel_case_types)] diff --git a/src/librustc_unicode/lib.rs b/src/librustc_unicode/lib.rs index 161da079110..4cbcfd5a0b2 100644 --- a/src/librustc_unicode/lib.rs +++ b/src/librustc_unicode/lib.rs @@ -29,6 +29,7 @@ html_playground_url = "https://play.rust-lang.org/", issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/", test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![no_std] #![feature(core_char_ext)] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index ac5b64f37aa..c52459f6c10 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -16,6 +16,7 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", html_playground_url = "https://play.rust-lang.org/")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(box_patterns)] #![feature(box_syntax)] diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 910600d91e4..ee5e40adc9c 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -25,6 +25,7 @@ Core encoding and decoding interfaces. html_root_url = "https://doc.rust-lang.org/nightly/", html_playground_url = "https://play.rust-lang.org/", test(attr(allow(unused_variables), deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(box_syntax)] #![feature(collections)] diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 9adea351e3d..bc8fafd7fb1 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -273,6 +273,7 @@ #![deny(missing_docs)] #![allow(unused_features)] // std may use features in a platform-specific way +#![cfg_attr(not(stage0), deny(warnings))] #[cfg(test)] extern crate test; #[cfg(test)] #[macro_use] extern crate log; diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 795f4044f6e..d7d3e576a61 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -22,6 +22,7 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(associated_consts)] #![feature(filling_drop)] diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index 0f049fa9792..97531d4279d 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -11,13 +11,13 @@ //! Syntax extensions in the Rust compiler. #![crate_name = "syntax_ext"] +#![unstable(feature = "rustc_private", issue = "27812")] #![crate_type = "dylib"] #![crate_type = "rlib"] #![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/")] - -#![unstable(feature = "rustc_private", issue = "27812")] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index df1fedf3d4e..771e2470455 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -52,6 +52,7 @@ html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))] #![deny(missing_docs)] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(box_syntax)] #![feature(staged_api)] diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index ac5b235854a..130ce3a9637 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -31,6 +31,7 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))] +#![cfg_attr(not(stage0), deny(warnings))] #![feature(asm)] #![feature(box_syntax)]