-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't check for alias bounds in liveness when aliases have escaping bound vars #117466
Conversation
Friendly ping, this is breaking our build and I'd rather see a fix forward land soon. If it helps: I haven't seen the code where this visitor is used, but the diff looks reasonable and the strategy of "do what we did before" sounds safe. If you're confident it's not horribly broken you can r=me. |
I have thought about "smarter" solutions but they all turned to be incorrect (unsound?) because of the way we handle well-formedness around higher ranked types. Now I'm fairly convinced that the approach of this PR is the only way handle escaping bound vars. Accordingly I'd prefer removing the FIXME comment and adding the following test to make sure we are not trying to do anthing smarter in this inference but you can r=me without these changes. trait Trait {
type Gat<'a: 'b, 'b: 'c, 'c>: 'c;
}
fn get_func<'a, T: Trait>(_: &'a str) -> fn(T::Gat<'a, '_, 'static>) {
loop {}
}
fn test<T: Trait>() {
let func = get_func::<T>(&String::new()); //~ ERROR temporary value dropped
drop(func);
} |
MentionsLifetimeAndType(&(), foo); | ||
} | ||
|
||
fn main() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test doesn't contain an opaque. Please add a comment referencing #117455 and one or two sentences explaining what this is testing
44b6807
to
20b3d88
Compare
20b3d88
to
4d5d763
Compare
Added aliemjay's test, added a comment and moved the original test cause it didn't have a TAIT anyways. @bors r=aliemjay |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b800c30): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 639.068s -> 636.285s (-0.44%) |
82: Automated pull from upstream `master` r=tshepang a=github-actions[bot] This PR pulls the following changes from the upstream repository: * rust-lang/rust#117313 * rust-lang/rust#117131 * rust-lang/rust#117134 * rust-lang/rust#117471 * rust-lang/rust#117521 * rust-lang/rust#117513 * rust-lang/rust#117512 * rust-lang/rust#117509 * rust-lang/rust#117495 * rust-lang/rust#117394 * rust-lang/rust#117466 * rust-lang/rust#117204 * rust-lang/rust#117386 * rust-lang/rust#117506 Co-authored-by: Nicholas Nethercote <n.nethercote@gmail.com> Co-authored-by: roblabla <unfiltered@roblab.la> Co-authored-by: Michael Goulet <michael@errs.io> Co-authored-by: massivebird <gdrakemail@gmail.com> Co-authored-by: bors <bors@rust-lang.org> Co-authored-by: Zalathar <Zalathar@users.noreply.github.com> Co-authored-by: lcnr <rust@lcnr.de> Co-authored-by: Joshua Liebow-Feeser <joshlf@users.noreply.github.com> Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
I actually have no idea how we should be treating aliases with escaping bound vars here... but the simplest behavior is just doing what we used to do before.
r? aliemjay
Fixes #117455