Skip to content

Commit 4341521

Browse files
committed
Remove lint annotations in specific crates that are already enforced by rustbuild
Remove some random unnecessary lint `allow`s
1 parent 0cfb2f7 commit 4341521

File tree

119 files changed

+146
-322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+146
-322
lines changed

src/bootstrap/bin/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
//! parent directory, and otherwise documentation can be found throughout the `build`
66
//! directory in each respective module.
77
8-
#![deny(warnings)]
8+
// NO-RUSTC-WRAPPER
9+
#![deny(warnings, rust_2018_idioms)]
910

1011
use std::env;
1112

src/bootstrap/bin/rustc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
//! switching compilers for the bootstrap and for build scripts will probably
1616
//! never get replaced.
1717
18-
#![deny(warnings)]
18+
// NO-RUSTC-WRAPPER
19+
#![deny(warnings, rust_2018_idioms)]
1920

2021
use std::env;
2122
use std::ffi::OsString;

src/bootstrap/bin/rustdoc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
//!
33
//! See comments in `src/bootstrap/rustc.rs` for more information.
44
5-
#![deny(warnings)]
5+
// NO-RUSTC-WRAPPER
6+
#![deny(warnings, rust_2018_idioms)]
67

78
use std::env;
89
use std::process::Command;

src/bootstrap/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@
103103
//! More documentation can be found in each respective module below, and you can
104104
//! also check out the `src/bootstrap/README.md` file for more information.
105105
106-
#![deny(rust_2018_idioms)]
107-
#![deny(warnings)]
106+
// NO-RUSTC-WRAPPER
107+
#![deny(warnings, rust_2018_idioms)]
108+
108109
#![feature(core_intrinsics)]
109110
#![feature(drain_filter)]
110111

src/build_helper/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#![deny(rust_2018_idioms)]
1+
// NO-RUSTC-WRAPPER
2+
#![deny(warnings, rust_2018_idioms)]
23

34
use std::fs::File;
45
use std::path::{Path, PathBuf};

src/liballoc/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@
6262
#![warn(missing_docs)]
6363
#![warn(missing_debug_implementations)]
6464
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
65-
66-
#![deny(rust_2018_idioms)]
6765
#![allow(explicit_outlives_requirements)]
6866

6967
#![cfg_attr(not(test), feature(generator_trait))]

src/liballoc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![feature(trusted_len)]
99
#![feature(try_reserve)]
1010
#![feature(unboxed_closures)]
11-
#![deny(rust_2018_idioms)]
1211

1312
use std::hash::{Hash, Hasher};
1413
use std::collections::hash_map::DefaultHasher;

src/libarena/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
1212
test(no_crate_inject, attr(deny(warnings))))]
1313

14-
#![deny(rust_2018_idioms)]
1514
#![deny(unused_lifetimes)]
1615

1716
#![feature(core_intrinsics)]

src/libcore/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@
6262
#![warn(missing_docs)]
6363
#![warn(missing_debug_implementations)]
6464
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
65-
66-
#![deny(rust_2018_idioms)]
6765
#![allow(explicit_outlives_requirements)]
6866

6967
#![feature(allow_internal_unstable)]

src/libcore/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#![feature(const_fn)]
3333
#![feature(iter_partition_in_place)]
3434
#![feature(iter_is_partitioned)]
35-
#![warn(rust_2018_idioms)]
3635

3736
extern crate test;
3837

src/libfmt_macros/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
html_playground_url = "https://play.rust-lang.org/",
99
test(attr(deny(warnings))))]
1010

11-
#![deny(rust_2018_idioms)]
1211
#![deny(unused_lifetimes)]
1312

1413
#![feature(nll)]

src/libgraphviz/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@
274274
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
275275
test(attr(allow(unused_variables), deny(warnings))))]
276276

277-
#![deny(rust_2018_idioms)]
278-
279277
#![feature(nll)]
280278

281279
use LabelText::*;

src/libpanic_abort/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#![panic_runtime]
1111

1212
#![allow(unused_features)]
13-
#![deny(rust_2018_idioms)]
1413

1514
#![feature(core_intrinsics)]
1615
#![feature(libc)]

src/libpanic_unwind/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
1818
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
1919

20-
#![deny(rust_2018_idioms)]
21-
2220
#![feature(core_intrinsics)]
2321
#![feature(lang_items)]
2422
#![feature(libc)]

