Rollup merge of #108502 - lenko-d:cannot_relate_region, r=compiler-errors
Don't trigger error for ReError when other region is empty. Fixes [#107988](https://github.com/rust-lang/rust/issues/107988)
This commit is contained in:
commit
bade5566da
3 changed files with 50 additions and 2 deletions
13
tests/ui/lifetimes/issue-107988.rs
Normal file
13
tests/ui/lifetimes/issue-107988.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
pub trait TraitEngine<'tcx>: 'tcx {}
|
||||
|
||||
pub trait TraitEngineExt<'tcx> {
|
||||
fn register_predicate_obligations(&mut self);
|
||||
}
|
||||
|
||||
impl<T: ?Sized + TraitEngine<'tcx>> TraitEngineExt<'tcx> for T {
|
||||
//~^ ERROR use of undeclared lifetime name `'tcx`
|
||||
//~| ERROR use of undeclared lifetime name `'tcx`
|
||||
fn register_predicate_obligations(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
27
tests/ui/lifetimes/issue-107988.stderr
Normal file
27
tests/ui/lifetimes/issue-107988.stderr
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
error[E0261]: use of undeclared lifetime name `'tcx`
|
||||
--> $DIR/issue-107988.rs:7:52
|
||||
|
|
||||
LL | impl<T: ?Sized + TraitEngine<'tcx>> TraitEngineExt<'tcx> for T {
|
||||
| - ^^^^ undeclared lifetime
|
||||
| |
|
||||
| help: consider introducing lifetime `'tcx` here: `'tcx,`
|
||||
|
||||
error[E0261]: use of undeclared lifetime name `'tcx`
|
||||
--> $DIR/issue-107988.rs:7:30
|
||||
|
|
||||
LL | impl<T: ?Sized + TraitEngine<'tcx>> TraitEngineExt<'tcx> for T {
|
||||
| ^^^^ undeclared lifetime
|
||||
|
|
||||
= note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
|
||||
help: consider making the bound lifetime-generic with a new `'tcx` lifetime
|
||||
|
|
||||
LL | impl<T: ?Sized + for<'tcx> TraitEngine<'tcx>> TraitEngineExt<'tcx> for T {
|
||||
| +++++++++
|
||||
help: consider introducing lifetime `'tcx` here
|
||||
|
|
||||
LL | impl<'tcx, T: ?Sized + TraitEngine<'tcx>> TraitEngineExt<'tcx> for T {
|
||||
| +++++
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0261`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue