You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
regression 1.50: Borrow checker reports function param as not living long enough #80949
This might not actually be a regression an instead the code may have previously erroneously compiled. I cannot find an an open issue obviously related to this though.
As you can see here this code does not compile with a "borrowed value does not live long enough" where it did previously. This comes from a call to diff::diff which has this signature.
The error message states that n may be dropped while the borrow in the next param state is still active. This fails to compile on both 1.50 and 1.49 if the param state is move to a local variable.
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good
"Cleanup ICE-breaking candidate". In case it's useful, here are some instructions for tackling these sorts of bugs. Maybe take a look?
Thanks! <3
use euca::diff;
use euca::dom::Dom;
use euca::vdom::DomIter;
#[test]
fn from_empty() {
let new: Dom<(), (), &()> = Dom::elem("div");
let n = new.dom_iter();
let mut storage = vec![];
let patch_set = diff::diff(std::iter::empty(), n, &mut storage);
}
searched nightlies: from nightly-2020-12-01 to nightly-2021-01-06
regressed nightly: nightly-2020-12-06
searched commits: from 3ff10e7 to e792288
regressed commit: 9122b76
So #78373 resulted in MIR having one fewer block, which is making borrowck be less precise with how long the borrow lasts. There are a few possible fixes here for me to look at.
Activity
apiraino commentedon Jan 13, 2021
Let's try to reduce it @rustbot ping cleanup
rustbot commentedon Jan 13, 2021
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good
"Cleanup ICE-breaking candidate". In case it's useful, here are some
instructions for tackling these sorts of bugs. Maybe take a look?
Thanks! <3
cc @AminArria @camelid @chrissimpkins @contrun @DutchGhost @elshize @ethanboxx @h-michael @HallerPatrick @hdhoang @hellow554 @imtsuki @JamesPatrickGill @kanru @KarlK90 @LeSeulArtichaut @MAdrianMattocks @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @shekohex @sinato @smmalis37 @steffahn @Stupremee @tamuhey @turboladen @woshilapin @yerke
hellow554 commentedon Jan 13, 2021
Still with dependency, but simplified code
let's see what I can get from there
hellow554 commentedon Jan 13, 2021
searched nightlies: from nightly-2020-12-01 to nightly-2021-01-06
regressed nightly: nightly-2020-12-06
searched commits: from 3ff10e7 to e792288
regressed commit: 9122b76
bisected with cargo-bisect-rustc v0.6.0
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
The code I tested:
cc #78373 @matthewjasper
rustbot commentedon Jan 13, 2021
Error: Label ICEBreaker-Cleanup-Crew can only be set by Rust team members
Please let
@rust-lang/releaseknow if you're having trouble with this bot.matthewjasper commentedon Jan 14, 2021
So #78373 resulted in MIR having one fewer block, which is making borrowck be less precise with how long the borrow lasts. There are a few possible fixes here for me to look at.
apiraino commentedon Jan 14, 2021
Assigning
P-highas discussed as part of the Prioritization Working Group procedure and removingI-prioritize.9 remaining items
camelid commentedon Jan 28, 2021
Hmm, that example compiles on beta though.
camelid commentedon Jan 28, 2021
I believe that's an unrelated issue. Opened #81460 to track it. Thanks for reporting it!
emilyalbini commentedon Feb 8, 2021
Fix backported to 1.50 and landed in 1.51, closing this.
Only remove unreachable blocks
Auto merge of rust-lang#125923 - matthewjasper:no-return-leak, r=<try>
Auto merge of rust-lang#125923 - matthewjasper:no-return-leak, r=<try>
Auto merge of rust-lang#125923 - matthewjasper:no-return-leak, r=<try>
Auto merge of rust-lang#125923 - matthewjasper:no-return-leak, r=<try>
Auto merge of rust-lang#125923 - matthewjasper:no-return-leak, r=<try>