rust/tests/ui/consts/partial_qualif.rs

10 lines
232 B
Rust
Raw Normal View History

2018-11-21 09:37:18 +00:00
use std::cell::Cell;
const FOO: &(Cell<usize>, bool) = {
let mut a = (Cell::new(0), false);
2018-11-21 10:47:16 +00:00
a.1 = true; // sets `qualif(a)` to `qualif(a) | qualif(true)`
&{a} //~ ERROR cannot refer to interior mutable
2018-11-21 09:37:18 +00:00
};
2018-11-21 10:13:49 +00:00
fn main() {}