Allow explicit lifetime arguments (behind new #![feature(late_bound_turbofishing)]) and prevent explicit lifetime arguments where they do not appear in a function signature - #160471
Conversation
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @oli-obk (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| fn bar<'a>(_: &'a u32) { | ||
| let f = foo_late::<'a>; | ||
| require_static(f); |
There was a problem hiding this comment.
this needs to fail, but currently it's not... don't know how to fix
There was a problem hiding this comment.
isn't this just the usual FnDef outlives issue that already exists without your PR?
There was a problem hiding this comment.
Oops- I think so? But I;m not sure. the following (which is early-bound afaik) compiles when it shouldn't(?) in the rust playground
fn require_static<T: 'static>(_: T) {}
fn foo<'a: 'a>(b: &'a u32) -> &'a u32 { b }
fn bar<'a>(_: &'a u32) {
let f = foo::<'a>;
require_static(f);
}
fn main() {
let x = 4;
{
bar(&x);
}
}
This comment has been minimized.
This comment has been minimized.
|
that CI run didn't give a good backtrace so to save future me from agony, the problem is here |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
r? oli-obk
note: commit
dd17e77is part of another PR (#159403) and needs to be merged before this does (I'll rebase the commit out when it gets merged, which should be soon)This PR is a little bit big (and probably super messy). here's what it changes/adds:
late_bound_turbofishingfor the new behavioraddie's checklist:
so what:
...and if the feature gate is missing, a diagnostic will be reported.
...although its diagnostic probably could stand to be improved.
ty :3