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

Rollup of 14 pull requests #57087

Merged
merged 43 commits into from
Dec 24, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e38e954
Simplify MIR generation for logical ops
sinkuu Dec 17, 2018
f731445
Mark tuple structs as live if their constructors are used
oli-obk Dec 18, 2018
c2402dc
Replace "native pointer" in error message with "raw pointer"
varkor Dec 18, 2018
d6969ac
Fix string for raw pointer deref suggestion
varkor Dec 18, 2018
0309874
Fix string for array access suggestion
varkor Dec 18, 2018
e7c5146
Remove `TokenStream::JointTree`.
nnethercote Dec 19, 2018
405d8b0
Copyrite
oli-obk Dec 20, 2018
59f643f
Point to return span when writing `return;` on non-() fn
estebank Dec 20, 2018
cdbccf5
Point at coercion source on type errors for fn returning `impl Trait`
estebank Dec 21, 2018
f8e508c
Fix a recently introduces regression
oli-obk Dec 17, 2018
b9d74fc
Also test projections
oli-obk Dec 17, 2018
3414be0
fix deprecation warnings in liballoc benches
RalfJung Dec 21, 2018
6ed596e
Update tests to changes on master
oli-obk Dec 21, 2018
097d39d
Fix alignment for array indexing
nikic Dec 21, 2018
20d694a
Update Pin API to match the one proposed for stabilization
cramertj Dec 18, 2018
610bcaf
Stabilize Pin
cramertj Dec 18, 2018
3005bf3
Pin stabilization: fix doctests
cramertj Dec 18, 2018
684fe9a
Rename Box/Arc/Rc::pinned to ::pin
cramertj Dec 18, 2018
861df06
Fix Unpin docs link
cramertj Dec 18, 2018
6dd0d2d
Fix a comment
bjorn3 Dec 22, 2018
3986c96
enum type instead of variant suggestion unification
zackmdavis Nov 19, 2018
64ad3e2
adjust enum type instead of variant suggestions for prelude enums
zackmdavis Nov 23, 2018
2820dc8
Remove dead code
estebank Dec 23, 2018
b42a3ac
stabilize min_const_unsafe_fn in 1.33.
Centril Dec 22, 2018
bd1d5bc
stabilize min_const_unsafe_fn --bless tests.
Centril Dec 22, 2018
7ae6fb2
stabilize min_const_unsafe_fn -- revert const-size_of-cycle changes
Centril Dec 22, 2018
db542b8
test: Ignore ui/target-feature-gate on s390x
glaubitz Dec 23, 2018
ecdbcad
test: Ignore codegen/x86_mmx.rs on s390x
glaubitz Dec 23, 2018
2c0f011
Improve docs for collecting into `Option`s
killercup Nov 29, 2018
4c97162
Rollup merge of #56188 - zackmdavis:if_i_may_suggest, r=davidtwco
Centril Dec 23, 2018
90a3586
Rollup merge of #56342 - killercup:collect-into-option-docs, r=bluss
Centril Dec 23, 2018
84bc34e
Rollup merge of #56916 - oli-obk:static_mut_beta_regression, r=davidtwco
Centril Dec 23, 2018
6ce5ecb
Rollup merge of #56917 - sinkuu:mir_build_logicop, r=davidtwco
Centril Dec 23, 2018
93af1e7
Rollup merge of #56939 - cramertj:pin-stabilization, r=alexcrichton
Centril Dec 23, 2018
5157c22
Rollup merge of #56953 - oli-obk:dead_const, r=petrochenkov
Centril Dec 23, 2018
61f50d9
Rollup merge of #56964 - nnethercote:TokenStream-IsJoint, r=petrochenkov
Centril Dec 23, 2018
eb24b33
Rollup merge of #56966 - varkor:raw-pointer-deref-parens, r=zackmdavis
Centril Dec 23, 2018
0c1ba07
Rollup merge of #57020 - estebank:return-span, r=zackmdavis
Centril Dec 23, 2018
93bc72f
Rollup merge of #57032 - RalfJung:alloc-bench-deprecations, r=Centril
Centril Dec 23, 2018
4ebc7b7
Rollup merge of #57053 - nikic:fix-gep-align, r=nagisa
Centril Dec 23, 2018
e482677
Rollup merge of #57062 - bjorn3:patch-1, r=varkor
Centril Dec 23, 2018
975a7f0
Rollup merge of #57067 - Centril:stabilize-min_const_unsafe_fn, r=oli…
Centril Dec 23, 2018
dff3e41
Rollup merge of #57078 - glaubitz:ignore-tests, r=nikic
Centril Dec 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/qualify_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {

// Only allow statics (not consts) to refer to other statics.
if self.mode == Mode::Static || self.mode == Mode::StaticMut {
if context.is_mutating_use() {
if self.mode == Mode::Static && context.is_mutating_use() {
// this is not strictly necessary as miri will also bail out
// For interior mutability we can't really catch this statically as that
// goes through raw pointers and intermediate temporaries, so miri has
Expand Down
7 changes: 7 additions & 0 deletions src/test/ui/consts/static_mut_containing_mut_ref.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// compile-pass

static mut STDERR_BUFFER_SPACE: [u8; 42] = [0u8; 42];

pub static mut STDERR_BUFFER: *mut [u8] = unsafe { &mut STDERR_BUFFER_SPACE };

fn main() {}
9 changes: 9 additions & 0 deletions src/test/ui/consts/static_mut_containing_mut_ref2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#![feature(const_let)]

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() {}
16 changes: 16 additions & 0 deletions src/test/ui/consts/static_mut_containing_mut_ref2.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error[E0017]: references in statics may only refer to immutable values
--> $DIR/static_mut_containing_mut_ref2.rs:5:46
|
LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ statics require immutable values

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

Some errors occurred: E0017, E0019.
For more information about an error, try `rustc --explain E0017`.
8 changes: 8 additions & 0 deletions src/test/ui/consts/static_mut_containing_mut_ref3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![feature(const_let)]

static mut FOO: (u8, u8) = (42, 43);

static mut BAR: () = unsafe { FOO.0 = 99; };
//~^ ERROR could not evaluate static initializer

fn main() {}
9 changes: 9 additions & 0 deletions src/test/ui/consts/static_mut_containing_mut_ref3.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0080]: could not evaluate static initializer
--> $DIR/static_mut_containing_mut_ref3.rs:5:31
|
LL | static mut BAR: () = unsafe { FOO.0 = 99; };
| ^^^^^^^^^^ tried to modify a static's initial value from another static's initializer

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
4 changes: 2 additions & 2 deletions src/test/ui/write-to-static-mut-in-static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

pub static mut A: u32 = 0;
pub static mut B: () = unsafe { A = 1; };
//~^ ERROR cannot mutate statics in the initializer of another static
//~^ ERROR could not evaluate static initializer

pub static mut C: u32 = unsafe { C = 1; 0 };
//~^ ERROR cannot mutate statics in the initializer of another static
//~^ ERROR cycle detected

pub static D: u32 = D;

Expand Down
20 changes: 17 additions & 3 deletions src/test/ui/write-to-static-mut-in-static.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
error: cannot mutate statics in the initializer of another static
error[E0080]: could not evaluate static initializer
--> $DIR/write-to-static-mut-in-static.rs:14:33
|
LL | pub static mut B: () = unsafe { A = 1; };
| ^^^^^
| ^^^^^ tried to modify a static's initial value from another static's initializer

error: cannot mutate statics in the initializer of another static
error[E0391]: cycle detected when const-evaluating `C`
--> $DIR/write-to-static-mut-in-static.rs:17:34
|
LL | pub static mut C: u32 = unsafe { C = 1; 0 };
| ^^^^^
|
note: ...which requires const-evaluating `C`...
--> $DIR/write-to-static-mut-in-static.rs:17:1
|
LL | pub static mut C: u32 = unsafe { C = 1; 0 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which again requires const-evaluating `C`, completing the cycle
note: cycle used when const-evaluating + checking `C`
--> $DIR/write-to-static-mut-in-static.rs:17:1
|
LL | pub static mut C: u32 = unsafe { C = 1; 0 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Some errors occurred: E0080, E0391.
For more information about an error, try `rustc --explain E0080`.