]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-57989.rs
Rollup merge of #60685 - dtolnay:spdx, r=nikomatsakis
[rust.git] / src / test / ui / nll / issue-57989.rs
1 // Test for ICE from issue 57989
2
3 #![feature(nll)]
4
5 fn f(x: &i32) {
6     let g = &x;
7     *x = 0;     //~ ERROR cannot assign to `*x` which is behind a `&` reference
8                 //~| ERROR cannot assign to `*x` because it is borrowed
9     g;
10 }
11
12 fn main() {}