Files
rust/src/test/ui/lifetimes/re-empty-in-error.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
504 B
Rust
Raw Normal View History

2022-05-22 02:05:15 -04:00
// revisions: base nll
// ignore-compare-mode-nll
//[nll] compile-flags: -Z borrowck=mir
// We didn't have a single test mentioning
// `ReEmpty` and this test changes that.
fn foo<'a>(_a: &'a u32) where for<'b> &'b (): 'a {
2022-05-22 02:05:15 -04:00
//[base]~^ NOTE type must outlive the empty lifetime as required by this binding
}
fn main() {
foo(&10);
2022-05-22 02:05:15 -04:00
//[base]~^ ERROR the type `&'b ()` does not fulfill the required lifetime
//[nll]~^^ ERROR higher-ranked lifetime error
//[nll]~| NOTE could not prove
}