diff options
| author | bors <bors@rust-lang.org> | 2018-10-19 22:54:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-10-19 22:54:14 +0000 |
| commit | 42dde960f95222ffd8c356e0f7841cd22294a6c9 (patch) | |
| tree | 315f1c52471fc775ee057c987a0c5d69f20a4b05 /src/test/ui/error-codes | |
| parent | 78ff609d7375ee2a2c6d0222776ac612eb1b75be (diff) | |
| parent | c294ec640be6b4cdd3b4922a622a6c12f6078b1d (diff) | |
| download | rust-42dde960f95222ffd8c356e0f7841cd22294a6c9.tar.gz rust-42dde960f95222ffd8c356e0f7841cd22294a6c9.zip | |
Auto merge of #55162 - nikomatsakis:issue-54902-underscore-bound, r=tmandry
handle underscore bounds in unexpected places Per the discussion on #54902, I made it a hard error to use lifetime bounds in various places where they used to be permitted: - `where Foo: Bar<'_>` for example I also moved error reporting to HIR lowering and added `Error` variants to let us suppress downstream errors that result. I (imo) improved the error message wording to be clearer, as well. In the process, I fixed the ICE in #52098. Fixes #54902 Fixes #52098
Diffstat (limited to 'src/test/ui/error-codes')
| -rw-r--r-- | src/test/ui/error-codes/E0637.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0637.stderr | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/test/ui/error-codes/E0637.rs b/src/test/ui/error-codes/E0637.rs index ee6a978d169..b4f769a749f 100644 --- a/src/test/ui/error-codes/E0637.rs +++ b/src/test/ui/error-codes/E0637.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct Foo<'a: '_>(&'a u8); //~ ERROR invalid lifetime bound name: `'_` -fn foo<'a: '_>(_: &'a u8) {} //~ ERROR invalid lifetime bound name: `'_` +struct Foo<'a: '_>(&'a u8); //~ ERROR cannot be used here +fn foo<'a: '_>(_: &'a u8) {} //~ ERROR cannot be used here struct Bar<'a>(&'a u8); -impl<'a: '_> Bar<'a> { //~ ERROR invalid lifetime bound name: `'_` +impl<'a: '_> Bar<'a> { //~ ERROR cannot be used here fn bar() {} } diff --git a/src/test/ui/error-codes/E0637.stderr b/src/test/ui/error-codes/E0637.stderr index 245729376df..2a4545fc43d 100644 --- a/src/test/ui/error-codes/E0637.stderr +++ b/src/test/ui/error-codes/E0637.stderr @@ -1,19 +1,19 @@ -error[E0637]: invalid lifetime bound name: `'_` +error[E0637]: `'_` cannot be used here --> $DIR/E0637.rs:11:16 | -LL | struct Foo<'a: '_>(&'a u8); //~ ERROR invalid lifetime bound name: `'_` +LL | struct Foo<'a: '_>(&'a u8); //~ ERROR cannot be used here | ^^ `'_` is a reserved lifetime name -error[E0637]: invalid lifetime bound name: `'_` +error[E0637]: `'_` cannot be used here --> $DIR/E0637.rs:12:12 | -LL | fn foo<'a: '_>(_: &'a u8) {} //~ ERROR invalid lifetime bound name: `'_` +LL | fn foo<'a: '_>(_: &'a u8) {} //~ ERROR cannot be used here | ^^ `'_` is a reserved lifetime name -error[E0637]: invalid lifetime bound name: `'_` +error[E0637]: `'_` cannot be used here --> $DIR/E0637.rs:15:10 | -LL | impl<'a: '_> Bar<'a> { //~ ERROR invalid lifetime bound name: `'_` +LL | impl<'a: '_> Bar<'a> { //~ ERROR cannot be used here | ^^ `'_` is a reserved lifetime name error: aborting due to 3 previous errors |