src/libproc_macro/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
test(no_crate_inject, attr(deny(warnings))),
1818
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))))]
1919

20-
#![deny(rust_2018_idioms)]
21-
2220
#![feature(nll)]
2321
#![feature(staged_api)]
2422
#![feature(const_fn)]

src/libprofiler_builtins/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77
#![allow(unused_features)]
88
#![feature(nll)]
99
#![feature(staged_api)]
10-
#![deny(rust_2018_idioms)]

src/librustc/error_codes.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_snake_case)]
2-
31
// Error messages for EXXXX errors.
42
// Each message should start and end with a new line, and be wrapped to 80 characters.
53
// In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable.

src/librustc/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
2929
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
3030

31-
#![deny(rust_2018_idioms)]
3231
#![deny(unused_lifetimes)]
3332

3433
#![feature(arbitrary_self_types)]
@@ -81,8 +80,7 @@ extern crate libc;
8180

8281
// Use the test crate here so we depend on getopts through it. This allow tools to link to both
8382
// librustc_driver and libtest.
84-
#[allow(unused_extern_crates)]
85-
extern crate test;
83+
extern crate test as _;
8684

8785
#[macro_use]
8886
mod macros;

src/librustc/session/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ impl RustcOptGroup {
16281628
// *unstable* options, i.e., options that are only enabled when the
16291629
// user also passes the `-Z unstable-options` debugging flag.
16301630
mod opt {
1631-
// The `fn opt_u` etc below are written so that we can use them
1631+
// The `fn flag*` etc below are written so that we can use them
16321632
// in the future; do not warn about them not being used right now.
16331633
#![allow(dead_code)]
16341634

src/librustc/ty/query/job.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(warnings)]
1+
#![allow(unused_imports)] // `cfg(parallel_compiler)`
22

33
use std::mem;
44
use std::process;
@@ -138,6 +138,7 @@ impl<'tcx> QueryJob<'tcx> {
138138
self.latch.set();
139139
}
140140

141+
#[cfg(parallel_compiler)]
141142
fn as_ptr(&self) -> *const QueryJob<'tcx> {
142143
self as *const _
143144
}

src/librustc_apfloat/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
3333
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
3434
#![forbid(unsafe_code)]
35-
#![deny(rust_2018_idioms)]
3635

3736
#![feature(nll)]
3837

src/librustc_asan/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@
66
#![unstable(feature = "sanitizer_runtime_lib",
77
reason = "internal implementation detail of sanitizers",
88
issue = "0")]
9-
10-
#![deny(rust_2018_idioms)]

src/librustc_ast_borrowck/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
22

33
#![allow(non_camel_case_types)]
4-
#![deny(rust_2018_idioms)]
54
#![deny(unused_lifetimes)]
65

76
#![feature(in_band_lifetimes)]

src/librustc_codegen_llvm/error_codes.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_snake_case)]
2-
31
register_long_diagnostics! {
42

53
E0511: r##"

src/librustc_codegen_llvm/intrinsic.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_upper_case_globals)]
2-
31
use crate::attributes;
42
use crate::llvm;
53
use crate::llvm_util;

src/librustc_codegen_llvm/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#![feature(crate_visibility_modifier)]
1313
#![feature(extern_types)]
1414
#![feature(in_band_lifetimes)]
15-
#![allow(unused_attributes)]
1615
#![feature(libc)]
1716
#![feature(nll)]
1817
#![feature(rustc_diagnostic_macros)]
@@ -22,7 +21,6 @@
2221
#![feature(static_nobundle)]
2322
#![feature(trusted_len)]
2423
#![feature(mem_take)]
25-
#![deny(rust_2018_idioms)]
2624
#![deny(unused_lifetimes)]
2725

2826
use back::write::{create_target_machine, create_informational_target_machine};

src/librustc_codegen_llvm/llvm/ffi.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![allow(non_camel_case_types)]
2+
#![allow(non_upper_case_globals)]
3+
14
use super::debuginfo::{
25
DIBuilder, DIDescriptor, DIFile, DILexicalBlock, DISubprogram, DIType,
36
DIBasicType, DIDerivedType, DICompositeType, DIScope, DIVariable,

src/librustc_codegen_llvm/llvm/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#![allow(non_upper_case_globals)]
2-
#![allow(non_camel_case_types)]
31
#![allow(non_snake_case)]
4-
#![deny(bare_trait_objects)]
52

63
pub use self::IntPredicate::*;
74
pub use self::RealPredicate::*;

src/librustc_codegen_llvm/type_.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_upper_case_globals)]
2-
31
pub use crate::llvm::Type;
42

