Skip to content

Commit d12e7b0

Browse files
committed
Warn about hidden_lifetimes_in_output_paths by default
1 parent f6ec6b4 commit d12e7b0

File tree

50 files changed

+72
-75
lines changed

Some content is hidden

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

50 files changed

+72
-75
lines changed

compiler/rustc_lint/src/lifetime_style.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ declare_lint! {
136136
///
137137
/// [placeholder lifetime]: https://doc.rust-lang.org/reference/lifetime-elision.html#lifetime-elision-in-functions
138138
pub HIDDEN_LIFETIMES_IN_OUTPUT_PATHS,
139-
Allow,
139+
Warn,
140140
"hidden lifetime parameters in types in function return values are deprecated"
141141
}
142142

tests/ui/associated-types/associated-types-impl-redirect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ trait Iterator {
2121
}
2222

2323
trait IteratorExt: Iterator + Sized {
24-
fn by_ref(&mut self) -> ByRef<Self> {
24+
fn by_ref(&mut self) -> ByRef<'_, Self> {
2525
ByRef(self)
2626
}
2727
}

tests/ui/associated-types/associated-types-normalize-in-bounds-ufcs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ trait SliceExt2 {
2121
impl<T> SliceExt2 for [T] {
2222
type Item = T;
2323

24-
fn split2<P>(&self, pred: P) -> Splits<T, P> where P: FnMut(&T) -> bool {
24+
fn split2<P>(&self, pred: P) -> Splits<'_, T, P> where P: FnMut(&T) -> bool {
2525
loop {}
2626
}
2727

28-
fn splitn2<P>(&self, n: u32, pred: P) -> SplitsN<Splits<T, P>> where P: FnMut(&T) -> bool {
28+
fn splitn2<P>(&self, n: u32, pred: P) -> SplitsN<Splits<'_, T, P>> where P: FnMut(&T) -> bool {
2929
SliceExt2::split2(self, pred);
3030
loop {}
3131
}

tests/ui/associated-types/associated-types-normalize-in-bounds.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@ trait SliceExt2 {
2121
impl<T> SliceExt2 for [T] {
2222
type Item = T;
2323

24-
fn split2<P>(&self, pred: P) -> Splits<T, P> where P: FnMut(&T) -> bool {
24+
fn split2<P>(&self, pred: P) -> Splits<'_, T, P>
25+
where
26+
P: FnMut(&T) -> bool,
27+
{
2528
loop {}
2629
}
2730

28-
fn splitn2<P>(&self, n: usize, pred: P) -> SplitsN<Splits<T, P>> where P: FnMut(&T) -> bool {
31+
fn splitn2<P>(&self, n: usize, pred: P) -> SplitsN<Splits<'_, T, P>>
32+
where
33+
P: FnMut(&T) -> bool,
34+
{
2935
self.split2(pred);
3036
loop {}
3137
}

tests/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ trait Iterator {
2020
}
2121

2222
trait IteratorExt: Iterator + Sized {
23-
fn by_ref(&mut self) -> ByRef<Self> {
23+
fn by_ref(&mut self) -> ByRef<'_, Self> {
2424
ByRef(self)
2525
}
2626
}

tests/ui/associated-types/cache/elision.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(hidden_lifetimes_in_output_paths)]
2+
13
// Check that you are allowed to implement using elision but write
24
// trait without elision (a bug in this cropped up during
35
// bootstrapping, so this is a regression test).

tests/ui/associated-types/project-defer-unification.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ where P: Pixel + 'static,
5050
loop { }
5151
}
5252

53-
pub fn pixels_mut(&mut self) -> PixelsMut<P> {
53+
pub fn pixels_mut(&mut self) -> PixelsMut<'_, P> {
5454
loop { }
5555
}
5656
}

tests/ui/borrowck/copy-suggestion-region-vid.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct HelperStruct<'n> {
77
}
88

99
impl DataStruct {
10-
pub fn f(&self) -> HelperStruct {
10+
pub fn f(&self) -> HelperStruct<'_> {
1111
let helpers = [vec![], vec![]];
1212

1313
HelperStruct { helpers: helpers.clone(), is_empty: helpers[0].is_empty() }

tests/ui/borrowck/copy-suggestion-region-vid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct HelperStruct<'n> {
77
}
88

99
impl DataStruct {
10-
pub fn f(&self) -> HelperStruct {
10+
pub fn f(&self) -> HelperStruct<'_> {
1111
let helpers = [vec![], vec![]];
1212

1313
HelperStruct { helpers, is_empty: helpers[0].is_empty() }

tests/ui/const-generics/type-dependent/issue-71348.full.stderr

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)