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

+1-1
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

+2-1
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

+1-1
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

+2-2
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

+1-1
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

+2
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

-2
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

+5-5
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

+1-1
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

+1-1
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()) }

src/libfmt_macros/lib.rs

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

11-
#![deny(unused_lifetimes)]
12-
1311
#![feature(nll)]
1412
#![feature(rustc_private)]
1513
#![feature(unicode_internals)]

src/libproc_macro/bridge/scoped_cell.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::mem;
55
use std::ops::{Deref, DerefMut};
66

77
/// Type lambda application, with a lifetime.
8+
#[allow(unused_lifetimes)]
89
pub trait ApplyL<'a> {
910
type Out;
1011
}

src/librustc/lib.rs

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

31-
#![deny(unused_lifetimes)]
32-
3331
#![feature(arbitrary_self_types)]
3432
#![feature(box_patterns)]
3533
#![feature(box_syntax)]

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(unused_lifetimes)]
54

65
#![feature(in_band_lifetimes)]
76
#![feature(nll)]

src/librustc_codegen_llvm/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#![feature(static_nobundle)]
2222
#![feature(trusted_len)]
2323
#![feature(mem_take)]
24-
#![deny(unused_lifetimes)]
2524

2625
use back::write::{create_target_machine, create_informational_target_machine};
2726
use syntax_pos::symbol::Symbol;

src/librustc_codegen_ssa/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![feature(nll)]
1212
#![feature(trusted_len)]
1313
#![feature(mem_take)]
14-
#![deny(unused_lifetimes)]
1514

1615
#![recursion_limit="256"]
1716

src/librustc_codegen_utils/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#![recursion_limit="256"]
1717

18-
#![deny(unused_lifetimes)]
19-
2018
#[macro_use]
2119
extern crate rustc;
2220

src/librustc_data_structures/graph/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ where
3939
}
4040
}
4141

42+
#[allow(unused_lifetimes)]
4243
pub trait GraphSuccessors<'graph> {
4344
type Item;
4445
type Iter: Iterator<Item = Self::Item>;
@@ -54,6 +55,7 @@ where
5455
) -> <Self as GraphPredecessors<'_>>::Iter;
5556
}
5657

58+
#[allow(unused_lifetimes)]
5759
pub trait GraphPredecessors<'graph> {
5860
type Item;
5961
type Iter: Iterator<Item = Self::Item>;

src/librustc_data_structures/owning_ref/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ impl<T> Erased for T {}
283283
/// Helper trait for erasing the concrete type of what an owner dereferences to,
284284
/// for example `Box<T> -> Box<Erased>`. This would be unneeded with
285285
/// higher kinded types support in the language.
286+
#[allow(unused_lifetimes)]
286287
pub unsafe trait IntoErased<'a> {
287288
/// Owner with the dereference type substituted to `Erased`.
288289
type Erased;
@@ -293,6 +294,7 @@ pub unsafe trait IntoErased<'a> {
293294
/// Helper trait for erasing the concrete type of what an owner dereferences to,
294295
/// for example `Box<T> -> Box<Erased + Send>`. This would be unneeded with
295296
/// higher kinded types support in the language.
297+
#[allow(unused_lifetimes)]
296298
pub unsafe trait IntoErasedSend<'a> {
297299
/// Owner with the dereference type substituted to `Erased + Send`.
298300
type Erased: Send;
@@ -303,6 +305,7 @@ pub unsafe trait IntoErasedSend<'a> {
303305
/// Helper trait for erasing the concrete type of what an owner dereferences to,
304306
/// for example `Box<T> -> Box<Erased + Send + Sync>`. This would be unneeded with
305307
/// higher kinded types support in the language.
308+
#[allow(unused_lifetimes)]
306309
pub unsafe trait IntoErasedSendSync<'a> {
307310
/// Owner with the dereference type substituted to `Erased + Send + Sync`.
308311
type Erased: Send + Sync;

src/librustc_driver/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#![recursion_limit="256"]
1818

