2018-11-21 04:58:28 -06:00
|
|
|
use std::cell::Cell;
|
|
|
|
|
|
|
|
// const qualification is not smart enough to know about fields and always assumes that there might
|
|
|
|
// be other fields that caused the qualification
|
|
|
|
const FOO: &Option<Cell<usize>> = {
|
|
|
|
let mut a = (Some(Cell::new(0)),);
|
|
|
|
a.0 = None; // sets `qualif(a)` to `qualif(a) | qualif(None)`
|
2021-01-03 08:46:19 -06:00
|
|
|
&{a.0} //~ ERROR cannot refer to interior mutable
|
2018-11-21 04:58:28 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {}
|