forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#113177 - estebank:hrlt-sugg, r=compiler-errors
Use structured suggestion when telling user about `for<'a>` ``` error[E0637]: `&` without an explicit lifetime name cannot be used here --> $DIR/E0637.rs:13:13 | LL | T: Into<&u32>, | ^ explicit lifetime name needed here | help: consider introducing a higher-ranked lifetime here | LL | T: for<'a> Into<&'a u32>, | +++++++ ++ ```
- Loading branch information
Showing
17 changed files
with
157 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.fixed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// run-rustfix | ||
|
||
trait WithType<T> {} | ||
trait WithRegion<'a> { } | ||
|
||
#[allow(dead_code)] | ||
struct Foo<T> { | ||
t: T | ||
} | ||
|
||
impl<T> Foo<T> | ||
where | ||
T: for<'a> WithType<&'a u32> | ||
//~^ ERROR `&` without an explicit lifetime name cannot be used here | ||
{ } | ||
|
||
fn main() {} |
17 changes: 17 additions & 0 deletions
17
tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2015.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// run-rustfix | ||
|
||
trait WithType<T> {} | ||
trait WithRegion<'a> { } | ||
|
||
#[allow(dead_code)] | ||
struct Foo<T> { | ||
t: T | ||
} | ||
|
||
impl<T> Foo<T> | ||
where | ||
T: WithType<&u32> | ||
//~^ ERROR `&` without an explicit lifetime name cannot be used here | ||
{ } | ||
|
||
fn main() {} |
9 changes: 4 additions & 5 deletions
9
...-clause-trait-impl-region.rust2015.stderr → ...e-inherent-impl-ampersand-rust2015.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.fixed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// edition:2018 | ||
// run-rustfix | ||
|
||
trait WithType<T> {} | ||
trait WithRegion<'a> { } | ||
|
||
#[allow(dead_code)] | ||
struct Foo<T> { | ||
t: T | ||
} | ||
|
||
impl<T> Foo<T> | ||
where | ||
T: for<'a> WithType<&'a u32> | ||
//~^ ERROR `&` without an explicit lifetime name cannot be used here | ||
{ } | ||
|
||
fn main() {} |
18 changes: 18 additions & 0 deletions
18
tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand-rust2018.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// edition:2018 | ||
// run-rustfix | ||
|
||
trait WithType<T> {} | ||
trait WithRegion<'a> { } | ||
|
||
#[allow(dead_code)] | ||
struct Foo<T> { | ||
t: T | ||
} | ||
|
||
impl<T> Foo<T> | ||
where | ||
T: WithType<&u32> | ||
//~^ ERROR `&` without an explicit lifetime name cannot be used here | ||
{ } | ||
|
||
fn main() {} |
9 changes: 4 additions & 5 deletions
9
...-clause-trait-impl-region.rust2018.stderr → ...e-inherent-impl-ampersand-rust2018.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
tests/ui/underscore-lifetime/where-clause-inherent-impl-ampersand.rs
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.fixed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// run-rustfix | ||
|
||
trait WithType<T> {} | ||
trait WithRegion<'a> { } | ||
|
||
trait Foo { } | ||
|
||
impl<T> Foo for Vec<T> | ||
where | ||
T: for<'a> WithType<&'a u32> | ||
//~^ ERROR `&` without an explicit lifetime name cannot be used here | ||
{ } | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui/underscore-lifetime/where-clause-trait-impl-region-2015.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// run-rustfix | ||
|
||
trait WithType<T> {} | ||
trait WithRegion<'a> { } | ||
|
||
trait Foo { } | ||
|
||
impl<T> Foo for Vec<T> | ||
where | ||
T: WithType<&u32> | ||
//~^ ERROR `&` without an explicit lifetime name cannot be used here | ||
{ } | ||
|
||
fn main() {} |
9 changes: 4 additions & 5 deletions
9
...e-inherent-impl-ampersand.rust2015.stderr → ...here-clause-trait-impl-region-2015.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.fixed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// run-rustfix | ||
// edition:2018 | ||
|
||
trait WithType<T> {} | ||
trait WithRegion<'a> { } | ||
|
||
trait Foo { } | ||
|
||
impl<T> Foo for Vec<T> | ||
where | ||
T: for<'a> WithType<&'a u32> | ||
//~^ ERROR `&` without an explicit lifetime name cannot be used here | ||
{ } | ||
|
||
fn main() {} |
15 changes: 15 additions & 0 deletions
15
tests/ui/underscore-lifetime/where-clause-trait-impl-region-2018.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// run-rustfix | ||
// edition:2018 | ||
|
||
trait WithType<T> {} | ||
trait WithRegion<'a> { } | ||
|
||
trait Foo { } | ||
|
||
impl<T> Foo for Vec<T> | ||
where | ||
T: WithType<&u32> | ||
//~^ ERROR `&` without an explicit lifetime name cannot be used here | ||
{ } | ||
|
||
fn main() {} |
9 changes: 4 additions & 5 deletions
9
...e-inherent-impl-ampersand.rust2018.stderr → ...here-clause-trait-impl-region-2018.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
tests/ui/underscore-lifetime/where-clause-trait-impl-region.rs
This file was deleted.
Oops, something went wrong.