]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsafe/ranged_ints3_match.mirunsafeck.stderr
Rollup merge of #103033 - alyssais:pkg-config, r=joshtriplett
[rust.git] / src / test / ui / unsafe / ranged_ints3_match.mirunsafeck.stderr
1 error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block
2   --> $DIR/ranged_ints3_match.rs:14:17
3    |
4 LL |         NonZero(ref x) => { x }
5    |                 ^^^^^ borrow of layout constrained field with interior mutability
6    |
7    = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values
8
9 error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block
10   --> $DIR/ranged_ints3_match.rs:20:23
11    |
12 LL |     match y { NonZero(ref mut y) => { y } };
13    |                       ^^^^^^^^^ mutation of layout constrained field
14    |
15    = note: mutating layout constrained fields cannot statically be checked for valid values
16
17 error: aborting due to 2 previous errors
18
19 For more information about this error, try `rustc --explain E0133`.