Skip to content

Commit 4560cb8

Browse files
committed
Auto merge of #62910 - petrochenkov:buildwarn2, r=Mark-Simulacrum
cleanup: Remove lint annotations in specific crates that are already enforced by rustbuild Remove some random unnecessary lint `allow`s. Deny `unused_lifetimes` through rustbuild. r? @Mark-Simulacrum
2 parents 023525d + 1a37010 commit 4560cb8

File tree

127 files changed

+182
-413
lines changed

Some content is hidden

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

127 files changed

+182
-413
lines changed

src/bootstrap/bin/main.rs

Lines changed: 2 additions & 1 deletion
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, unused_lifetimes)]
910

1011
use std::env;
1112

src/bootstrap/bin/rustc.rs

Lines changed: 5 additions & 1 deletion
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, unused_lifetimes)]
1920

2021
use std::env;
2122
use std::ffi::OsString;
@@ -126,8 +127,11 @@ fn main() {
126127

127128
if env::var_os("RUSTC_DENY_WARNINGS").is_some() &&
128129
env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
130+
// When extending this list, search for `NO-RUSTC-WRAPPER` and add the new lints
131+
// there as well, some code doesn't go through this `rustc` wrapper.
129132
cmd.arg("-Dwarnings");
130133
cmd.arg("-Drust_2018_idioms");
134+
cmd.arg("-Dunused_lifetimes");
131135
// cfg(not(bootstrap)): Remove this during the next stage 0 compiler update.
132136
// `-Drustc::internal` is a new feature and `rustc_version` mis-reports the `stage`.
133137
let cfg_not_bootstrap = stage != "0" && crate_name != Some("rustc_version");

src/bootstrap/bin/rustdoc.rs

Lines changed: 2 additions & 1 deletion
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, unused_lifetimes)]
67

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

src/bootstrap/lib.rs

Lines changed: 4 additions & 3 deletions
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, unused_lifetimes)]
108+
108109
#![feature(core_intrinsics)]
109110
#![feature(drain_filter)]
110111

@@ -1312,7 +1313,7 @@ fn chmod(path: &Path, perms: u32) {
13121313
fn chmod(_path: &Path, _perms: u32) {}
13131314

13141315

1315-
impl<'a> Compiler {
1316+
impl Compiler {
13161317
pub fn with_stage(mut self, stage: u32) -> Compiler {
13171318
self.stage = stage;
13181319
self

src/build_helper/lib.rs

Lines changed: 2 additions & 1 deletion
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, unused_lifetimes)]
23

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

src/liballoc/lib.rs

Lines changed: 0 additions & 2 deletions
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/string.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,6 +1838,7 @@ impl PartialEq for String {
18381838
macro_rules! impl_eq {
18391839
($lhs:ty, $rhs: ty) => {
18401840
#[stable(feature = "rust1", since = "1.0.0")]
1841+
#[allow(unused_lifetimes)]
18411842
impl<'a, 'b> PartialEq<$rhs> for $lhs {
18421843
#[inline]
18431844
fn eq(&self, other: &$rhs) -> bool { PartialEq::eq(&self[..], &other[..]) }
@@ -1846,6 +1847,7 @@ macro_rules! impl_eq {
18461847
}
18471848

18481849
#[stable(feature = "rust1", since = "1.0.0")]
1850+
#[allow(unused_lifetimes)]
18491851
impl<'a, 'b> PartialEq<$lhs> for $rhs {
18501852
#[inline]
18511853
fn eq(&self, other: &$lhs) -> bool { PartialEq::eq(&self[..], &other[..]) }

src/liballoc/tests/lib.rs

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +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)]
15-
#![deny(unused_lifetimes)]
16-
1714
#![feature(core_intrinsics)]
1815
#![feature(dropck_eyepatch)]
1916
#![feature(raw_vec_internals)]

src/libcore/array.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ where
217217
}
218218

219219
#[stable(feature = "rust1", since = "1.0.0")]
220-
impl<'a, 'b, A, B, const N: usize> PartialEq<[B; N]> for [A; N]
220+
impl<A, B, const N: usize> PartialEq<[B; N]> for [A; N]
221221
where
222222
A: PartialEq<B>,
223223
[A; N]: LengthAtMost32,
@@ -234,7 +234,7 @@ where
234234
}
235235

236236
#[stable(feature = "rust1", since = "1.0.0")]
237-
impl<'a, 'b, A, B, const N: usize> PartialEq<[B]> for [A; N]
237+
impl<A, B, const N: usize> PartialEq<[B]> for [A; N]
238238
where
239239
A: PartialEq<B>,
240240
[A; N]: LengthAtMost32,
@@ -250,7 +250,7 @@ where
250250
}
251251

252252
#[stable(feature = "rust1", since = "1.0.0")]
253-
impl<'a, 'b, A, B, const N: usize> PartialEq<[A; N]> for [B]
253+
impl<A, B, const N: usize> PartialEq<[A; N]> for [B]
254254
where
255255
B: PartialEq<A>,
256256
[A; N]: LengthAtMost32,
@@ -266,7 +266,7 @@ where
266266
}
267267

268268
#[stable(feature = "rust1", since = "1.0.0")]
269-
impl<'a, 'b, A, B, const N: usize> PartialEq<&'b [B]> for [A; N]
269+
impl<'b, A, B, const N: usize> PartialEq<&'b [B]> for [A; N]
270270
where
271271
A: PartialEq<B>,
272272
[A; N]: LengthAtMost32,
@@ -282,7 +282,7 @@ where
282282
}
283283

284284
#[stable(feature = "rust1", since = "1.0.0")]
285-
impl<'a, 'b, A, B, const N: usize> PartialEq<[A; N]> for &'b [B]
285+
impl<'b, A, B, const N: usize> PartialEq<[A; N]> for &'b [B]
286286
where
287287
B: PartialEq<A>,
288288
[A; N]: LengthAtMost32,
@@ -298,7 +298,7 @@ where
298298
}
299299

300300
#[stable(feature = "rust1", since = "1.0.0")]
301-
impl<'a, 'b, A, B, const N: usize> PartialEq<&'b mut [B]> for [A; N]
301+
impl<'b, A, B, const N: usize> PartialEq<&'b mut [B]> for [A; N]
302302
where
303303
A: PartialEq<B>,
304304
[A; N]: LengthAtMost32,
@@ -314,7 +314,7 @@ where
314314
}
315315

316316
#[stable(feature = "rust1", since = "1.0.0")]
317-
impl<'a, 'b, A, B, const N: usize> PartialEq<[A; N]> for &'b mut [B]
317+
impl<'b, A, B, const N: usize> PartialEq<[A; N]> for &'b mut [B]
318318
where
319319
B: PartialEq<A>,
320320
[A; N]: LengthAtMost32,

0 commit comments

Comments
 (0)