summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/issues/issue-100313.stderr
blob: 5832dbe1777de6be7c25011b7352e6b1b4970405 (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
25
26
27
28
29
error: assigning to `&T` is undefined behavior, consider using an `UnsafeCell`
  --> $DIR/issue-100313.rs:10:13
   |
LL |             *(B as *const bool as *mut bool) = false;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html>
   = note: `#[deny(invalid_reference_casting)]` on by default

error[E0080]: evaluation of constant value failed
  --> $DIR/issue-100313.rs:10:13
   |
LL |             *(B as *const bool as *mut bool) = false;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC0 which is read-only
   |
note: inside `T::<&true>::set_false`
  --> $DIR/issue-100313.rs:10:13
   |
LL |             *(B as *const bool as *mut bool) = false;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `_`
  --> $DIR/issue-100313.rs:19:5
   |
LL |     x.set_false();
   |     ^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.