rust/tests/ui/borrowck/incorrect-loan-error-on-local-update-5550.rs
2025-08-27 00:23:26 -04:00

10 lines
237 B
Rust

// https://github.com/rust-lang/rust/issues/5550
//@ run-pass
#![allow(unused_assignments)]
pub fn main() {
let s: String = "foobar".to_string();
let mut t: &str = &s;
t = &t[0..3]; // for master: str::view(t, 0, 3) maybe
}