mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-13 20:46:48 +00:00
Erase ReError properly
This commit is contained in:
parent
eda41addfc
commit
bd31d9ee9c
@ -1708,7 +1708,9 @@ impl<'tcx> Region<'tcx> {
|
||||
ty::ReErased => {
|
||||
flags = flags | TypeFlags::HAS_RE_ERASED;
|
||||
}
|
||||
ty::ReError(_) => {}
|
||||
ty::ReError(_) => {
|
||||
flags = flags | TypeFlags::HAS_FREE_REGIONS;
|
||||
}
|
||||
}
|
||||
|
||||
debug!("type_flags({:?}) = {:?}", self, flags);
|
||||
|
23
tests/ui/borrowck/erase-error-in-mir-drop-tracking.rs
Normal file
23
tests/ui/borrowck/erase-error-in-mir-drop-tracking.rs
Normal file
@ -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() {}
|
24
tests/ui/borrowck/erase-error-in-mir-drop-tracking.stderr
Normal file
24
tests/ui/borrowck/erase-error-in-mir-drop-tracking.stderr
Normal file
@ -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`.
|
Loading…
Reference in New Issue
Block a user