forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#71218 - eddyb:a-lifetime-stranded-in-fn-def, …
…r=nikomatsakis outlives: ignore lifetimes shallowly found in `ty::FnDef`s. Fixes rust-lang#70917 by restoring the pre-rust-lang#70164 behavior for now. r? @nikomatsakis
- Loading branch information
Showing
3 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |