Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ab645809
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ab645809
编写于
9月 16, 2021
作者:
G
Gary Guo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bless tests
上级
19eaee2c
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
342 addition
and
213 deletion
+342
-213
src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir
src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir
+40
-26
src/test/mir-opt/const_prop/boxes.main.ConstProp.diff
src/test/mir-opt/const_prop/boxes.main.ConstProp.diff
+26
-9
src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff
...r-opt/inline/inline_into_box_place.main.Inline.32bit.diff
+37
-23
src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff
...r-opt/inline/inline_into_box_place.main.Inline.64bit.diff
+37
-23
src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir
src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir
+69
-55
src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir
...uniform_array_move_out.move_out_by_subslice.mir_map.0.mir
+65
-37
src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir
...pt/uniform_array_move_out.move_out_from_end.mir_map.0.mir
+65
-37
src/test/ui/consts/miri_unleashed/box.rs
src/test/ui/consts/miri_unleashed/box.rs
+1
-1
src/test/ui/consts/miri_unleashed/box.stderr
src/test/ui/consts/miri_unleashed/box.stderr
+1
-1
src/test/ui/nll/issue-52663-trait-object.stderr
src/test/ui/nll/issue-52663-trait-object.stderr
+1
-1
未找到文件。
src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir
浏览文件 @
ab645809
...
...
@@ -3,64 +3,78 @@
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/box_expr.rs:6:11: 6:11
let _1: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:9: 7:10
let mut _2: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let _3: (); // in scope 0 at $DIR/box_expr.rs:8:5: 8:12
let mut _4: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:8:10: 8:11
let mut _2: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _3: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _4: *mut u8; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _5: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let _6: (); // in scope 0 at $DIR/box_expr.rs:8:5: 8:12
let mut _7: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:8:10: 8:11
scope 1 {
debug x => _1; // in scope 1 at $DIR/box_expr.rs:7:9: 7:10
}
scope 2 {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:7:9: 7:10
StorageLive(_2); // scope 0
at $DIR/box_expr.rs:7:13: 7:25
_
2 = Box(S); // scope 0
at $DIR/box_expr.rs:7:13: 7:25
(*_2) = S::new() -> [return: bb1, unwind: bb7]; // scope 0 at $DIR/box_expr.rs:7:17
: 7:25
_2 = SizeOf(S); // scope 2
at $DIR/box_expr.rs:7:13: 7:25
_
3 = AlignOf(S); // scope 2
at $DIR/box_expr.rs:7:13: 7:25
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/box_expr.rs:7:13
: 7:25
// mir::Constant
// + span: $DIR/box_expr.rs:7:1
7: 7:23
// + literal: Const { ty:
fn() -> S {S::new
}, val: Value(Scalar(<ZST>)) }
// + span: $DIR/box_expr.rs:7:1
3: 7:25
// + literal: Const { ty:
unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc
}, val: Value(Scalar(<ZST>)) }
}
bb1: {
_1 = move _2; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
drop(_2) -> bb2; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
StorageLive(_5); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
_5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
(*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
// mir::Constant
// + span: $DIR/box_expr.rs:7:17: 7:23
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
}
bb2: {
StorageDead(_2); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
StorageLive(_3); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
StorageLive(_4); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_4 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_3 = std::mem::drop::<Box<S>>(move _4) -> [return: bb3, unwind: bb5]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
_1 = move _5; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
drop(_5) -> bb3; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb3: {
StorageDead(_5); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
StorageLive(_6); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
StorageLive(_7); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_7 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
// mir::Constant
// + span: $DIR/box_expr.rs:8:5: 8:9
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }
}
bb
3
: {
StorageDead(_
4
); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
StorageDead(_
3
); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
bb
4
: {
StorageDead(_
7
); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
StorageDead(_
6
); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
_0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2
drop(_1) -> bb
4
; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
drop(_1) -> bb
5
; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb
4
: {
bb
5
: {
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
}
bb5 (cleanup): {
drop(_4) -> bb6; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
}
bb6 (cleanup): {
drop(_
1) -> bb8; // scope 0 at $DIR/box_expr.rs:9:1: 9:
2
drop(_
7) -> bb7; // scope 1 at $DIR/box_expr.rs:8:11: 8:1
2
}
bb7 (cleanup): {
drop(_
2) -> bb8; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
drop(_
1) -> bb9; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb8 (cleanup): {
drop(_5) -> bb9; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb9 (cleanup): {
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
}
}
src/test/mir-opt/const_prop/boxes.main.ConstProp.diff
浏览文件 @
ab645809
...
...
@@ -6,34 +6,51 @@
let _1: i32; // in scope 0 at $DIR/boxes.rs:12:9: 12:10
let mut _2: i32; // in scope 0 at $DIR/boxes.rs:12:13: 12:22
let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _4: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _4: usize; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _5: usize; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _6: *mut u8; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/boxes.rs:12:14: 12:22
scope 1 {
debug x => _1; // in scope 1 at $DIR/boxes.rs:12:9: 12:10
}
scope 2 {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/boxes.rs:12:9: 12:10
StorageLive(_2); // scope 0 at $DIR/boxes.rs:12:13: 12:22
StorageLive(_3); // scope 0 at $DIR/boxes.rs:12:14: 12:22
StorageLive(_4); // scope 0 at $DIR/boxes.rs:12:14: 12:22
_4 = Box(i32); // scope 0 at $DIR/boxes.rs:12:14: 12:22
(*_4) = const 42_i32; // scope 0 at $DIR/boxes.rs:12:19: 12:21
_3 = move _4; // scope 0 at $DIR/boxes.rs:12:14: 12:22
StorageDead(_4); // scope 0 at $DIR/boxes.rs:12:21: 12:22
- _4 = SizeOf(i32); // scope 2 at $DIR/boxes.rs:12:14: 12:22
- _5 = AlignOf(i32); // scope 2 at $DIR/boxes.rs:12:14: 12:22
- _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> bb1; // scope 2 at $DIR/boxes.rs:12:14: 12:22
+ _4 = const 4_usize; // scope 2 at $DIR/boxes.rs:12:14: 12:22
+ _5 = const 4_usize; // scope 2 at $DIR/boxes.rs:12:14: 12:22
+ _6 = alloc::alloc::exchange_malloc(const 4_usize, const 4_usize) -> bb1; // scope 2 at $DIR/boxes.rs:12:14: 12:22
// mir::Constant
// + span: $DIR/boxes.rs:12:14: 12:22
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageLive(_7); // scope 0 at $DIR/boxes.rs:12:14: 12:22
_7 = ShallowInitBox(move _6, i32); // scope 0 at $DIR/boxes.rs:12:14: 12:22
(*_7) = const 42_i32; // scope 0 at $DIR/boxes.rs:12:19: 12:21
_3 = move _7; // scope 0 at $DIR/boxes.rs:12:14: 12:22
StorageDead(_7); // scope 0 at $DIR/boxes.rs:12:21: 12:22
_2 = (*_3); // scope 0 at $DIR/boxes.rs:12:13: 12:22
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/boxes.rs:12:13: 12:26
StorageDead(_2); // scope 0 at $DIR/boxes.rs:12:25: 12:26
drop(_3) -> [return: bb
1, unwind: bb2
]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
drop(_3) -> [return: bb
2, unwind: bb3
]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
}
bb
1
: {
bb
2
: {
StorageDead(_3); // scope 0 at $DIR/boxes.rs:12:26: 12:27
nop; // scope 0 at $DIR/boxes.rs:11:11: 13:2
StorageDead(_1); // scope 0 at $DIR/boxes.rs:13:1: 13:2
return; // scope 0 at $DIR/boxes.rs:13:2: 13:2
}
bb
2
(cleanup): {
bb
3
(cleanup): {
resume; // scope 0 at $DIR/boxes.rs:11:1: 13:2
}
}
...
...
src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff
浏览文件 @
ab645809
...
...
@@ -4,23 +4,37 @@
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11
let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
let mut _2: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _3: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ let mut _4: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
let mut _2: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _3: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _4: *mut u8; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ let mut _7: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
scope 1 {
debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:8:9: 8:11
}
+ scope 2 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
scope 2 {
}
+ scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
+ }
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_2) = Vec::<u32>::new() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageLive(_4); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $DIR/inline-into-box-place.rs:8:33: 8:43
_2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
// mir::Constant
// + span: $DIR/inline-into-box-place.rs:8:29: 8:43
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageLive(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_5) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _7 = &mut (*_5); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_7).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ // ty::Const
+ // + ty: alloc::raw_vec::RawVec<u32>
+ // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } })
...
...
@@ -30,32 +44,32 @@
- // + literal: Const { ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}, val: Value(Scalar(<ZST>)) }
- }
-
- bb
1
: {
- bb
2
: {
+ // + span: $DIR/inline-into-box-place.rs:8:33: 8:43
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
+ ((*_
4).1: usize) = const 0_usize; // scope 2
at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageDead(_
4
); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
_1 = move _
2
; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_
2
); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ ((*_
7).1: usize) = const 0_usize; // scope 3
at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageDead(_
7
); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
_1 = move _
5
; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_
5
); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
_0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
- drop(_1) -> [return: bb
2, unwind: bb3
]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+ drop(_1) -> [return: bb
1, unwind: bb2
]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
- drop(_1) -> [return: bb
3, unwind: bb4
]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+ drop(_1) -> [return: bb
2, unwind: bb3
]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
}
- bb
2
: {
+ bb
1
: {
- bb
3
: {
+ bb
2
: {
StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
}
- bb
3
(cleanup): {
+ bb
2
(cleanup): {
- bb
4
(cleanup): {
+ bb
3
(cleanup): {
resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
- }
-
- bb
4
(cleanup): {
- _
3 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_2.1: std::alloc::Global)) -> bb3
; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- bb
5
(cleanup): {
- _
6 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_5.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_5.1: std::alloc::Global)) -> bb4
; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- // mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<std::vec::Vec<u32>, std::alloc::Global>}, val: Value(Scalar(<ZST>)) }
...
...
src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff
浏览文件 @
ab645809
...
...
@@ -4,23 +4,37 @@
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11
let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
let mut _2: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _3: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ let mut _4: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
let mut _2: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _3: usize; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _4: *mut u8; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ let mut _7: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
scope 1 {
debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:8:9: 8:11
}
+ scope 2 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
scope 2 {
}
+ scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
+ }
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
StorageLive(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_2 = Box(std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_2) = Vec::<u32>::new() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageLive(_4); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _4 = &mut (*_2); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 2 at $DIR/inline-into-box-place.rs:8:33: 8:43
_2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:8:29: 8:43
// mir::Constant
// + span: $DIR/inline-into-box-place.rs:8:29: 8:43
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageLive(_5); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
_5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
- (*_5) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ _7 = &mut (*_5); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ ((*_7).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: Unique::<u32> { pointer: {0x4 as *const u32}, _marker: PhantomData::<u32> }, cap: 0_usize, alloc: std::alloc::Global }; // scope 3 at $DIR/inline-into-box-place.rs:8:33: 8:43
+ // ty::Const
+ // + ty: alloc::raw_vec::RawVec<u32>
+ // + val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [65535], len: Size { raw: 16 } }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } })
...
...
@@ -30,32 +44,32 @@
- // + literal: Const { ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}, val: Value(Scalar(<ZST>)) }
- }
-
- bb
1
: {
- bb
2
: {
+ // + span: $DIR/inline-into-box-place.rs:8:33: 8:43
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [65535], len: Size { raw: 16 } }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
+ ((*_
4).1: usize) = const 0_usize; // scope 2
at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageDead(_
4
); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
_1 = move _
2
; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_
2
); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+ ((*_
7).1: usize) = const 0_usize; // scope 3
at $DIR/inline-into-box-place.rs:8:33: 8:43
+ StorageDead(_
7
); // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
_1 = move _
5
; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_
5
); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
_0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
- drop(_1) -> [return: bb
2, unwind: bb3
]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+ drop(_1) -> [return: bb
1, unwind: bb2
]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
- drop(_1) -> [return: bb
3, unwind: bb4
]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+ drop(_1) -> [return: bb
2, unwind: bb3
]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
}
- bb
2
: {
+ bb
1
: {
- bb
3
: {
+ bb
2
: {
StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
return; // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
}
- bb
3
(cleanup): {
+ bb
2
(cleanup): {
- bb
4
(cleanup): {
+ bb
3
(cleanup): {
resume; // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
- }
-
- bb
4
(cleanup): {
- _
3 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_2.1: std::alloc::Global)) -> bb3
; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- bb
5
(cleanup): {
- _
6 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_5.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_5.1: std::alloc::Global)) -> bb4
; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
- // mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<std::vec::Vec<u32>, std::alloc::Global>}, val: Value(Scalar(<ZST>)) }
...
...
src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir
浏览文件 @
ab645809
...
...
@@ -3,106 +3,120 @@
fn test() -> Option<Box<u32>> {
let mut _0: std::option::Option<std::boxed::Box<u32>>; // return place in scope 0 at $DIR/issue-62289.rs:8:14: 8:30
let mut _1: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _2: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _3: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
let mut _4: std::option::Option<u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:19
let mut _5: isize; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let _6: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let mut _7: !; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let mut _8: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let _9: u32; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
let mut _2: usize; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _3: usize; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _4: *mut u8; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _5: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
let mut _7: std::option::Option<u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:19
let mut _8: isize; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let _9: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let mut _10: !; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let mut _11: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
let _12: u32; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
scope 1 {
debug residual => _6; // in scope 1 at $DIR/issue-62289.rs:9:19: 9:20
scope 2 {
}
scope 2 {
debug residual => _9; // in scope 2 at $DIR/issue-62289.rs:9:19: 9:20
scope 3 {
}
}
scope
3
{
debug val => _
9; // in scope 3
at $DIR/issue-62289.rs:9:15: 9:20
scope
4
{
scope
4
{
debug val => _
12; // in scope 4
at $DIR/issue-62289.rs:9:15: 9:20
scope
5
{
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
StorageLive(_2); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
_2 = Box(u32); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
StorageLive(_3); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
StorageLive(_4); // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_4 = Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_3 = <Option<u32> as Try>::branch(move _4) -> [return: bb1, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
_2 = SizeOf(u32); // scope 1 at $DIR/issue-62289.rs:9:10: 9:21
_3 = AlignOf(u32); // scope 1 at $DIR/issue-62289.rs:9:10: 9:21
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 1 at $DIR/issue-62289.rs:9:10: 9:21
// mir::Constant
// + span: $DIR/issue-62289.rs:9:1
5: 9:20
// + literal: Const { ty:
fn(std::option::Option<u32>) -> std::ops::ControlFlow<<std::option::Option<u32> as std::ops::Try>::Residual, <std::option::Option<u32> as std::ops::Try>::Output> {<std::option::Option<u32> as std::ops::Try>::branch
}, val: Value(Scalar(<ZST>)) }
// + span: $DIR/issue-62289.rs:9:1
0: 9:21
// + literal: Const { ty:
unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc
}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageDead(_4); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_5 = discriminant(_3); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
StorageLive(_5); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
_5 = ShallowInitBox(move _4, u32); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
StorageLive(_6); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
StorageLive(_7); // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_7 = Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
_6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
// mir::Constant
// + span: $DIR/issue-62289.rs:9:15: 9:20
// + literal: Const { ty: fn(std::option::Option<u32>) -> std::ops::ControlFlow<<std::option::Option<u32> as std::ops::Try>::Residual, <std::option::Option<u32> as std::ops::Try>::Output> {<std::option::Option<u32> as std::ops::Try>::branch}, val: Value(Scalar(<ZST>)) }
}
bb2: {
StorageLive(_9); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
_9 = ((_3 as Continue).0: u32); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
(*_2) = _9; // scope 4 at $DIR/issue-62289.rs:9:15: 9:20
StorageDead(_9); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_1 = move _2; // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
drop(_2) -> [return: bb6, unwind: bb10]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
StorageDead(_7); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_8 = discriminant(_6); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
switchInt(move _8) -> [0_isize: bb3, 1_isize: bb5, otherwise: bb4]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
}
bb3: {
unreachable; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
StorageLive(_12); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
_12 = ((_6 as Continue).0: u32); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
(*_5) = _12; // scope 5 at $DIR/issue-62289.rs:9:15: 9:20
StorageDead(_12); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_1 = move _5; // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
drop(_5) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
}
bb4: {
StorageLive(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_6 = ((_3 as Break).0: std::option::Option<std::convert::Infallible>); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
StorageLive(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
_8 = _6; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
_0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _8) -> [return: bb5, unwind: bb11]; // scope 2 at $DIR/issue-62289.rs:9:15: 9:20
// mir::Constant
// + span: $DIR/issue-62289.rs:9:19: 9:20
// + literal: Const { ty: fn(std::option::Option<std::convert::Infallible>) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::FromResidual<std::option::Option<std::convert::Infallible>>>::from_residual}, val: Value(Scalar(<ZST>)) }
unreachable; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
}
bb5: {
StorageDead(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
StorageDead(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
drop(_2) -> bb8; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
StorageLive(_9); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
_9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
StorageLive(_11); // scope 3 at $DIR/issue-62289.rs:9:19: 9:20
_11 = _9; // scope 3 at $DIR/issue-62289.rs:9:19: 9:20
_0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; // scope 3 at $DIR/issue-62289.rs:9:15: 9:20
// mir::Constant
// + span: $DIR/issue-62289.rs:9:19: 9:20
// + literal: Const { ty: fn(std::option::Option<std::convert::Infallible>) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::FromResidual<std::option::Option<std::convert::Infallible>>>::from_residual}, val: Value(Scalar(<ZST>)) }
}
bb6: {
StorageDead(_
2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
_0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22
drop(_
1) -> bb7; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
StorageDead(_
11); // scope 3 at $DIR/issue-62289.rs:9:19: 9:20
StorageDead(_9); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
drop(_
5) -> bb9; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
}
bb7: {
StorageDead(_
1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:
2
goto -> bb9; // scope 0 at $DIR/issue-62289.rs:10:2: 10:
2
StorageDead(_
5); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
_0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:2
2
drop(_1) -> bb8; // scope 0 at $DIR/issue-62289.rs:9:21: 9:2
2
}
bb8: {
StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
StorageDead(_
3
); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
goto -> bb
9;
// scope 0 at $DIR/issue-62289.rs:10:2: 10:2
StorageDead(_
6
); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
goto -> bb
10;
// scope 0 at $DIR/issue-62289.rs:10:2: 10:2
}
bb9: {
return; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
StorageDead(_5); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
StorageDead(_6); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
goto -> bb10; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
}
bb10
(cleanup)
: {
drop(_1) -> bb12; // scope 0 at $DIR/issue-62289.rs:9:21: 9:2
2
bb10: {
return; // scope 0 at $DIR/issue-62289.rs:10:2: 10:
2
}
bb11 (cleanup): {
drop(_
2) -> bb12; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
drop(_
1) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
}
bb12 (cleanup): {
drop(_5) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
}
bb13 (cleanup): {
resume; // scope 0 at $DIR/issue-62289.rs:8:1: 10:2
}
}
src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir
浏览文件 @
ab645809
...
...
@@ -4,80 +4,108 @@ fn move_out_by_subslice() -> () {
let mut _0: (); // return place in scope 0 at $DIR/uniform_array_move_out.rs:10:27: 10:27
let _1: [std::boxed::Box<i32>; 2]; // in scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
let mut _2: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _4: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _5: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
scope 1 {
debug a => _1; // in scope 1 at $DIR/uniform_array_move_out.rs:11:9: 11:10
let _
6
: [std::boxed::Box<i32>; 2]; // in scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
scope
2
{
debug _y => _
6; // in scope 2
at $DIR/uniform_array_move_out.rs:12:10: 12:17
let _
12
: [std::boxed::Box<i32>; 2]; // in scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
scope
4
{
debug _y => _
12; // in scope 4
at $DIR/uniform_array_move_out.rs:12:10: 12:17
}
}
scope 2 {
}
scope 3 {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
StorageLive(_3); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
_3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
(*_3) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
_2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
drop(_3) -> [return: bb1, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
_3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:11:14: 11:19
_4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:11:14: 11:19
_5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:11:14: 11:19
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:11:14: 11:19
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageDead(_3); // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
StorageLive(_4); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
(*_5) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
_4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
drop(_5) -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
_6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
(*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
_2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
}
bb2: {
StorageDead(_5); // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
_1 = [move _2, move _4]; // scope 0 at $DIR/uniform_array_move_out.rs:11:13: 11:27
drop(_4) -> [return: bb3, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:11:21: 11:26
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:11:21: 11:26
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb3: {
StorageDead(_4); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
drop(_2) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
(*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
_7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
}
bb4: {
StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
_1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:11:13: 11:27
drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb5: {
StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb6: {
StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
StorageLive(_
6);
// scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
_
6 = move _1[0..2];
// scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
StorageLive(_
12);
// scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
_
12 = move _1[0..2];
// scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
_0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2
drop(_
6) -> [return: bb5, unwind: bb7
]; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
drop(_
12) -> [return: bb7, unwind: bb9
]; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb
5
: {
StorageDead(_
6);
// scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
drop(_1) -> [return: bb
6, unwind: bb10
]; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
bb
7
: {
StorageDead(_
12);
// scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
drop(_1) -> [return: bb
8, unwind: bb12
]; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb
6
: {
bb
8
: {
StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
return; // scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
}
bb
7
(cleanup): {
drop(_1) -> bb1
0
; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
bb
9
(cleanup): {
drop(_1) -> bb1
2
; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
}
bb
8
(cleanup): {
drop(_
4) -> bb9;
// scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
bb
10
(cleanup): {
drop(_
7) -> bb11;
// scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb
9
(cleanup): {
drop(_2) -> bb1
0
; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
bb
11
(cleanup): {
drop(_2) -> bb1
2
; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
}
bb1
0
(cleanup): {
bb1
2
(cleanup): {
resume; // scope 0 at $DIR/uniform_array_move_out.rs:10:1: 13:2
}
}
src/test/mir-opt/uniform_array_move_out.move_out_from_end.mir_map.0.mir
浏览文件 @
ab645809
...
...
@@ -4,80 +4,108 @@ fn move_out_from_end() -> () {
let mut _0: (); // return place in scope 0 at $DIR/uniform_array_move_out.rs:4:24: 4:24
let _1: [std::boxed::Box<i32>; 2]; // in scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
let mut _2: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _3: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _4: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _5: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
scope 1 {
debug a => _1; // in scope 1 at $DIR/uniform_array_move_out.rs:5:9: 5:10
let _
6: std::boxed::Box<i32>;
// in scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
scope
2
{
debug _y => _
6; // in scope 2
at $DIR/uniform_array_move_out.rs:6:14: 6:16
let _
12: std::boxed::Box<i32>;
// in scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
scope
4
{
debug _y => _
12; // in scope 4
at $DIR/uniform_array_move_out.rs:6:14: 6:16
}
}
scope 2 {
}
scope 3 {
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
StorageLive(_3); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
_3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
(*_3) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
_2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
drop(_3) -> [return: bb1, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
_3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
_4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
_5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:5:14: 5:19
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:5:14: 5:19
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: {
StorageDead(_3); // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
StorageLive(_4); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
(*_5) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
_4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
drop(_5) -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
_6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
(*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
_2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
}
bb2: {
StorageDead(_5); // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
_1 = [move _2, move _4]; // scope 0 at $DIR/uniform_array_move_out.rs:5:13: 5:27
drop(_4) -> [return: bb3, unwind: bb9]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:5:21: 5:26
// mir::Constant
// + span: $DIR/uniform_array_move_out.rs:5:21: 5:26
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb3: {
StorageDead(_4); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
drop(_2) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
(*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
_7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
}
bb4: {
StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
_1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:5:13: 5:27
drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb5: {
StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb6: {
StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
StorageLive(_
6);
// scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
_
6 = move _1[1 of 2];
// scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
StorageLive(_
12);
// scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
_
12 = move _1[1 of 2];
// scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
_0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2
drop(_
6) -> [return: bb5, unwind: bb7
]; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
drop(_
12) -> [return: bb7, unwind: bb9
]; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb
5
: {
StorageDead(_
6);
// scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
drop(_1) -> [return: bb
6, unwind: bb10
]; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
bb
7
: {
StorageDead(_
12);
// scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
drop(_1) -> [return: bb
8, unwind: bb12
]; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb
6
: {
bb
8
: {
StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
return; // scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
}
bb
7
(cleanup): {
drop(_1) -> bb1
0
; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
bb
9
(cleanup): {
drop(_1) -> bb1
2
; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
}
bb
8
(cleanup): {
drop(_
4) -> bb9;
// scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
bb
10
(cleanup): {
drop(_
7) -> bb11;
// scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb
9
(cleanup): {
drop(_2) -> bb1
0
; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
bb
11
(cleanup): {
drop(_2) -> bb1
2
; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
}
bb1
0
(cleanup): {
bb1
2
(cleanup): {
resume; // scope 0 at $DIR/uniform_array_move_out.rs:4:1: 7:2
}
}
src/test/ui/consts/miri_unleashed/box.rs
浏览文件 @
ab645809
...
...
@@ -9,5 +9,5 @@ fn main() {}
static
TEST_BAD
:
&
mut
i32
=
{
&
mut
*
(
box
0
)
//~^ ERROR could not evaluate static initializer
//~| NOTE
heap allocations
//~| NOTE
calling non-const function `alloc::alloc::exchange_malloc`
};
src/test/ui/consts/miri_unleashed/box.stderr
浏览文件 @
ab645809
...
...
@@ -2,7 +2,7 @@ error[E0080]: could not evaluate static initializer
--> $DIR/box.rs:10:11
|
LL | &mut *(box 0)
| ^^^^^^^
"heap allocations via `box` keyword" needs an rfc before being allowed inside constants
| ^^^^^^^
calling non-const function `alloc::alloc::exchange_malloc`
warning: skipping const checks
|
...
...
src/test/ui/nll/issue-52663-trait-object.stderr
浏览文件 @
ab645809
...
...
@@ -4,7 +4,7 @@ error[E0597]: `tmp0` does not live long enough
LL | let tmp1 = &tmp0;
| ^^^^^ borrowed value does not live long enough
LL | box tmp1 as Box<dyn Foo + '_>
| ----------------------------- borrow later
captured here by trait object
| ----------------------------- borrow later
used here
LL | };
| - `tmp0` dropped here while still borrowed
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录