summary refs log tree commit diff
path: root/src/test/ui/unsafe/ranged_ints3_const.stderr
blob: d83d75787d948f34ad669173b81da1a9b5fb1c0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
  --> $DIR/ranged_ints3_const.rs:12:13
   |
LL |     let y = &x.0; //~ ERROR cannot borrow a constant which may contain interior mutability
   |             ^^^^

error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
  --> $DIR/ranged_ints3_const.rs:19:22
   |
LL |     let y = unsafe { &x.0 }; //~ ERROR cannot borrow a constant which may contain interior mut
   |                      ^^^^

error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block
  --> $DIR/ranged_ints3_const.rs:12:13
   |
LL |     let y = &x.0; //~ ERROR cannot borrow a constant which may contain interior mutability
   |             ^^^^ borrow of layout constrained field with interior mutability
   |
   = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values

error: aborting due to 3 previous errors

Some errors occurred: E0133, E0492.
For more information about an error, try `rustc --explain E0133`.