-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #111573 - compiler-errors:erase-re-error, r=WaffleLapkin
Erase `ReError` properly Fixes #111341 Since we check whether a type has free regions before erasing (to short circuit unnecesary folding), we need to consider `ReError` as a free region, or else we'll skip it when erasing a type that only mentions `ReError`. cc `@nnethercote`
- Loading branch information
Showing
3 changed files
with
50 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// compile-flags: -Zdrop-tracking-mir | ||
// edition:2021 | ||
|
||
use std::future::Future; | ||
|
||
trait Client { | ||
type Connecting<'a>: Future + Send | ||
where | ||
Self: 'a; | ||
|
||
fn connect(&'_ self) -> Self::Connecting<'a>; | ||
//~^ ERROR use of undeclared lifetime name `'a` | ||
} | ||
|
||
fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send | ||
where | ||
C: Client + Send + Sync, | ||
{ | ||
async move { c.connect().await } | ||
//~^ ERROR `C` does not live long enough | ||
} | ||
|
||
fn main() {} |
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,24 @@ | ||
error[E0261]: use of undeclared lifetime name `'a` | ||
--> $DIR/erase-error-in-mir-drop-tracking.rs:11:46 | ||
| | ||
LL | fn connect(&'_ self) -> Self::Connecting<'a>; | ||
| ^^ undeclared lifetime | ||
| | ||
help: consider introducing lifetime `'a` here | ||
| | ||
LL | fn connect<'a>(&'_ self) -> Self::Connecting<'a>; | ||
| ++++ | ||
help: consider introducing lifetime `'a` here | ||
| | ||
LL | trait Client<'a> { | ||
| ++++ | ||
|
||
error: `C` does not live long enough | ||
--> $DIR/erase-error-in-mir-drop-tracking.rs:19:5 | ||
| | ||
LL | async move { c.connect().await } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0261`. |