Auto merge of #71218 - eddyb:a-lifetime-stranded-in-fn-def, r=nikomatsakis
outlives: ignore lifetimes shallowly found in `ty::FnDef`s. Fixes #70917 by restoring the pre-#70164 behavior for now. r? @nikomatsakis
This commit is contained in:
commit
52fa23add6
3 changed files with 64 additions and 6 deletions
13
src/test/ui/lifetimes/issue-70917-lifetimes-in-fn-def.rs
Normal file
13
src/test/ui/lifetimes/issue-70917-lifetimes-in-fn-def.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// check-pass
|
||||
|
||||
fn assert_static<T: 'static>(_: T) {}
|
||||
|
||||
// NOTE(eddyb) the `'a: 'a` may look a bit strange, but we *really* want
|
||||
// `'a` to be an *early-bound* parameter, otherwise it doesn't matter anyway.
|
||||
fn capture_lifetime<'a: 'a>() {}
|
||||
|
||||
fn test_lifetime<'a>() {
|
||||
assert_static(capture_lifetime::<'a>);
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue