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

11 lines
275 B
Rust
Raw Normal View History

2018-11-21 03:37:18 -06:00
#![feature(const_let)]
use std::cell::Cell;
const FOO: &(Cell<usize>, bool) = {
let mut a = (Cell::new(0), false);
a.1 = true; // resets `qualif(a)` to `qualif(true)`
&{a} //~ ERROR cannot borrow a constant which may contain interior mutability
};
fn main() {}