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 19 pull requests #57005

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
1bdd6ca
retrieve ty info from place_ty
csmoe Dec 15, 2018
7f9883d
Add unstable VecDeque::rotate_{left|right}
scottmcm Dec 15, 2018
9ca2902
update test
csmoe Dec 15, 2018
c4fa1d2
stop treating trait objects from #[fundamental] traits as fundamental
arielb1 Dec 15, 2018
0815531
Add a note about why the unsafe is sound
scottmcm Dec 16, 2018
bf4a984
Reduce search-index.js size
GuillaumeGomez Dec 16, 2018
fba23d0
Disable field reordering for repr(int).
emilio Dec 16, 2018
d84bdba
Add test to check order of repr(int) enum fields
petertodd Dec 8, 2018
bbce189
rustc: Update Clang used to build LLVM on LInux
alexcrichton Dec 16, 2018
a2b6401
Issue 56905
blitzerr Dec 17, 2018
37c3561
describe index with accurate _
csmoe Dec 17, 2018
b31a1f7
Fix a recently introduces regression
oli-obk Dec 17, 2018
7e2e489
Also test projections
oli-obk Dec 17, 2018
3e7a4ca
Remove a wrong multiplier on relocation offset computation
oli-obk Dec 17, 2018
e7e17f9
static eval: Do not ICE on layout size overflow
dlrobertson Dec 17, 2018
6130fc8
Add --progress to git submodule commands
Dec 17, 2018
50eb5f6
Explain the math
oli-obk Dec 18, 2018
170f068
Don't render const keyword on stable
GuillaumeGomez Oct 24, 2018
00bd306
Extend documentation for mem uninit to discuss partial allocation of …
Firstyear Dec 19, 2018
0829d0c
Updates based on comment
Firstyear Dec 19, 2018
d751954
Creating the vector using with_capacity to avoid re-allocation later …
blitzerr Dec 19, 2018
cbe9abb
Add more VecDeque::rotate_{left|right} tests
scottmcm Dec 19, 2018
a6943d9
Set constness correctly
GuillaumeGomez Dec 18, 2018
b2d8040
Fix tidy error
Firstyear Dec 19, 2018
202904b
make basic CTFE tracing available on release builds
RalfJung Dec 19, 2018
885cf2a
Adding unwinding support for x86_64_fortanix_unknown_sgx target.
Dec 14, 2018
818ed69
dropck: simplify common patterns
ljedrz Dec 19, 2018
ae3f6b0
dropck: remove unnecessary call to cloned()
ljedrz Dec 19, 2018
7eb67c2
test: Ignore ui/target-feature-gate on powerpc and powerpc64(le)
glaubitz Dec 19, 2018
a153d48
test: Ignore ui/target-feature-gate on sparc and sparc64
glaubitz Dec 19, 2018
036ce5c
Fix compiletest `trim` deprecation warnings
phansch Dec 19, 2018
7b70b0b
Rollup merge of #56842 - scottmcm:vecdeque-rotate, r=alexcrichton
pietroalbini Dec 20, 2018
063e4a2
Rollup merge of #56843 - csmoe:non-copy, r=davidtwco
pietroalbini Dec 20, 2018
80bc55b
Rollup merge of #56845 - GuillaumeGomez:const-docs, r=oli-obk
pietroalbini Dec 20, 2018
234c340
Rollup merge of #56862 - arielb1:fundamentally-clean, r=nikomatsakis
pietroalbini Dec 20, 2018
7c7e21a
Rollup merge of #56869 - GuillaumeGomez:index-size-reduction, r=Quiet…
pietroalbini Dec 20, 2018
e12e472
Rollup merge of #56887 - emilio:enum-field-reordering, r=eddyb
pietroalbini Dec 20, 2018
e801ffa
Rollup merge of #56892 - alexcrichton:new-llvm, r=michaelwoerister
pietroalbini Dec 20, 2018
f46a757
Rollup merge of #56906 - blitzerr:master, r=nikomatsakis
pietroalbini Dec 20, 2018
7b61ef3
Rollup merge of #56909 - dlrobertson:fix_56762, r=estebank
pietroalbini Dec 20, 2018
7429367
Rollup merge of #56914 - glaubitz:ignore-tests, r=alexcrichton
pietroalbini Dec 20, 2018
5ecc80a
Rollup merge of #56916 - oli-obk:static_mut_beta_regression, r=davidtwco
pietroalbini Dec 20, 2018
d96be3d
Rollup merge of #56919 - oli-obk:null_ref_array_tuple, r=RalfJung
pietroalbini Dec 20, 2018
5a118d4
Rollup merge of #56933 - clarcharr:xpy_progress, r=Mark-Simulacrum
pietroalbini Dec 20, 2018
3fa6672
Rollup merge of #56954 - hug-dev:armv8m-main-ci, r=alexcrichton
pietroalbini Dec 20, 2018
bfb4cce
Rollup merge of #56970 - Firstyear:mem_uninit_doc_ptr_drop, r=Manishe…
pietroalbini Dec 20, 2018
3b15bd2
Rollup merge of #56973 - RalfJung:miri-trace, r=oli-obk
pietroalbini Dec 20, 2018
04e51eb
Rollup merge of #56979 - VardhanThigle:Vardhan/rust-sgx-unwind-suppor…
pietroalbini Dec 20, 2018
b2207e2
Rollup merge of #56984 - ljedrz:dropck_outlives_tweaks, r=oli-obk
pietroalbini Dec 20, 2018
0880d95
Rollup merge of #56989 - phansch:fix_compiletest_trim_deprecations, r…
pietroalbini Dec 20, 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
Prev Previous commit
Next Next commit
Fix a recently introduces regression
  • Loading branch information
oli-obk committed Dec 17, 2018
commit b31a1f74efd17521e11fee4685f7e27f9b9d192c
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() {}
8 changes: 8 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,8 @@
#![feature(const_let)]

static mut STDERR_BUFFER_SPACE: u8 = 0;

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

fn main() {}
9 changes: 9 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,9 @@
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: aborting due to previous error

For more information about this error, try `rustc --explain E0017`.
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`.