rust/src/test/ui/consts/partial_qualif.rs

10 lines
265 B
Rust
Raw Normal View History

2018-11-21 03:37:18 -06:00
use std::cell::Cell;
const FOO: &(Cell<usize>, bool) = {
let mut a = (Cell::new(0), false);
2018-11-21 04:47:16 -06:00
a.1 = true; // sets `qualif(a)` to `qualif(a) | qualif(true)`
&{a} //~ ERROR borrow to an interior mutable value may end up in the final value
2018-11-21 03:37:18 -06:00
};
2018-11-21 04:13:49 -06:00
fn main() {}