19-
#![deny(unused_lifetimes)]
20-
2119
pub extern crate getopts;
2220
#[cfg(unix)]
2321
extern crate libc;

src/librustc_errors/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![cfg_attr(unix, feature(libc))]
99
#![feature(nll)]
1010
#![feature(optin_builtin_traits)]
11-
#![deny(unused_lifetimes)]
1211

1312
pub use emitter::ColorConfig;
1413

src/librustc_incremental/lib.rs

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

99
#![recursion_limit="256"]
1010

11-
#![deny(unused_lifetimes)]
12-
1311
#[macro_use] extern crate rustc;
1412
#[macro_use] extern crate log;
1513

src/librustc_interface/lib.rs

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

9-
#![deny(unused_lifetimes)]
10-
119
#![recursion_limit="256"]
1210

1311
#[cfg(unix)]

src/librustc_lint/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
#![recursion_limit="256"]
2121

22-
#![deny(unused_lifetimes)]
23-
2422
#[macro_use]
2523
extern crate rustc;
2624

src/librustc_metadata/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#![recursion_limit="256"]
1717

18-
#![deny(unused_lifetimes)]
19-
2018
extern crate libc;
2119
extern crate proc_macro;
2220

src/librustc_mir/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2626

2727
#![recursion_limit="256"]
2828

29-
#![deny(unused_lifetimes)]
30-
3129
#[macro_use] extern crate log;
3230
#[macro_use] extern crate rustc;
3331
#[macro_use] extern crate rustc_data_structures;

src/librustc_passes/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#![recursion_limit="256"]
1515

16-
#![deny(unused_lifetimes)]
17-
1816
#[macro_use]
1917
extern crate rustc;
2018

src/librustc_privacy/lib.rs

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

3-
#![deny(unused_lifetimes)]
4-
53
#![feature(in_band_lifetimes)]
64
#![feature(nll)]
75
#![feature(rustc_diagnostic_macros)]

src/librustc_resolve/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#![recursion_limit="256"]
1212

13-
#![deny(unused_lifetimes)]
14-
1513
pub use rustc::hir::def::{Namespace, PerNS};
1614

1715
use Determinacy::*;

src/librustc_save_analysis/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
22
#![feature(nll)]
3-
#![deny(unused_lifetimes)]
43

54
#![recursion_limit="256"]
65

7-
86
mod dumper;
97
mod dump_visitor;
108
#[macro_use]

src/librustc_target/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#![feature(nll)]
1414
#![feature(slice_patterns)]
1515

16-
#![deny(unused_lifetimes)]
17-
1816
#[macro_use] extern crate log;
1917

2018
pub mod abi;

src/librustc_traits/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! New recursive solver modeled on Chalk's recursive solver. Most of
22
//! the guts are broken up into modules; see the comments in those modules.
33
4-
#![deny(unused_lifetimes)]
5-
64
#![feature(crate_visibility_modifier)]
75
#![feature(in_band_lifetimes)]
86
#![feature(nll)]

src/librustc_typeck/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ This API is completely unstable and subject to change.
7373

7474
#![recursion_limit="256"]
7575

76-
#![deny(unused_lifetimes)]
77-
7876
#[macro_use] extern crate log;
7977
#[macro_use] extern crate syntax;
8078

src/librustdoc/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![deny(unused_lifetimes)]
2-
31
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
42
html_playground_url = "https://play.rust-lang.org/")]
53

src/libstd/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
#![warn(missing_debug_implementations)]
211211
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
212212
#![allow(explicit_outlives_requirements)]
213+
#![allow(unused_lifetimes)]
213214

214215
// Tell the compiler to link to either panic_abort or panic_unwind
215216
#![needs_panic_runtime]

src/libsyntax/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
88
test(attr(deny(warnings))))]
99

10-
#![deny(unused_lifetimes)]
11-
1210
#![feature(bind_by_move_pattern_guards)]
1311
#![feature(box_syntax)]
1412
#![feature(const_fn)]

0 commit comments

Comments
 (0)