-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
235 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
warning: skipping const checks | ||
--> $DIR/const_fn_ptr.rs:12:5 | ||
--> $DIR/const_fn_ptr.rs:11:1 | ||
| | ||
LL | X(x) | ||
| ^^^^ | ||
LL | / const fn bar(x: usize) -> usize { | ||
LL | | X(x) | ||
LL | | } | ||
| |_^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/const_fn_ptr.rs:16:5 | ||
--> $DIR/const_fn_ptr.rs:15:1 | ||
| | ||
LL | X_CONST(x) | ||
| ^^^^^^^^^^ | ||
LL | / const fn bar_const(x: usize) -> usize { | ||
LL | | X_CONST(x) | ||
LL | | } | ||
| |_^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/const_fn_ptr.rs:20:5 | ||
--> $DIR/const_fn_ptr.rs:19:1 | ||
| | ||
LL | x(y) | ||
| ^^^^ | ||
LL | / const fn foo(x: fn(usize) -> usize, y: usize) -> usize { | ||
LL | | x(y) | ||
LL | | } | ||
| |_^ | ||
|
||
warning: 3 warnings emitted | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
warning: skipping const checks | ||
--> $DIR/const_fn_ptr_fail.rs:10:5 | ||
--> $DIR/const_fn_ptr_fail.rs:9:1 | ||
| | ||
LL | X(x) // FIXME: this should error someday | ||
| ^^^^ | ||
LL | / const fn bar(x: usize) -> usize { | ||
LL | | X(x) // FIXME: this should error someday | ||
LL | | } | ||
| |_^ | ||
|
||
warning: 1 warning emitted | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
// compile-flags: -Zunleash-the-miri-inside-of-you | ||
// compile-flags: -Zunleash-the-miri-inside-of-you -Zdeduplicate-diagnostics | ||
#![feature(box_syntax)] | ||
#![allow(const_err)] | ||
|
||
use std::mem::ManuallyDrop; | ||
|
||
fn main() {} | ||
|
||
static TEST_BAD: &mut i32 = { | ||
static TEST_BAD: &mut i32 = { //~ WARN skipping const checks | ||
&mut *(box 0) | ||
//~^ WARN skipping const check | ||
//~| ERROR could not evaluate static initializer | ||
//~^ ERROR could not evaluate static initializer | ||
//~| NOTE heap allocations | ||
//~| WARN skipping const checks | ||
//~| WARN skipping const checks | ||
//~| WARN skipping const checks | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,19 @@ | ||
warning: skipping const checks | ||
--> $DIR/box.rs:10:11 | ||
| | ||
LL | &mut *(box 0) | ||
| ^^^^^^^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/box.rs:10:16 | ||
| | ||
LL | &mut *(box 0) | ||
| ^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/box.rs:10:5 | ||
--> $DIR/box.rs:9:1 | ||
| | ||
LL | &mut *(box 0) | ||
| ^^^^^^^^^^^^^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/box.rs:10:5 | ||
| | ||
LL | &mut *(box 0) | ||
| ^^^^^^^^^^^^^ | ||
LL | / static TEST_BAD: &mut i32 = { | ||
LL | | &mut *(box 0) | ||
LL | | | ||
LL | | | ||
LL | | }; | ||
| |__^ | ||
|
||
error[E0080]: could not evaluate static initializer | ||
--> $DIR/box.rs:10:11 | ||
| | ||
LL | &mut *(box 0) | ||
| ^^^^^^^ "heap allocations via `box` keyword" needs an rfc before being allowed inside constants | ||
|
||
error: aborting due to previous error; 4 warnings emitted | ||
error: aborting due to previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0080`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 20 additions & 30 deletions
50
src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,47 @@ | ||
warning: skipping const checks | ||
--> $DIR/const_refers_to_static.rs:13:5 | ||
--> $DIR/const_refers_to_static.rs:11:1 | ||
| | ||
LL | FOO.fetch_add(1, Ordering::Relaxed) | ||
| ^^^ | ||
LL | / const MUTATE_INTERIOR_MUT: usize = { | ||
LL | | | ||
LL | | static FOO: AtomicUsize = AtomicUsize::new(0); | ||
LL | | FOO.fetch_add(1, Ordering::Relaxed) | ||
LL | | }; | ||
| |__^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/const_refers_to_static.rs:13:5 | ||
--> $DIR/const_refers_to_static.rs:17:1 | ||
| | ||
LL | FOO.fetch_add(1, Ordering::Relaxed) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | / const READ_INTERIOR_MUT: usize = { | ||
LL | | | ||
LL | | static FOO: AtomicUsize = AtomicUsize::new(0); | ||
LL | | unsafe { *(&FOO as *const _ as *const usize) } | ||
LL | | }; | ||
| |__^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/const_refers_to_static.rs:20:17 | ||
| | ||
LL | unsafe { *(&FOO as *const _ as *const usize) } | ||
| ^^^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/const_refers_to_static.rs:20:14 | ||
| | ||
LL | unsafe { *(&FOO as *const _ as *const usize) } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/const_refers_to_static.rs:26:32 | ||
| | ||
LL | const READ_MUT: u32 = unsafe { MUTABLE }; | ||
| ^^^^^^^ | ||
|
||
warning: skipping const checks | ||
--> $DIR/const_refers_to_static.rs:26:32 | ||
--> $DIR/const_refers_to_static.rs:24:1 | ||
| | ||
LL | const READ_MUT: u32 = unsafe { MUTABLE }; | ||
| ^^^^^^^ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0080]: erroneous constant used | ||
--> $DIR/const_refers_to_static.rs:31:5 | ||
--> $DIR/const_refers_to_static.rs:28:5 | ||
| | ||
LL | MUTATE_INTERIOR_MUT; | ||
| ^^^^^^^^^^^^^^^^^^^ referenced constant has errors | ||
|
||
error[E0080]: erroneous constant used | ||
--> $DIR/const_refers_to_static.rs:33:5 | ||
--> $DIR/const_refers_to_static.rs:30:5 | ||
| | ||
LL | READ_INTERIOR_MUT; | ||
| ^^^^^^^^^^^^^^^^^ referenced constant has errors | ||
|
||
error[E0080]: erroneous constant used | ||
--> $DIR/const_refers_to_static.rs:35:5 | ||
--> $DIR/const_refers_to_static.rs:32:5 | ||
| | ||
LL | READ_MUT; | ||
| ^^^^^^^^ referenced constant has errors | ||
|
||
error: aborting due to 3 previous errors; 6 warnings emitted | ||
error: aborting due to 3 previous errors; 3 warnings emitted | ||
|
||
For more information about this error, try `rustc --explain E0080`. |
Oops, something went wrong.