Skip to content

Commit

Permalink
add missing stderr reports
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiangfei2009 committed Sep 19, 2024
1 parent 8e6604d commit ede0e45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/ui/consts/issue-17718-const-bad-values.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ LL | const C1: &'static mut [usize] = &mut [];
error[E0080]: it is undefined behavior to use this value
--> $DIR/issue-17718-const-bad-values.rs:7:1
|
LL | const C2: &'static mut usize = unsafe { &mut S };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
LL | const C2: &'static mut i32 = unsafe { &mut S };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0080]: evaluation of constant value failed
--> $DIR/no-ice-from-static-in-const-issue-52060.rs:5:35
|
LL | static B: [u32; 1] = [0; unsafe { A.len() }];
| ^ constant accesses mutable global memory

error: aborting due to 1 previous error

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

0 comments on commit ede0e45

Please sign in to comment.