forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#71593 - Dylan-DPC:rollup-ms7j94u, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#71421 (Add a function to turn Box<T> into Box<[T]>) - rust-lang#71537 (Remove support for self-opening) - rust-lang#71551 (Minor refactoring around IndexVec usage in generator transformation) - rust-lang#71569 ([miri] Throw UB if target size and data size don't match) - rust-lang#71576 (check that `AsRef` and `AsMut` are inlined) Failed merges: - rust-lang#71558 (Cleanup and document `-Z tls-model` ) r? @ghost
- Loading branch information
Showing
20 changed files
with
263 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// EMIT_MIR rustc.a.Inline.after.mir | ||
pub fn a<T>(x: &mut [T]) -> &mut [T] { | ||
x.as_mut() | ||
} | ||
|
||
// EMIT_MIR rustc.b.Inline.after.mir | ||
pub fn b<T>(x: &mut Box<T>) -> &mut T { | ||
x.as_mut() | ||
} | ||
|
||
// EMIT_MIR rustc.c.Inline.after.mir | ||
pub fn c<T>(x: &[T]) -> &[T] { | ||
x.as_ref() | ||
} | ||
|
||
// EMIT_MIR rustc.d.Inline.after.mir | ||
pub fn d<T>(x: &Box<T>) -> &T { | ||
x.as_ref() | ||
} | ||
|
||
fn main() { | ||
let mut boxed = Box::new(1); | ||
println!("{:?}", a(&mut [1])); | ||
println!("{:?}", b(&mut boxed)); | ||
println!("{:?}", c(&[1])); | ||
println!("{:?}", d(&boxed)); | ||
} |
30 changes: 30 additions & 0 deletions
30
src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.a.Inline.after.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// MIR for `a` after Inline | ||
|
||
fn a(_1: &mut [T]) -> &mut [T] { | ||
debug x => _1; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:2:13: 2:14 | ||
let mut _0: &mut [T]; // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:2:29: 2:37 | ||
let mut _2: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 | ||
let mut _3: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 | ||
let mut _4: &mut [T]; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6 | ||
scope 1 { | ||
debug self => _4; // in scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL | ||
let mut _5: &mut [T]; // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 | ||
} | ||
|
||
bb0: { | ||
StorageLive(_2); // bb0[0]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 | ||
StorageLive(_3); // bb0[1]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 | ||
StorageLive(_4); // bb0[2]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6 | ||
_4 = &mut (*_1); // bb0[3]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6 | ||
StorageLive(_5); // bb0[4]: scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL | ||
_5 = _4; // bb0[5]: scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL | ||
_3 = _5; // bb0[6]: scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL | ||
StorageDead(_5); // bb0[7]: scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL | ||
_2 = &mut (*_3); // bb0[8]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 | ||
StorageDead(_4); // bb0[9]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:14: 3:15 | ||
_0 = &mut (*_2); // bb0[10]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15 | ||
StorageDead(_3); // bb0[11]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:1: 4:2 | ||
StorageDead(_2); // bb0[12]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:1: 4:2 | ||
return; // bb0[13]: scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:2: 4:2 | ||
} | ||
} |
Oops, something went wrong.