Closed
Description
Stable and nightly happily compile the following:
fn main() {
let x: &'static str = "x";
{
let y = "y".to_string();
let ref mut x = &*x;
*x = &*y;
}
println!("{:?}", x);
}
Running the program on my local Ubuntu machine yields:
thread '<main>' panicked at 'index 0 and/or 0 in `�` do not lie on character boundary', ../rust/src/libcore/str/mod.rs:1444
The playpen yields different results depending on whether debug or release mode is chosen.
Someone is welcome to retitle this issue more accurately.
Metadata
Metadata
Assignees
Labels
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessMedium priorityRelevant to the compiler team, which will review and decide on the PR/issue.