Skip to content

Commit 676d282

Browse files
committed
Deny unused_lifetimes through rustbuild
1 parent 4341521 commit 676d282

File tree

38 files changed

+23
-59
lines changed

38 files changed

+23
-59
lines changed

src/bootstrap/bin/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! directory in each respective module.
77
88
// NO-RUSTC-WRAPPER
9-
#![deny(warnings, rust_2018_idioms)]
9+
#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
1010

1111
use std::env;
1212

src/bootstrap/bin/rustc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! never get replaced.
1717
1818
// NO-RUSTC-WRAPPER
19-
#![deny(warnings, rust_2018_idioms)]
19+
#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
2020

2121
use std::env;
2222
use std::ffi::OsString;
@@ -129,6 +129,7 @@ fn main() {
129129
env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
130130
cmd.arg("-Dwarnings");
131131
cmd.arg("-Drust_2018_idioms");
132+
cmd.arg("-Dunused_lifetimes");
132133
// cfg(not(bootstrap)): Remove this during the next stage 0 compiler update.
133134
// `-Drustc::internal` is a new feature and `rustc_version` mis-reports the `stage`.
134135
let cfg_not_bootstrap = stage != "0" && crate_name != Some("rustc_version");

src/bootstrap/bin/rustdoc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! See comments in `src/bootstrap/rustc.rs` for more information.
44
55
// NO-RUSTC-WRAPPER
6-
#![deny(warnings, rust_2018_idioms)]
6+
#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
77

88
use std::env;
99
use std::process::Command;

src/bootstrap/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
//! also check out the `src/bootstrap/README.md` file for more information.
105105
106106
// NO-RUSTC-WRAPPER
107-
#![deny(warnings, rust_2018_idioms)]
107+
#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
108108

109109
#![feature(core_intrinsics)]
110110
#![feature(drain_filter)]
@@ -1313,7 +1313,7 @@ fn chmod(path: &Path, perms: u32) {
13131313
fn chmod(_path: &Path, _perms: u32) {}
13141314

13151315

1316-
impl<'a> Compiler {
1316+
impl Compiler {
13171317
pub fn with_stage(mut self, stage: u32) -> Compiler {
13181318
self.stage = stage;
13191319
self

src/build_helper/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// NO-RUSTC-WRAPPER
2-
#![deny(warnings, rust_2018_idioms)]
2+
#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
33

44
use std::fs::File;
55
use std::path::{Path, PathBuf};

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/libarena/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
1212
test(no_crate_inject, attr(deny(warnings))))]
1313

14-
#![deny(unused_lifetimes)]
15-
1614
#![feature(core_intrinsics)]
1715
#![feature(dropck_eyepatch)]
1816
#![feature(raw_vec_internals)]

src/libcore/array.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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,

src/libcore/pin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ where
775775
{}
776776

777777
#[stable(feature = "pin", since = "1.33.0")]
778-
impl<'a, P, U> DispatchFromDyn<Pin<U>> for Pin<P>
778+
impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P>
779779
where
780780
P: DispatchFromDyn<U>,
781781
{}

src/libcore/ptr/unique.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl<T: ?Sized> From<&T> for Unique<T> {
172172
}
173173

174174
#[unstable(feature = "ptr_internals", issue = "0")]
175-
impl<'a, T: ?Sized> From<NonNull<T>> for Unique<T> {
175+
impl<T: ?Sized> From<NonNull<T>> for Unique<T> {
176176
#[inline]
177177
fn from(p: NonNull<T>) -> Self {
178178
unsafe { Unique::new_unchecked(p.as_ptr()) }

0 commit comments

Comments
 (0)