Skip to content

Rollup of 13 pull requests #65009

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

Merged
merged 38 commits into from
Oct 2, 2019
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4aa526f
Improve sidebar styling to make its integration easier
GuillaumeGomez Oct 1, 2019
9fe138a
regression test for 64453 borrow check error.
pnkfelix Sep 30, 2019
4808106
fix typo
ztlpn Sep 16, 2019
057569e
fix spurious unreachable_code lints for try{} block ok-wrapping
ztlpn Sep 18, 2019
c474c6e
add tests
ztlpn Sep 18, 2019
ffa5269
address review comments
ztlpn Sep 18, 2019
cb4ed52
fix test after rebase
ztlpn Sep 22, 2019
6acdea4
Make comment about dummy type a bit more clear
spastorino Oct 1, 2019
738baa7
Update src/librustc/ty/mod.rs
spastorino Oct 1, 2019
75fdb95
change .node -> .kind after rebase
ztlpn Oct 1, 2019
a1ad38f
Pass attrs to `do_dataflow` in new const checker
ecstatic-morse Oct 1, 2019
8d84646
Don't mark zero-sized arrays as indirectly mutable when borrowed
ecstatic-morse Oct 1, 2019
4eeedd0
Add test cases for #64945
ecstatic-morse Oct 1, 2019
2427029
Fix typo passing flags to rustc
ecstatic-morse Oct 1, 2019
cf984d2
This needs to be build-pass since it involves debuginfo
ecstatic-morse Oct 1, 2019
f18535f
Refactor `rustc_peek`
ecstatic-morse Jul 6, 2019
767550e
Add `rustc_peek` support for `IndirectlyMutableLocals`
ecstatic-morse Oct 2, 2019
33aa5e8
Add test exposing unsoundness in `IndirectlyMutableLocals`
ecstatic-morse Oct 2, 2019
8e67180
Fix async/await ICE #64964
sinkuu Oct 2, 2019
f0fddb1
Do not collect to vec for debug output
sinkuu Oct 2, 2019
3a8932d
[const-prop] Correctly handle locals that can't be propagated
wesleywiser Oct 2, 2019
675ed48
Remove inline annotations from dep_node
Mark-Simulacrum Sep 30, 2019
70dcb99
Remove rustdoc warning
GuillaumeGomez Oct 2, 2019
8e9f635
rustc book: nitpick SLP vectorization
Oct 2, 2019
79dc862
Use PlaceBuilder to avoid a lot of slice -> vec -> slice convertions
spastorino Sep 30, 2019
18d0c03
Rollup merge of #64581 - ztlpn:fix-ok-wrapping-unreachable-code, r=Ce…
Centril Oct 2, 2019
b7290a0
Rollup merge of #64850 - Mark-Simulacrum:dedup-dep-node, r=michaelwoe…
Centril Oct 2, 2019
fe5fad8
Rollup merge of #64914 - pnkfelix:issue-64453-regression-test, r=niko…
Centril Oct 2, 2019
19d035c
Rollup merge of #64922 - spastorino:make-place-builder, r=nikomatsakis
Centril Oct 2, 2019
1c8ef98
Rollup merge of #64948 - GuillaumeGomez:improve-sidebar-styling, r=Ma…
Centril Oct 2, 2019
475f5d4
Rollup merge of #64961 - rust-lang:spastorino-patch-1, r=oli-obk
Centril Oct 2, 2019
ccf1d9c
Rollup merge of #64967 - ecstatic-morse:issue-64945, r=oli-obk
Centril Oct 2, 2019
10b0fe9
Rollup merge of #64973 - ecstatic-morse:fix-debuginfo-test, r=alexcri…
Centril Oct 2, 2019
7daf2e8
Rollup merge of #64980 - ecstatic-morse:better-rustc-peek, r=oli-obk
Centril Oct 2, 2019
028ffd1
Rollup merge of #64989 - sinkuu:fix_ice_64964, r=davidtwco
Centril Oct 2, 2019
34ea559
Rollup merge of #64991 - wesleywiser:fix_too_eager_const_prop, r=oli-obk
Centril Oct 2, 2019
ebbc9ce
Rollup merge of #64995 - GuillaumeGomez:libtest-rustdoc-warning, r=Ma…
Centril Oct 2, 2019
b961f96
Rollup merge of #64997 - rust-lang:nitpick-slp, r=jonas-schievink
Centril Oct 2, 2019
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
42 changes: 42 additions & 0 deletions src/test/ui/mir-dataflow/indirect-mutation-offset.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// compile-flags: -Zunleash-the-miri-inside-of-you

#![feature(core_intrinsics, rustc_attrs, const_raw_ptr_deref)]

use std::cell::UnsafeCell;
use std::intrinsics::rustc_peek;

#[repr(C)]
struct PartialInteriorMut {
zst: [i32; 0],
cell: UnsafeCell<i32>,
}

#[rustc_mir(rustc_peek_indirectly_mutable,stop_after_dataflow)]
#[rustc_mir(borrowck_graphviz_postflow="indirect.dot")]
const BOO: i32 = {
let x = PartialInteriorMut {
zst: [],
cell: UnsafeCell::new(0),
};

let p_zst: *const _ = &x.zst ; // Doesn't cause `x` to get marked as indirectly mutable.

let rmut_cell = unsafe {
// Take advantage of the fact that `zst` and `cell` are at the same location in memory.
// This trick would work with any size type if miri implemented `ptr::offset`.
let p_cell = p_zst as *const UnsafeCell<i32>;

let pmut_cell = (*p_cell).get();
&mut *pmut_cell
};

*rmut_cell = 42; // Mutates `x` indirectly even though `x` is not marked indirectly mutable!!!
let val = *rmut_cell;
unsafe { rustc_peek(x) }; //~ ERROR rustc_peek: bit not set

val
};

fn main() {
println!("{}", BOO);
}
10 changes: 10 additions & 0 deletions src/test/ui/mir-dataflow/indirect-mutation-offset.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: rustc_peek: bit not set
--> $DIR/indirect-mutation-offset.rs:35:14
|
LL | unsafe { rustc_peek(x) };
| ^^^^^^^^^^^^^

error: stop_after_dataflow ended compilation

error: aborting due to 2 previous errors