mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
8 lines
190 B
Rust
8 lines
190 B
Rust
|
// Regression test for #92105.
|
||
|
// ICE when mutating immutable reference from last statement of a block.
|
||
|
|
||
|
fn main() {
|
||
|
let foo = Some(&0).unwrap();
|
||
|
*foo = 1; //~ ERROR cannot assign
|
||
|
}
|