Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upUnsoundness in borrowck around deref and mutable refs #29053
Comments
sfackler
added
I-nominated
I-unsound 💥
labels
Oct 14, 2015
This comment has been minimized.
This comment has been minimized.
|
Nominating for P-high. |
This comment has been minimized.
This comment has been minimized.
|
The code isn't semantically unsound. In
The problem is just that trans is taking illegal shortcuts. |
This comment has been minimized.
This comment has been minimized.
|
@eefriedman Along those lines, in this example: fn main() {
let x: &'static str = "x";
{
let z = &mut &*x;
*z = "z";
}
println!("{:?}", x);
}the code compiles, runs, and prints |
This comment has been minimized.
This comment has been minimized.
|
@apasel422 Yes, same bug. |
sfackler
added
the
T-compiler
label
Oct 14, 2015
This comment has been minimized.
This comment has been minimized.
woowe
commented
Oct 15, 2015
|
The same bug is coming up for me when I use html5ever. |
nikomatsakis
self-assigned this
Oct 15, 2015
This comment has been minimized.
This comment has been minimized.
|
triage: P-high My preferred fix would be to go through MIR, but this may be worth fixing another way. |
rust-highfive
added
P-high
and removed
I-nominated
labels
Oct 15, 2015
arielb1
added
I-wrong
and removed
I-unsound 💥
labels
Oct 15, 2015
This comment has been minimized.
This comment has been minimized.
|
cc me |
This comment has been minimized.
This comment has been minimized.
|
triage: p-medium Another one that will be fixed by MIR, but not soon. If we think this is higher priority than that we should go back to p-high, but we should make a plan to actually fix it. |
nrc
added
P-medium
A-mir
and removed
P-high
labels
Nov 19, 2015
This comment has been minimized.
This comment has been minimized.
briansmith
commented
Nov 19, 2015
It would make Rust advocacy a lot easier if bugs like this one were fixed before MIR. The typechecker and borrow checker are the reasons many people would choose Rust over other languages. The rewrite of the compiler (MIR) is likely to cause induce bugs itself, so I think a lot of people would like to see a very good stable release before MIR, to allow for skipping the first few (at least) MIR-based releases. |
This comment has been minimized.
This comment has been minimized.
|
Variations of this bug were one of the primary motivations for MIR - the code that is supposed to be handling this part is horrible and we don't want to make changes to it out of fear of introducing new bugs. I think we will have MIR-based trans+borrowck at 1.8 if not before. |
brson
added
I-unsound 💥
A-borrow-checker
A-codegen
E-needstest
E-easy
and removed
A-borrow-checker
A-codegen
labels
Aug 4, 2016
This comment has been minimized.
This comment has been minimized.
futile
commented
Aug 7, 2016
|
This seems to be fixed on nightly (but still crashes on stable & beta): https://is.gd/KqgBhe |
This comment has been minimized.
This comment has been minimized.
|
Only thing left to do here is land a test for it. |
This comment has been minimized.
This comment has been minimized.
futile
commented
Aug 8, 2016
|
I can add that. |
apasel422 commentedOct 14, 2015
Stable and nightly happily compile the following:
Running the program on my local Ubuntu machine yields:
The playpen yields different results depending on whether debug or release mode is chosen.
Someone is welcome to retitle this issue more accurately.