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:
bors 2020-04-18 14:15:31 +00:00
commit 52fa23add6
3 changed files with 64 additions and 6 deletions

View 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() {}