Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[beta] Rollup backports #57236

Merged
merged 12 commits into from
Jan 1, 2019
Prev Previous commit
Next Next commit
Update tests to changes on master
  • Loading branch information
oli-obk authored and pietroalbini committed Dec 31, 2018
commit e5126cfcc91b043d334b0849c60e6a4a80f6b674
1 change: 1 addition & 0 deletions src/test/ui/consts/static_mut_containing_mut_ref2.rs
Original file line number Diff line number Diff line change
@@ -4,5 +4,6 @@ static mut STDERR_BUFFER_SPACE: u8 = 0;

pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };
//~^ ERROR references in statics may only refer to immutable values
//~| ERROR static contains unimplemented expression type

fn main() {}
11 changes: 9 additions & 2 deletions src/test/ui/consts/static_mut_containing_mut_ref2.stderr
Original file line number Diff line number Diff line change
@@ -4,6 +4,13 @@ error[E0017]: references in statics may only refer to immutable values
LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ statics require immutable values

error: aborting due to previous error
error[E0019]: static contains unimplemented expression type
--> $DIR/static_mut_containing_mut_ref2.rs:5:45
|
LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0017`.
Some errors occurred: E0017, E0019.
For more information about an error, try `rustc --explain E0017`.