rust/tests/ui/borrowck/issue-92015.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
190 B
Rust
Raw Normal View History

2021-12-29 05:50:00 +00:00
// 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
}