diff options
| author | Ralf Jung <post@ralfj.de> | 2019-08-01 09:12:48 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-08-02 23:04:11 +0200 |
| commit | b9db95edb1136de4230bb2e130c4e09b06f7f3a7 (patch) | |
| tree | 40a1a618251df84051a45735a041c59bf0eb5d94 /src | |
| parent | 0f97583e68f26eb1a1957886ea1fa8fa17288b92 (diff) | |
| download | rust-b9db95edb1136de4230bb2e130c4e09b06f7f3a7.tar.gz rust-b9db95edb1136de4230bb2e130c4e09b06f7f3a7.zip | |
fix rebase fallout
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/consts/issue-51559.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/consts/issue-51559.stderr | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/test/ui/consts/issue-51559.rs b/src/test/ui/consts/issue-51559.rs index 42994726938..69f0d8df0aa 100644 --- a/src/test/ui/consts/issue-51559.rs +++ b/src/test/ui/consts/issue-51559.rs @@ -2,6 +2,6 @@ const BAR: *mut () = ((|| 3) as fn() -> i32) as *mut (); pub const FOO: usize = unsafe { BAR as usize }; -//~^ ERROR it is undefined behavior to use this value +//~^ ERROR any use of this value will cause an error fn main() {} diff --git a/src/test/ui/consts/issue-51559.stderr b/src/test/ui/consts/issue-51559.stderr index 917c54ddaef..4d50ec818bc 100644 --- a/src/test/ui/consts/issue-51559.stderr +++ b/src/test/ui/consts/issue-51559.stderr @@ -1,11 +1,12 @@ -error[E0080]: it is undefined behavior to use this value - --> $DIR/issue-51559.rs:4:1 +error: any use of this value will cause an error + --> $DIR/issue-51559.rs:4:33 | LL | pub const FOO: usize = unsafe { BAR as usize }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes + | --------------------------------^^^^^^^^^^^^--- + | | + | "pointer-to-integer cast" needs an rfc before being allowed inside constants | - = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior + = note: `#[deny(const_err)]` on by default error: aborting due to previous error -For more information about this error, try `rustc --explain E0080`. |
