]>
Commit | Line | Data |
---|---|---|
a1dfa0c6 XL |
1 | use std::cell::Cell; |
2 | ||
3 | // const qualification is not smart enough to know about fields and always assumes that there might | |
4 | // be other fields that caused the qualification | |
5 | const FOO: &Option<Cell<usize>> = { | |
6 | let mut a = (Some(Cell::new(0)),); | |
7 | a.0 = None; // sets `qualif(a)` to `qualif(a) | qualif(None)` | |
5869c6ff | 8 | &{a.0} //~ ERROR cannot refer to interior mutable |
a1dfa0c6 XL |
9 | }; |
10 | ||
11 | fn main() {} |