forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#67333 - wesleywiser:fix_inline_into_box_pla…
…ce, r=oli-obk [mir-opt] Fix `Inline` pass to handle inlining into `box` expressions r? @oli-obk Before, the test case just ICE'd here: https://github.com/rust-lang/rust/blob/a605441e049f0b6d5f7715b94b8ac4662fd7fcf6/src/librustc_mir/transform/inline.rs#L668
- Loading branch information
Showing
9 changed files
with
91 additions
and
10 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,71 @@ | ||
// ignore-tidy-linelength | ||
// ignore-wasm32-bare compiled with panic=abort by default | ||
#![feature(box_syntax)] | ||
|
||
fn main() { | ||
let _x: Box<Vec<u32>> = box Vec::new(); | ||
} | ||
|
||
// END RUST SOURCE | ||
// START rustc.main.Inline.before.mir | ||
// let mut _0: (); | ||
// let _1: std::boxed::Box<std::vec::Vec<u32>> as UserTypeProjection { base: UserType(0), projs: [] }; | ||
// let mut _2: std::boxed::Box<std::vec::Vec<u32>>; | ||
// let mut _3: (); | ||
// scope 1 { | ||
// debug _x => _1; | ||
// } | ||
// bb0: { | ||
// StorageLive(_1); | ||
// StorageLive(_2); | ||
// _2 = Box(std::vec::Vec<u32>); | ||
// (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; | ||
// } | ||
// bb1 (cleanup): { | ||
// resume; | ||
// } | ||
// bb2: { | ||
// _1 = move _2; | ||
// StorageDead(_2); | ||
// _0 = (); | ||
// drop(_1) -> [return: bb3, unwind: bb1]; | ||
// } | ||
// bb3: { | ||
// StorageDead(_1); | ||
// return; | ||
// } | ||
// bb4 (cleanup): { | ||
// _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; | ||
// } | ||
// END rustc.main.Inline.before.mir | ||
// START rustc.main.Inline.after.mir | ||
// let mut _0: (); | ||
// let _1: std::boxed::Box<std::vec::Vec<u32>> as UserTypeProjection { base: UserType(0), projs: [] }; | ||
// let mut _2: std::boxed::Box<std::vec::Vec<u32>>; | ||
// let mut _3: (); | ||
// let mut _4: &mut std::vec::Vec<u32>; | ||
// scope 1 { | ||
// debug _x => _1; | ||
// } | ||
// scope 2 { | ||
// } | ||
// bb0: { | ||
// StorageLive(_1); | ||
// StorageLive(_2); | ||
// _2 = Box(std::vec::Vec<u32>); | ||
// _4 = &mut (*_2); | ||
// ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32>::NEW; | ||
// ((*_4).1: usize) = const 0usize; | ||
// _1 = move _2; | ||
// StorageDead(_2); | ||
// _0 = (); | ||
// drop(_1) -> [return: bb2, unwind: bb1]; | ||
// } | ||
// bb1 (cleanup): { | ||
// resume; | ||
// } | ||
// bb2: { | ||
// StorageDead(_1); | ||
// return; | ||
// } | ||
// END rustc.main.Inline.after.mir |
File renamed without changes.
File renamed without changes.
File renamed without changes.