53
use crate::llvm;

src/librustc_codegen_ssa/base.rs

-6
Original file line numberDiff line numberDiff line change
@@ -781,12 +781,6 @@ impl CrateInfo {
781781
}
782782
}
783783

784-
fn is_codegened_item(tcx: TyCtxt<'_>, id: DefId) -> bool {
785-
let (all_mono_items, _) =
786-
tcx.collect_and_partition_mono_items(LOCAL_CRATE);
787-
all_mono_items.contains(&id)
788-
}
789-
790784
pub fn provide_both(providers: &mut Providers<'_>) {
791785
providers.backend_optimization_level = |tcx, cratenum| {
792786
let for_speed = match tcx.sess.opts.optimize {

src/librustc_codegen_ssa/error_codes.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_snake_case)]
2-
31
register_long_diagnostics! {
42

53
E0668: r##"

src/librustc_codegen_ssa/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#![feature(nll)]
1212
#![feature(trusted_len)]
1313
#![feature(mem_take)]
14-
#![allow(unused_attributes)]
15-
#![allow(dead_code)]
16-
#![deny(rust_2018_idioms)]
1714
#![deny(unused_lifetimes)]
1815

1916
#![recursion_limit="256"]

src/librustc_codegen_utils/codegen_backend.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//! This API is completely unstable and subject to change.
66
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
8-
#![deny(warnings)]
9-
#![feature(box_syntax)]
108

119
use std::any::Any;
1210
use std::sync::mpsc;

src/librustc_codegen_utils/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@
1010
#![feature(core_intrinsics)]
1111
#![feature(never_type)]
1212
#![feature(nll)]
13-
#![allow(unused_attributes)]
1413
#![feature(rustc_diagnostic_macros)]
1514
#![feature(in_band_lifetimes)]
1615

1716
#![recursion_limit="256"]
1817

19-
#![deny(rust_2018_idioms)]
2018
#![deny(unused_lifetimes)]
2119

2220
#[macro_use]

src/librustc_data_structures/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#![cfg_attr(unix, feature(libc))]
2727
#![cfg_attr(test, feature(test))]
2828

29-
#![deny(rust_2018_idioms)]
3029
#![cfg_attr(not(bootstrap), allow(rustc::default_hash_types))]
3130

3231
#[macro_use]

src/librustc_driver/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#![recursion_limit="256"]
1818

19-
#![deny(rust_2018_idioms)]
2019
#![deny(unused_lifetimes)]
2120

2221
pub extern crate getopts;

src/librustc_errors/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
66

77
#![feature(crate_visibility_modifier)]
8-
#![allow(unused_attributes)]
98
#![cfg_attr(unix, feature(libc))]
109
#![feature(nll)]
1110
#![feature(optin_builtin_traits)]
12-
#![deny(rust_2018_idioms)]
1311
#![deny(unused_lifetimes)]
1412

1513
pub use emitter::ColorConfig;

src/librustc_fs_util/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![deny(rust_2018_idioms)]
2-
31
use std::path::{Path, PathBuf};
42
use std::ffi::CString;
53
use std::fs;

src/librustc_incremental/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#![recursion_limit="256"]
1010

11-
#![deny(rust_2018_idioms)]
1211
#![deny(unused_lifetimes)]
1312

1413
#[macro_use] extern crate rustc;

src/librustc_interface/interface.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use rustc_data_structures::OnDrop;
1212
use rustc_data_structures::sync::Lrc;
1313
use rustc_data_structures::fx::{FxHashSet, FxHashMap};
1414
use rustc_metadata::cstore::CStore;
15-
use std::io::Write;
1615
use std::path::PathBuf;
1716
use std::result;
1817
use std::sync::{Arc, Mutex};

src/librustc_interface/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
#![feature(generators)]
77
#![cfg_attr(unix, feature(libc))]
88

9-
#![deny(rust_2018_idioms)]
109
#![deny(unused_lifetimes)]
1110

12-
#![allow(unused_imports)]
13-
1411
#![recursion_limit="256"]
1512

1613
#[cfg(unix)]

0 commit comments

Comments
 (0)