summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/issue-92015.rs
blob: 16d651717ff2c0f935a7e550e6f7f3cc556e7c51 (plain)
1
2
3
4
5
6
7
// 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
}