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 6 pull requests #67451

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d419a5f
Fix pointing at arg when cause is outside of call
VirrageS Dec 1, 2019
e305bf8
Rename tests and add short test description
VirrageS Dec 3, 2019
2d8d813
Update tokio crates to latest versions
mati865 Dec 4, 2019
5dadda1
Teach `compiletest` to ignore platform triples
estebank Dec 15, 2019
f772d87
Ignore i586-unknown-linux-gnu and i586-unknown-musl in tests
estebank Dec 15, 2019
aa0ef5a
Fix handling of wasm import modules and names
alexcrichton Dec 16, 2019
3a19fbf
Add Rvalue::AddressOf to MIR
matthewjasper Dec 23, 2018
35919ac
Start generating AddressOf rvalues in MIR
matthewjasper Apr 20, 2019
5fb797c
Make slice drop shims use AddressOf
matthewjasper Apr 20, 2019
7081c79
Add mir opt test for AddressOf
matthewjasper Apr 20, 2019
7b0cc6a
Check const-propagation of borrows of unsized places
matthewjasper Sep 17, 2019
1593194
Update test now that reference to pointer casts have more checks
matthewjasper Sep 17, 2019
6dcc789
Add more tests for raw_ref_op
matthewjasper Sep 18, 2019
a749116
Fix comment ordering
matthewjasper Dec 2, 2019
44603a5
Reenable static linking of libstdc++ on windows-gnu
mati865 Dec 18, 2019
f059461
Rollup merge of #64588 - matthewjasper:mir-address-of, r=oli-obk
Centril Dec 20, 2019
5fd4689
Rollup merge of #67031 - mati865:tokio-update, r=nikomatsakis
Centril Dec 20, 2019
29f5e5c
Rollup merge of #67334 - estebank:ignore-triple, r=nikomatsakis
Centril Dec 20, 2019
2e246b8
Rollup merge of #67354 - VirrageS:blame-wrong-line, r=estebank
Centril Dec 20, 2019
8e9f09c
Rollup merge of #67363 - alexcrichton:wasm-import-modules, r=eddyb
Centril Dec 20, 2019
8f5e3d7
Rollup merge of #67410 - mati865:mingw_link_fix, r=Mark-Simulacrum
Centril Dec 20, 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
112 changes: 112 additions & 0 deletions src/test/mir-opt/address-of.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
fn address_of_reborrow() {
let y = &[0; 10];
let mut z = &mut [0; 10];

y as *const _;
y as *const [i32; 10];
y as *const dyn Send;
y as *const [i32];
y as *const i32; // This is a cast, not a coercion

let p: *const _ = y;
let p: *const [i32; 10] = y;
let p: *const dyn Send = y;
let p: *const [i32] = y;

z as *const _;
z as *const [i32; 10];
z as *const dyn Send;
z as *const [i32];

let p: *const _ = z;
let p: *const [i32; 10] = z;
let p: *const dyn Send = z;
let p: *const [i32] = z;

z as *mut _;
z as *mut [i32; 10];
z as *mut dyn Send;
z as *mut [i32];

let p: *mut _ = z;
let p: *mut [i32; 10] = z;
let p: *mut dyn Send = z;
let p: *mut [i32] = z;
}

// The normal borrows here should be preserved
fn borrow_and_cast(mut x: i32) {
let p = &x as *const i32;
let q = &mut x as *const i32;
let r = &mut x as *mut i32;
}

fn main() {}

// START rustc.address_of_reborrow.SimplifyCfg-initial.after.mir
// bb0: {
// ...
// _5 = &raw const (*_1); // & to *const casts
// ...
// _7 = &raw const (*_1);
// ...
// _11 = &raw const (*_1);
// ...
// _14 = &raw const (*_1);
// ...
// _16 = &raw const (*_1);
// ...
// _17 = &raw const (*_1); // & to *const coercions
// ...
// _18 = &raw const (*_1);
// ...
// _20 = &raw const (*_1);
// ...
// _22 = &raw const (*_1);
// ...
// _24 = &raw const (*_2); // &mut to *const casts
// ...
// _26 = &raw const (*_2);
// ...
// _30 = &raw const (*_2);
// ...
// _33 = &raw const (*_2);
// ...
// _34 = &raw const (*_2); // &mut to *const coercions
// ...
// _35 = &raw const (*_2);
// ...
// _37 = &raw const (*_2);
// ...
// _39 = &raw const (*_2);
// ...
// _41 = &raw mut (*_2); // &mut to *mut casts
// ...
// _43 = &raw mut (*_2);
// ...
// _47 = &raw mut (*_2);
// ...
// _50 = &raw mut (*_2);
// ...
// _51 = &raw mut (*_2); // &mut to *mut coercions
// ...
// _52 = &raw mut (*_2);
// ...
// _54 = &raw mut (*_2);
// ...
// _56 = &raw mut (*_2);
// ...
// }
// END rustc.address_of_reborrow.SimplifyCfg-initial.after.mir

// START rustc.borrow_and_cast.EraseRegions.after.mir
// bb0: {
// ...
// _4 = &_1;
// ...
// _7 = &mut _1;
// ...
// _10 = &mut _1;
// ...
// }
// END rustc.borrow_and_cast.EraseRegions.after.mir