Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ee0b5648
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,发现更多精彩内容 >>
提交
ee0b5648
编写于
2月 21, 2022
作者:
L
lcnr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change `mir::Constant` in mir dumps
上级
b8967b0d
变更
69
隐藏空白更改
内联
并排
Showing
69 changed file
with
107 addition
and
349 deletion
+107
-349
compiler/rustc_middle/src/mir/pretty.rs
compiler/rustc_middle/src/mir/pretty.rs
+23
-32
src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir
src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir
+1
-1
src/test/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir
...opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir
+0
-3
src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
...t/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
+1
-4
src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
...t/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
+1
-4
src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
.../mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
+1
-4
src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
.../mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
+1
-4
src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir
.../mir-opt/const_allocation3.main.ConstProp.after.32bit.mir
+0
-3
src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir
.../mir-opt/const_allocation3.main.ConstProp.after.64bit.mir
+0
-3
src/test/mir-opt/const_debuginfo.main.ConstDebugInfo.diff
src/test/mir-opt/const_debuginfo.main.ConstDebugInfo.diff
+0
-3
src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
...tic.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
+0
-3
src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
...r-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
+1
-6
src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
...tic.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
+0
-3
src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
...r-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
+1
-6
src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff
...op/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff
+1
-4
src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff
...op/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff
+1
-4
src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff
...onst_prop/const_prop_fails_gracefully.main.ConstProp.diff
+1
-4
src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff
...nst_prop/control_flow_simplification.hello.ConstProp.diff
+1
-4
src/test/mir-opt/const_prop/invalid_constant.main.ConstProp.diff
...t/mir-opt/const_prop/invalid_constant.main.ConstProp.diff
+4
-14
src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
...t/const_prop/mutable_variable_no_prop.main.ConstProp.diff
+0
-3
src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
...-opt/const_prop/read_immutable_static.main.ConstProp.diff
+0
-6
src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff
src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff
+1
-4
src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff
src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff
+1
-4
src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
.../mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
+1
-4
src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff
...r-opt/const_prop/ref_deref_project.main.PromoteTemps.diff
+1
-4
src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
...st/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
+1
-4
src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
...st/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
+1
-4
src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
...icate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
+1
-1
src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
...opt/funky_arms.float_to_exponential_common.ConstProp.diff
+4
-4
src/test/mir-opt/inline/cycle.f.Inline.diff
src/test/mir-opt/inline/cycle.f.Inline.diff
+1
-1
src/test/mir-opt/inline/inline_diverging.g.Inline.diff
src/test/mir-opt/inline/inline_diverging.g.Inline.diff
+1
-4
src/test/mir-opt/inline/inline_generator.main.Inline.diff
src/test/mir-opt/inline/inline_generator.main.Inline.diff
+3
-3
src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff
...r-opt/inline/inline_into_box_place.main.Inline.32bit.diff
+2
-5
src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff
...r-opt/inline/inline_into_box_place.main.Inline.64bit.diff
+2
-5
src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir
src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir
+2
-8
src/test/mir-opt/inline/inline_shims.clone.Inline.diff
src/test/mir-opt/inline/inline_shims.clone.Inline.diff
+1
-1
src/test/mir-opt/inline/inline_shims.drop.Inline.diff
src/test/mir-opt/inline/inline_shims.drop.Inline.diff
+2
-2
src/test/mir-opt/inline/inline_specialization.main.Inline.diff
...est/mir-opt/inline/inline_specialization.main.Inline.diff
+1
-1
src/test/mir-opt/inline/issue_78442.bar.Inline.diff
src/test/mir-opt/inline/issue_78442.bar.Inline.diff
+1
-1
src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff
src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff
+1
-1
src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir
src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir
+2
-2
src/test/mir-opt/issue_72181_1.main.mir_map.0.mir
src/test/mir-opt/issue_72181_1.main.mir_map.0.mir
+1
-1
src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff
src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff
+2
-8
src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff
src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff
+2
-8
src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff
...t/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff
+2
-11
src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff
...t/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff
+2
-11
src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
.../mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
+0
-3
src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir
...-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir
+2
-5
src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
...opt/issues/issue_75439.foo.MatchBranchSimplification.diff
+2
-2
src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
...ir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
+7
-16
src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
...st/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
+3
-3
src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir
...atch_false_edges.full_tested_match.PromoteTemps.after.mir
+1
-4
src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir
...tive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir
+1
-4
src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir
...o_spurious_drop_after_call.main.ElaborateDrops.before.mir
+2
-5
src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir
src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir
+1
-1
src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
...opt/remove_storage_markers.main.RemoveStorageMarkers.diff
+1
-1
src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir
...t/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir
+4
-7
src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
...re.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
+1
-1
src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
.../mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
+1
-4
src/test/mir-opt/simplify_locals.d2.SimplifyLocals.diff
src/test/mir-opt/simplify_locals.d2.SimplifyLocals.diff
+0
-6
src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir
...st/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir
+0
-3
src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
...in.SimplifyCfg-after-uninhabited-enum-branching.after.mir
+0
-9
src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
...habited_enum_branching.main.UninhabitedEnumBranching.diff
+0
-15
src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
...in.SimplifyCfg-after-uninhabited-enum-branching.after.mir
+0
-12
src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
...abited_enum_branching2.main.UninhabitedEnumBranching.diff
+0
-24
src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
...test/mir-opt/unreachable.main.UnreachablePropagation.diff
+1
-1
src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
...pt/unreachable_diverging.main.UnreachablePropagation.diff
+1
-1
src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir
...in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir
+1
-1
src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir
...in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir
+1
-1
未找到文件。
compiler/rustc_middle/src/mir/pretty.rs
浏览文件 @
ee0b5648
...
...
@@ -436,8 +436,7 @@ fn use_verbose<'tcx>(ty: Ty<'tcx>, fn_def: bool) -> bool {
}
impl
<
'tcx
>
Visitor
<
'tcx
>
for
ExtraComments
<
'tcx
>
{
fn
visit_constant
(
&
mut
self
,
constant
:
&
Constant
<
'tcx
>
,
location
:
Location
)
{
self
.super_constant
(
constant
,
location
);
fn
visit_constant
(
&
mut
self
,
constant
:
&
Constant
<
'tcx
>
,
_
location
:
Location
)
{
let
Constant
{
span
,
user_ty
,
literal
}
=
constant
;
if
use_verbose
(
literal
.ty
(),
true
)
{
self
.push
(
"mir::Constant"
);
...
...
@@ -448,38 +447,30 @@ fn visit_constant(&mut self, constant: &Constant<'tcx>, location: Location) {
if
let
Some
(
user_ty
)
=
user_ty
{
self
.push
(
&
format!
(
"+ user_ty: {:?}"
,
user_ty
));
}
match
literal
{
ConstantKind
::
Ty
(
literal
)
=>
self
.push
(
&
format!
(
"+ literal: {:?}"
,
literal
)),
ConstantKind
::
Val
(
val
,
ty
)
=>
{
// To keep the diffs small, we render this almost like we render ty::Const
self
.push
(
&
format!
(
"+ literal: Const {{ ty: {}, val: Value({:?}) }}"
,
ty
,
val
))
}
}
}
}
fn
visit_const
(
&
mut
self
,
constant
:
ty
::
Const
<
'tcx
>
,
_
:
Location
)
{
self
.super_const
(
constant
);
let
ty
=
constant
.ty
();
let
val
=
constant
.val
();
if
use_verbose
(
ty
,
false
)
{
self
.push
(
"ty::Const"
);
self
.push
(
&
format!
(
"+ ty: {:?}"
,
ty
));
let
val
=
match
val
{
ty
::
ConstKind
::
Param
(
p
)
=>
format!
(
"Param({})"
,
p
),
ty
::
ConstKind
::
Infer
(
infer
)
=>
format!
(
"Infer({:?})"
,
infer
),
ty
::
ConstKind
::
Bound
(
idx
,
var
)
=>
format!
(
"Bound({:?}, {:?})"
,
idx
,
var
),
ty
::
ConstKind
::
Placeholder
(
ph
)
=>
format!
(
"PlaceHolder({:?})"
,
ph
),
ty
::
ConstKind
::
Unevaluated
(
uv
)
=>
format!
(
"Unevaluated({}, {:?}, {:?})"
,
self
.tcx
.def_path_str
(
uv
.def.did
),
uv
.substs
,
uv
.promoted
,
),
ty
::
ConstKind
::
Value
(
val
)
=>
format!
(
"Value({:?})"
,
val
),
ty
::
ConstKind
::
Error
(
_
)
=>
"Error"
.to_string
(
),
let
val
=
match
literal
{
ConstantKind
::
Ty
(
ct
)
=>
match
ct
.val
()
{
ty
::
ConstKind
::
Param
(
p
)
=>
format!
(
"Param({})"
,
p
),
ty
::
ConstKind
::
Unevaluated
(
uv
)
=>
format!
(
"Unevaluated({}, {:?}, {:?})"
,
self
.tcx
.def_path_str
(
uv
.def.did
),
uv
.substs
,
uv
.promoted
,
),
ty
::
ConstKind
::
Value
(
val
)
=>
format!
(
"Value({:?})"
,
val
),
ty
::
ConstKind
::
Error
(
_
)
=>
"Error"
.to_string
(
),
// These variants shouldn't exist in the MIR.
ty
::
ConstKind
::
Placeholder
(
_
)
|
ty
::
ConstKind
::
Infer
(
_
)
|
ty
::
ConstKind
::
Bound
(
..
)
=>
bug!
(
"unexpected MIR constant: {:?}"
,
literal
),
}
,
// To keep the diffs small, we render this like we render `ty::Const::Value`.
//
// This changes once `ty::Const::Value` is represented using valtrees.
ConstantKind
::
Val
(
val
,
_
)
=>
format!
(
"Value({:?})"
,
val
),
};
self
.push
(
&
format!
(
"+ val: {}"
,
val
));
self
.push
(
&
format!
(
"+ literal: Const {{ ty: {}, val: {} }}"
,
literal
.ty
(),
val
));
}
}
...
...
src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir
浏览文件 @
ee0b5648
...
...
@@ -47,7 +47,7 @@ fn main() -> () {
_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>)) }
// + literal: Const { ty: fn(
Box<S>) {std::mem::drop::<
Box<S>>}, val: Value(Scalar(<ZST>)) }
}
bb4: {
...
...
src/test/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir
浏览文件 @
ee0b5648
...
...
@@ -14,9 +14,6 @@ fn main() -> () {
bb0: {
StorageLive(_1); // scope 0 at $DIR/byte_slice.rs:5:9: 5:10
_1 = const b"foo"; // scope 0 at $DIR/byte_slice.rs:5:13: 5:19
// ty::Const
// + ty: &[u8; 3]
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/byte_slice.rs:5:13: 5:19
// + literal: Const { ty: &[u8; 3], val: Value(Scalar(alloc1)) }
...
...
src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
浏览文件 @
ee0b5648
...
...
@@ -9,12 +9,9 @@ fn main() -> () {
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&str])]
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation.rs:8:5: 8:8
// + literal: Const { ty: &&[(
std::option::
Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
...
...
src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
浏览文件 @
ee0b5648
...
...
@@ -9,12 +9,9 @@ fn main() -> () {
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&str])]
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation.rs:8:5: 8:8
// + literal: Const { ty: &&[(
std::option::
Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
...
...
src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
浏览文件 @
ee0b5648
...
...
@@ -9,12 +9,9 @@ fn main() -> () {
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&u8])]
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation2.rs:5:5: 5:8
// + literal: Const { ty: &&[(
std::option::
Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
...
...
src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
浏览文件 @
ee0b5648
...
...
@@ -9,12 +9,9 @@ fn main() -> () {
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&u8])]
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation2.rs:5:5: 5:8
// + literal: Const { ty: &&[(
std::option::
Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
...
...
src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir
浏览文件 @
ee0b5648
...
...
@@ -9,9 +9,6 @@ fn main() -> () {
StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
// ty::Const
// + ty: &&Packed
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation3.rs:5:5: 5:8
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
...
...
src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir
浏览文件 @
ee0b5648
...
...
@@ -9,9 +9,6 @@ fn main() -> () {
StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
// ty::Const
// + ty: &&Packed
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation3.rs:5:5: 5:8
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
...
...
src/test/mir-opt/const_debuginfo.main.ConstDebugInfo.diff
浏览文件 @
ee0b5648
...
...
@@ -75,9 +75,6 @@
StorageDead(_5); // scope 3 at $DIR/const_debuginfo.rs:12:23: 12:24
StorageLive(_9); // scope 4 at $DIR/const_debuginfo.rs:14:9: 14:10
_9 = const "hello, world!"; // scope 4 at $DIR/const_debuginfo.rs:14:13: 14:28
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [8191], len: Size { raw: 13 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 13 })
// mir::Constant
// + span: $DIR/const_debuginfo.rs:14:13: 14:28
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [8191], len: Size { raw: 13 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 13 }) }
...
...
src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
浏览文件 @
ee0b5648
...
...
@@ -8,9 +8,6 @@ promoted[0] in BAR: &[&i32; 1] = {
bb0: {
_3 = const {alloc1: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
// ty::Const
// + ty: &i32
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
// + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
...
...
src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
浏览文件 @
ee0b5648
...
...
@@ -18,11 +18,6 @@
- StorageLive(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
- _5 = const {alloc1: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+ _6 = const BAR::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
// ty::Const
- // + ty: &i32
- // + val: Value(Scalar(alloc1))
+ // + ty: &[&i32; 1]
+ // + val: Unevaluated(BAR, [], Some(promoted[0]))
// mir::Constant
- // + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
- // + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
...
...
@@ -30,7 +25,7 @@
- _3 = [move _4]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- _2 = &_3; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
+ // + span: $DIR/const-promotion-extern-static.rs:9:31: 9:44
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:6 ~ const_promotion_extern_static[e01c]::BAR), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(
BAR, [], Some(promoted[0])
) }
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
- StorageDead(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:9:34: 9:35
...
...
src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
浏览文件 @
ee0b5648
...
...
@@ -8,9 +8,6 @@ promoted[0] in FOO: &[&i32; 1] = {
bb0: {
_3 = const {alloc3: *const i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
// ty::Const
// + ty: *const i32
// + val: Value(Scalar(alloc3))
// mir::Constant
// + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
// + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
...
...
src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
浏览文件 @
ee0b5648
...
...
@@ -20,11 +20,6 @@
- StorageLive(_5); // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
- _5 = const {alloc3: *const i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+ _6 = const FOO::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
// ty::Const
- // + ty: *const i32
- // + val: Value(Scalar(alloc3))
+ // + ty: &[&i32; 1]
+ // + val: Unevaluated(FOO, [], Some(promoted[0]))
// mir::Constant
- // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
- // + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
...
...
@@ -32,7 +27,7 @@
- _3 = [move _4]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
- _2 = &_3; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
+ // + span: $DIR/const-promotion-extern-static.rs:13:31: 13:55
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:7 ~ const_promotion_extern_static[e01c]::FOO), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(
FOO, [], Some(promoted[0])
) }
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
- StorageDead(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:13:45: 13:46
...
...
src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff
浏览文件 @
ee0b5648
...
...
@@ -26,12 +26,9 @@
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
_9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
// ty::Const
// + ty: &[i32; 3]
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[fbcf]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &[i32; 3], val: Unevaluated(
main, [], Some(promoted[0])
) }
_3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
_2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
_1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
...
...
src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff
浏览文件 @
ee0b5648
...
...
@@ -26,12 +26,9 @@
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
_9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
// ty::Const
// + ty: &[i32; 3]
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ bad_op_unsafe_oob_for_slices[fbcf]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &[i32; 3], val: Unevaluated(
main, [], Some(promoted[0])
) }
_3 = _9; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
_2 = &raw const (*_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
_1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
...
...
src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff
浏览文件 @
ee0b5648
...
...
@@ -17,12 +17,9 @@
StorageLive(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:30
StorageLive(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
_3 = const FOO; // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
// ty::Const
// + ty: &i32
// + val: Unevaluated(FOO, [], None)
// mir::Constant
// + span: $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:5 ~ const_prop_fails_gracefully[809a]::main::FOO), const_param_did: None }, substs: [], promoted: None }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
FOO, [], None
) }
_2 = &raw const (*_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
_1 = move _2 as usize (Misc); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:39
StorageDead(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:38: 7:39
...
...
src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff
浏览文件 @
ee0b5648
...
...
@@ -19,10 +19,7 @@
begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/std/src/panic.rs:LL:COL
// + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 })
// + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }
// mir::Constant
// + span: $SRC_DIR/std/src/panic.rs:LL:COL
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) }
...
...
src/test/mir-opt/const_prop/invalid_constant.main.ConstProp.diff
浏览文件 @
ee0b5648
...
...
@@ -26,37 +26,27 @@
StorageLive(_1); // scope 0 at $DIR/invalid_constant.rs:21:9: 21:22
- _1 = const { InvalidChar { int: 0x110001 } }; // scope 0 at $DIR/invalid_constant.rs:21:25: 21:64
+ _1 = const InvalidChar { int: 1114113_u32, chr: {transmute(0x00110001): char} }; // scope 0 at $DIR/invalid_constant.rs:21:25: 21:64
// ty::Const
// + ty: main::InvalidChar
- // + val: Unevaluated(main::{constant#0}, [main::InvalidChar], None)
+ // + val: Value(Scalar(0x00110001))
// mir::Constant
// + span: $DIR/invalid_constant.rs:21:25: 21:64
- // + literal: Const { ty:
main::InvalidChar, val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:7 ~ invalid_constant[726d]::main::{constant#0}), const_param_did: None }, substs: [main::InvalidChar], promoted: None }
) }
+ // + literal: Const { ty:
main::
InvalidChar, val: Value(Scalar(0x00110001)) }
- // + literal: Const { ty:
InvalidChar, val: Unevaluated(main::{constant#0}, [main::InvalidChar], None
) }
+ // + literal: Const { ty: InvalidChar, val: Value(Scalar(0x00110001)) }
StorageLive(_2); // scope 1 at $DIR/invalid_constant.rs:28:9: 28:21
StorageLive(_3); // scope 1 at $DIR/invalid_constant.rs:28:25: 28:46
(_3.0: u32) = const 4_u32; // scope 1 at $DIR/invalid_constant.rs:28:25: 28:46
- _2 = [move _3]; // scope 1 at $DIR/invalid_constant.rs:28:24: 28:47
+ _2 = [const InvalidTag { int: 4_u32, e: Scalar(0x00000004): E }]; // scope 1 at $DIR/invalid_constant.rs:28:24: 28:47
+ // ty::Const
+ // + ty: main::InvalidTag
+ // + val: Value(Scalar(0x00000004))
+ // mir::Constant
+ // + span: $DIR/invalid_constant.rs:28:24: 28:47
+ // + literal: Const { ty:
main::
InvalidTag, val: Value(Scalar(0x00000004)) }
+ // + literal: Const { ty: InvalidTag, val: Value(Scalar(0x00000004)) }
StorageDead(_3); // scope 1 at $DIR/invalid_constant.rs:28:46: 28:47
StorageLive(_4); // scope 2 at $DIR/invalid_constant.rs:35:9: 35:31
StorageLive(_5); // scope 2 at $DIR/invalid_constant.rs:35:35: 35:56
(_5.0: u32) = const 0_u32; // scope 2 at $DIR/invalid_constant.rs:35:35: 35:56
- _4 = [move _5]; // scope 2 at $DIR/invalid_constant.rs:35:34: 35:57
+ _4 = [const NoVariants { int: 0_u32, empty: Scalar(<ZST>): Empty }]; // scope 2 at $DIR/invalid_constant.rs:35:34: 35:57
+ // ty::Const
+ // + ty: main::NoVariants
+ // + val: Value(Scalar(0x00000000))
+ // mir::Constant
+ // + span: $DIR/invalid_constant.rs:35:34: 35:57
+ // + literal: Const { ty:
main::
NoVariants, val: Value(Scalar(0x00000000)) }
+ // + literal: Const { ty: NoVariants, val: Value(Scalar(0x00000000)) }
StorageDead(_5); // scope 2 at $DIR/invalid_constant.rs:35:56: 35:57
StorageLive(_6); // scope 3 at $DIR/invalid_constant.rs:39:9: 39:22
nop; // scope 0 at $DIR/invalid_constant.rs:15:11: 42:2
...
...
src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
浏览文件 @
ee0b5648
...
...
@@ -24,9 +24,6 @@
StorageLive(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
StorageLive(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
_4 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
// ty::Const
// + ty: *mut u32
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/mutable_variable_no_prop.rs:9:13: 9:19
// + literal: Const { ty: *mut u32, val: Value(Scalar(alloc1)) }
...
...
src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
浏览文件 @
ee0b5648
...
...
@@ -17,9 +17,6 @@
StorageLive(_2); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
StorageLive(_3); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
_3 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
// ty::Const
// + ty: &u8
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/read_immutable_static.rs:7:13: 7:16
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
...
...
@@ -28,9 +25,6 @@
StorageLive(_4); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
StorageLive(_5); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
_5 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
// ty::Const
// + ty: &u8
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/read_immutable_static.rs:7:19: 7:22
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
...
...
src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff
浏览文件 @
ee0b5648
...
...
@@ -12,12 +12,9 @@
StorageLive(_1); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
_4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
// ty::Const
// + ty: &i32
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/ref_deref.rs:5:6: 5:10
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ ref_deref[d561]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
main, [], Some(promoted[0])
) }
_2 = _4; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
- _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+ _1 = const 4_i32; // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
...
...
src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff
浏览文件 @
ee0b5648
...
...
@@ -15,12 +15,9 @@
- _3 = const 4_i32; // scope 0 at $DIR/ref_deref.rs:5:8: 5:9
- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+ // ty::Const
+ // + ty: &i32
+ // + val: Unevaluated(main, [], Some(promoted[0]))
+ // mir::Constant
+ // + span: $DIR/ref_deref.rs:5:6: 5:10
+ // + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ ref_deref[d561]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
+ // + literal: Const { ty: &i32, val: Unevaluated(
main, [], Some(promoted[0])
) }
+ _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
_1 = (*_2); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
- StorageDead(_3); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
...
...
src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
浏览文件 @
ee0b5648
...
...
@@ -12,12 +12,9 @@
StorageLive(_1); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
StorageLive(_2); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
_4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
// ty::Const
// + ty: &(i32, i32)
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/ref_deref_project.rs:5:6: 5:17
// + literal: Const { ty: &(i32, i32), val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[d1f7]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &(i32, i32), val: Unevaluated(
main, [], Some(promoted[0])
) }
_2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
_1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
StorageDead(_2); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
...
...
src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff
浏览文件 @
ee0b5648
...
...
@@ -15,12 +15,9 @@
- _3 = (const 4_i32, const 5_i32); // scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
- _2 = &(_3.1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+ // ty::Const
+ // + ty: &(i32, i32)
+ // + val: Unevaluated(main, [], Some(promoted[0]))
+ // mir::Constant
+ // + span: $DIR/ref_deref_project.rs:5:6: 5:17
+ // + literal: Const { ty: &(i32, i32), val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[d1f7]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
+ // + literal: Const { ty: &(i32, i32), val: Unevaluated(
main, [], Some(promoted[0])
) }
+ _2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
_1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
- StorageDead(_3); // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
...
...
src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
浏览文件 @
ee0b5648
...
...
@@ -20,12 +20,9 @@
StorageLive(_3); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
_9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
// ty::Const
// + ty: &[u32; 3]
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/slice_len.rs:5:6: 5:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ slice_len[7261]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &[u32; 3], val: Unevaluated(
main, [], Some(promoted[0])
) }
_4 = _9; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
_3 = _4; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
StorageLive(_10); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
...
...
src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
浏览文件 @
ee0b5648
...
...
@@ -20,12 +20,9 @@
StorageLive(_3); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
_9 = const main::promoted[0]; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
// ty::Const
// + ty: &[u32; 3]
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/slice_len.rs:5:6: 5:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ slice_len[7261]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &[u32; 3], val: Unevaluated(
main, [], Some(promoted[0])
) }
_4 = _9; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
_3 = _4; // scope 0 at $DIR/slice_len.rs:5:6: 5:19
StorageLive(_10); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
...
...
src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
浏览文件 @
ee0b5648
...
...
@@ -27,7 +27,7 @@
+ _2 = transmute::<&str, &[u8]>(move _8) -> bb12; // scope 2 at $DIR/deduplicate_blocks.rs:3:11: 3:23
// mir::Constant
// + span: $DIR/deduplicate_blocks.rs:3:11: 3:23
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&str) -> &[u8] {
std::intrinsics::
transmute::<&str, &[u8]>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&str) -> &[u8] {transmute::<&str, &[u8]>}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
浏览文件 @
ee0b5648
...
...
@@ -41,7 +41,7 @@
_4 = Formatter::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:15:22: 15:37
// mir::Constant
// + span: $DIR/funky_arms.rs:15:26: 15:35
// + literal: Const { ty: for<'r> fn(&'r
std::fmt::Formatter) -> bool {std::fmt::
Formatter::sign_plus}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r> fn(&'r
Formatter) -> bool {
Formatter::sign_plus}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
@@ -67,7 +67,7 @@
_7 = Formatter::precision(move _8) -> bb5; // scope 2 at $DIR/funky_arms.rs:24:30: 24:45
// mir::Constant
// + span: $DIR/funky_arms.rs:24:34: 24:43
// + literal: Const { ty: for<'r> fn(&'r
std::fmt::Formatter) -> std::option::Option<usize> {std::fmt::
Formatter::precision}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r> fn(&'r
Formatter) -> Option<usize> {
Formatter::precision}, val: Value(Scalar(<ZST>)) }
}
bb5: {
...
...
@@ -98,7 +98,7 @@
_0 = float_to_exponential_common_exact::<T>(move _11, move _12, move _13, move _14, move _17) -> bb7; // scope 2 at $DIR/funky_arms.rs:26:9: 26:87
// mir::Constant
// + span: $DIR/funky_arms.rs:26:9: 26:42
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut
std::fmt::Formatter<'s>, &'t0 T, core::num::flt2dec::Sign, u32, bool) -> std::result::
Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut
Formatter<'s>, &'t0 T, Sign, u32, bool) ->
Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(Scalar(<ZST>)) }
}
bb7: {
...
...
@@ -123,7 +123,7 @@
_0 = float_to_exponential_common_shortest::<T>(move _18, move _19, move _20, move _21) -> bb9; // scope 2 at $DIR/funky_arms.rs:28:9: 28:68
// mir::Constant
// + span: $DIR/funky_arms.rs:28:9: 28:45
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut
std::fmt::Formatter<'s>, &'t0 T, core::num::flt2dec::Sign, bool) -> std::result::
Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut
Formatter<'s>, &'t0 T, Sign, bool) ->
Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(Scalar(<ZST>)) }
}
bb9: {
...
...
src/test/mir-opt/inline/cycle.f.Inline.diff
浏览文件 @
ee0b5648
...
...
@@ -16,7 +16,7 @@
_2 = <impl Fn() as Fn<()>>::call(move _3, move _4) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/cycle.rs:6:5: 6:8
// mir::Constant
// + span: $DIR/cycle.rs:6:5: 6:6
// + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as
std::ops::FnOnce<()>>::Output {<impl Fn() as std::ops::
Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as
FnOnce<()>>::Output {<impl Fn() as
Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
src/test/mir-opt/inline/inline_diverging.g.Inline.diff
浏览文件 @
ee0b5648
...
...
@@ -40,10 +40,7 @@
- // + span: $DIR/inline-diverging.rs:16:9: 16:14
- // + literal: Const { ty: fn() -> ! {panic}, val: Value(Scalar(<ZST>)) }
+ // + span: $DIR/inline-diverging.rs:16:9: 16:16
+ // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }
+ // ty::Const
+ // + ty: &str
+ // + val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 })
+ // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }
+ // mir::Constant
+ // + span: $DIR/inline-diverging.rs:16:9: 16:16
+ // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) }
...
...
src/test/mir-opt/inline/inline_generator.main.Inline.diff
浏览文件 @
ee0b5648
...
...
@@ -40,7 +40,7 @@
- _4 = g() -> bb1; // scope 0 at $DIR/inline-generator.rs:9:28: 9:31
- // mir::Constant
- // + span: $DIR/inline-generator.rs:9:28: 9:29
- // + literal: Const { ty: fn() -> impl
std::ops::
Generator<bool> {g}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: fn() -> impl Generator<bool> {g}, val: Value(Scalar(<ZST>)) }
- }
-
- bb1: {
...
...
@@ -50,7 +50,7 @@
- // mir::Constant
- // + span: $DIR/inline-generator.rs:9:14: 9:22
- // + user_ty: UserType(0)
- // + literal: Const { ty: fn(&mut impl
std::ops::Generator<bool>) -> std::pin::Pin<&mut impl std::ops::Generator<bool>> {std::pin::Pin::<&mut impl std::ops::
Generator<bool>>::new}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: fn(&mut impl
Generator<bool>) -> Pin<&mut impl Generator<bool>> {Pin::<&mut impl
Generator<bool>>::new}, val: Value(Scalar(<ZST>)) }
- }
-
- bb2: {
...
...
@@ -65,7 +65,7 @@
- _1 = <impl Generator<bool> as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
- // mir::Constant
- // + span: $DIR/inline-generator.rs:9:33: 9:39
- // + literal: Const { ty: for<'r> fn(
std::pin::Pin<&'r mut impl std::ops::Generator<bool>>, bool) -> std::ops::GeneratorState<<impl std::ops::Generator<bool> as std::ops::Generator<bool>>::Yield, <impl std::ops::Generator<bool> as std::ops::Generator<bool>>::Return> {<impl std::ops::Generator<bool> as std::ops::
Generator<bool>>::resume}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: for<'r> fn(
Pin<&'r mut impl Generator<bool>>, bool) -> GeneratorState<<impl Generator<bool> as Generator<bool>>::Yield, <impl Generator<bool> as Generator<bool>>::Return> {<impl Generator<bool> as
Generator<bool>>::resume}, val: Value(Scalar(<ZST>)) }
+ StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ _7 = const false; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
...
...
src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff
浏览文件 @
ee0b5648
...
...
@@ -35,13 +35,10 @@
+ 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 } })
// mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:33: 8:41
- // + user_ty: UserType(1)
- // + literal: Const { ty: fn() ->
std::vec::Vec<u32> {std::vec::
Vec::<u32>::new}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: fn() ->
Vec<u32> {
Vec::<u32>::new}, val: Value(Scalar(<ZST>)) }
- }
-
- bb2: {
...
...
@@ -72,7 +69,7 @@
- _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>)) }
- // + literal: Const { ty: unsafe fn(
Unique<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<
Vec<u32>, std::alloc::Global>}, val: Value(Scalar(<ZST>)) }
}
}
src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff
浏览文件 @
ee0b5648
...
...
@@ -35,13 +35,10 @@
+ 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 } })
// mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:33: 8:41
- // + user_ty: UserType(1)
- // + literal: Const { ty: fn() ->
std::vec::Vec<u32> {std::vec::
Vec::<u32>::new}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: fn() ->
Vec<u32> {
Vec::<u32>::new}, val: Value(Scalar(<ZST>)) }
- }
-
- bb2: {
...
...
@@ -72,7 +69,7 @@
- _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>)) }
- // + literal: Const { ty: unsafe fn(
Unique<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<
Vec<u32>, std::alloc::Global>}, val: Value(Scalar(<ZST>)) }
}
}
src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir
浏览文件 @
ee0b5648
...
...
@@ -33,12 +33,9 @@ fn bar() -> bool {
StorageLive(_3); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
StorageLive(_4); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
_10 = const bar::promoted[1]; // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
// ty::Const
// + ty: &i32
// + val: Unevaluated(bar, [], Some(promoted[1]))
// mir::Constant
// + span: $DIR/inline-retag.rs:12:7: 12:9
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:4 ~ inline_retag[86d7]::bar), const_param_did: None }, substs: [], promoted: Some(promoted[1]) }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
bar, [], Some(promoted[1])
) }
Retag(_10); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
_4 = &(*_10); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
Retag(_4); // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
...
...
@@ -47,12 +44,9 @@ fn bar() -> bool {
StorageLive(_6); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
StorageLive(_7); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
_9 = const bar::promoted[0]; // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
// ty::Const
// + ty: &i32
// + val: Unevaluated(bar, [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/inline-retag.rs:12:11: 12:14
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:4 ~ inline_retag[86d7]::bar), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
bar, [], Some(promoted[0])
) }
Retag(_9); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
_7 = &(*_9); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
Retag(_7); // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
...
...
src/test/mir-opt/inline/inline_shims.clone.Inline.diff
浏览文件 @
ee0b5648
...
...
@@ -14,7 +14,7 @@
- _0 = <fn(A, B) as Clone>::clone(move _2) -> bb1; // scope 0 at $DIR/inline-shims.rs:6:5: 6:14
- // mir::Constant
- // + span: $DIR/inline-shims.rs:6:7: 6:12
- // + literal: Const { ty: for<'r> fn(&'r fn(A, B)) -> fn(A, B) {<fn(A, B) as
std::clone::
Clone>::clone}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: for<'r> fn(&'r fn(A, B)) -> fn(A, B) {<fn(A, B) as Clone>::clone}, val: Value(Scalar(<ZST>)) }
- }
-
- bb1: {
...
...
src/test/mir-opt/inline/inline_shims.drop.Inline.diff
浏览文件 @
ee0b5648
...
...
@@ -24,7 +24,7 @@
_3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> bb1; // scope 1 at $DIR/inline-shims.rs:11:14: 11:40
// mir::Constant
// + span: $DIR/inline-shims.rs:11:14: 11:37
// + literal: Const { ty: unsafe fn(*mut
std::vec::Vec<A>) {std::ptr::drop_in_place::<std::vec::
Vec<A>>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: unsafe fn(*mut
Vec<A>) {std::ptr::drop_in_place::<
Vec<A>>}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
@@ -35,7 +35,7 @@
- _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> bb2; // scope 2 at $DIR/inline-shims.rs:12:14: 12:40
- // mir::Constant
- // + span: $DIR/inline-shims.rs:12:14: 12:37
- // + literal: Const { ty: unsafe fn(*mut
std::option::Option<B>) {std::ptr::drop_in_place::<std::option::
Option<B>>}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: unsafe fn(*mut
Option<B>) {std::ptr::drop_in_place::<
Option<B>>}, val: Value(Scalar(<ZST>)) }
+ StorageLive(_6); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40
+ StorageLive(_7); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40
+ _6 = discriminant((*_5)); // scope 3 at $DIR/inline-shims.rs:12:14: 12:40
...
...
src/test/mir-opt/inline/inline_specialization.main.Inline.diff
浏览文件 @
ee0b5648
...
...
@@ -15,7 +15,7 @@
- _1 = <Vec<()> as Foo>::bar() -> bb1; // scope 0 at $DIR/inline-specialization.rs:5:13: 5:38
- // mir::Constant
- // + span: $DIR/inline-specialization.rs:5:13: 5:36
- // + literal: Const { ty: fn() -> u32 {<
std::vec::
Vec<()> as Foo>::bar}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: fn() -> u32 {<Vec<()> as Foo>::bar}, val: Value(Scalar(<ZST>)) }
- }
-
- bb1: {
...
...
src/test/mir-opt/inline/issue_78442.bar.Inline.diff
浏览文件 @
ee0b5648
...
...
@@ -28,7 +28,7 @@
- _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
- // mir::Constant
- // + span: $DIR/issue-78442.rs:11:5: 11:15
- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as
std::ops::FnOnce<()>>::Output {<impl Fn() as std::ops::
Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as
FnOnce<()>>::Output {<impl Fn() as
Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
+ _2 = move (*_3)() -> [return: bb5, unwind: bb3]; // scope 1 at $DIR/issue-78442.rs:11:5: 11:17
}
...
...
src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff
浏览文件 @
ee0b5648
...
...
@@ -28,7 +28,7 @@
_2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
// mir::Constant
// + span: $DIR/issue-78442.rs:11:5: 11:15
// + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as
std::ops::FnOnce<()>>::Output {<impl Fn() as std::ops::
Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as
FnOnce<()>>::Output {<impl Fn() as
Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
}
bb2: {
...
...
src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir
浏览文件 @
ee0b5648
...
...
@@ -46,7 +46,7 @@ fn test() -> Option<Box<u32>> {
_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>)) }
// + literal: Const { ty: fn(
Option<u32>) -> ControlFlow<<Option<u32> as Try>::Residual, <Option<u32> as Try>::Output> {<Option<u32> as
Try>::branch}, val: Value(Scalar(<ZST>)) }
}
bb2: {
...
...
@@ -76,7 +76,7 @@ fn test() -> Option<Box<u32>> {
_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>)) }
// + literal: Const { ty: fn(
Option<Infallible>) -> Option<Box<u32>> {<Option<Box<u32>> as FromResidual<Option<
Infallible>>>::from_residual}, val: Value(Scalar(<ZST>)) }
}
bb6: {
...
...
src/test/mir-opt/issue_72181_1.main.mir_map.0.mir
浏览文件 @
ee0b5648
...
...
@@ -24,7 +24,7 @@ fn main() -> () {
_2 = transmute::<(), Void>(move _3) -> [return: bb1, unwind: bb4]; // scope 2 at $DIR/issue-72181-1.rs:17:9: 17:44
// mir::Constant
// + span: $DIR/issue-72181-1.rs:17:9: 17:40
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(()) -> Void {
std::intrinsics::
transmute::<(), Void>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(()) -> Void {transmute::<(), Void>}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff
浏览文件 @
ee0b5648
...
...
@@ -61,12 +61,9 @@
_7 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_20 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// ty::Const
// + ty: &i32
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ issue_73223[9565]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
main, [], Some(promoted[0])
) }
_8 = _20; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_6.0: &i32) = move _7; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_6.1: &i32) = move _8; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
...
...
@@ -103,10 +100,7 @@
core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, std::option::Option<std::fmt::Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: core::panicking::AssertKind
// + val: Value(Scalar(0x00))
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
...
...
src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff
浏览文件 @
ee0b5648
...
...
@@ -61,12 +61,9 @@
_7 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_20 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// ty::Const
// + ty: &i32
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ issue_73223[9565]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
main, [], Some(promoted[0])
) }
_8 = _20; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_6.0: &i32) = move _7; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_6.1: &i32) = move _8; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
...
...
@@ -103,10 +100,7 @@
core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, std::option::Option<std::fmt::Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: core::panicking::AssertKind
// + val: Value(Scalar(0x00))
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
...
...
src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff
浏览文件 @
ee0b5648
...
...
@@ -82,12 +82,9 @@
_10 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_28 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// ty::Const
// + ty: &i32
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ issue_73223[9565]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
main, [], Some(promoted[0])
) }
_11 = _28; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_9.0: &i32) = move _10; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_9.1: &i32) = move _11; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
...
...
@@ -117,9 +114,6 @@
StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_22 = const core::panicking::AssertKind::Eq; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// ty::Const
// + ty: core::panicking::AssertKind
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
...
...
@@ -136,10 +130,7 @@
core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, std::option::Option<std::fmt::Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: core::panicking::AssertKind
// + val: Value(Scalar(0x00))
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
...
...
src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff
浏览文件 @
ee0b5648
...
...
@@ -82,12 +82,9 @@
_10 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_28 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// ty::Const
// + ty: &i32
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ issue_73223[9565]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
main, [], Some(promoted[0])
) }
_11 = _28; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_9.0: &i32) = move _10; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_9.1: &i32) = move _11; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
...
...
@@ -117,9 +114,6 @@
StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_22 = const core::panicking::AssertKind::Eq; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// ty::Const
// + ty: core::panicking::AssertKind
// + val: Value(Scalar(0x00))
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
...
...
@@ -136,10 +130,7 @@
core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, std::option::Option<std::fmt::Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: core::panicking::AssertKind
// + val: Value(Scalar(0x00))
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(Scalar(<ZST>)) }
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
...
...
src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
浏览文件 @
ee0b5648
...
...
@@ -71,9 +71,6 @@
// mir::Constant
// + span: $SRC_DIR/core/src/panic.rs:LL:COL
// + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [105, 110, 116, 101, 114, 110, 97, 108, 32, 101, 114, 114, 111, 114, 58, 32, 101, 110, 116, 101, 114, 101, 100, 32, 117, 110, 114, 101, 97, 99, 104, 97, 98, 108, 101, 32, 99, 111, 100, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1099511627775], len: Size { raw: 40 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 40 })
// mir::Constant
// + span: $SRC_DIR/core/src/panic.rs:LL:COL
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [105, 110, 116, 101, 114, 110, 97, 108, 32, 101, 114, 114, 111, 114, 58, 32, 101, 110, 116, 101, 114, 101, 100, 32, 117, 110, 114, 101, 97, 99, 104, 97, 98, 108, 101, 32, 99, 111, 100, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1099511627775], len: Size { raw: 40 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 40 }) }
...
...
src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir
浏览文件 @
ee0b5648
...
...
@@ -39,7 +39,7 @@ fn num_to_digit(_1: char) -> u32 {
_7 = char::methods::<impl char>::to_digit(move _8, const 8_u32) -> bb5; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23
// mir::Constant
// + span: $DIR/issue-59352.rs:14:8: 14:23
// + literal: Const { ty: fn(char, u32) ->
std::option::Option<u32> {std::
char::methods::<impl char>::to_digit}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: fn(char, u32) ->
Option<u32> {
char::methods::<impl char>::to_digit}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
@@ -50,7 +50,7 @@ fn num_to_digit(_1: char) -> u32 {
_3 = char::methods::<impl char>::to_digit(move _4, const 8_u32) -> bb2; // scope 0 at $DIR/issue-59352.rs:14:26: 14:41
// mir::Constant
// + span: $DIR/issue-59352.rs:14:30: 14:38
// + literal: Const { ty: fn(char, u32) ->
std::option::Option<u32> {std::
char::methods::<impl char>::to_digit}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: fn(char, u32) ->
Option<u32> {
char::methods::<impl char>::to_digit}, val: Value(Scalar(<ZST>)) }
}
bb2: {
...
...
@@ -90,9 +90,6 @@ fn num_to_digit(_1: char) -> u32 {
// mir::Constant
// + span: $DIR/issue-59352.rs:14:26: 14:50
// + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [99, 97, 108, 108, 101, 100, 32, 96, 79, 112, 116, 105, 111, 110, 58, 58, 117, 110, 119, 114, 97, 112, 40, 41, 96, 32, 111, 110, 32, 97, 32, 96, 78, 111, 110, 101, 96, 32, 118, 97, 108, 117, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [8796093022207], len: Size { raw: 43 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 43 })
// mir::Constant
// + span: $DIR/issue-59352.rs:14:26: 14:50
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [99, 97, 108, 108, 101, 100, 32, 96, 79, 112, 116, 105, 111, 110, 58, 58, 117, 110, 119, 114, 97, 112, 40, 41, 96, 32, 111, 110, 32, 97, 32, 96, 78, 111, 110, 101, 96, 32, 118, 97, 108, 117, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [8796093022207], len: Size { raw: 43 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 43 }) }
...
...
src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
浏览文件 @
ee0b5648
...
...
@@ -27,7 +27,7 @@
_2 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue-75439.rs:7:37: 7:53
// mir::Constant
// + span: $DIR/issue-75439.rs:7:37: 7:46
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn([u8; 16]) -> [u32; 4] {
std::intrinsics::
transmute::<[u8; 16], [u32; 4]>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn([u8; 16]) -> [u32; 4] {transmute::<[u8; 16], [u32; 4]>}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
@@ -50,7 +50,7 @@
_5 = transmute::<u32, [u8; 4]>(move _6) -> bb7; // scope 4 at $DIR/issue-75439.rs:10:23: 10:36
// mir::Constant
// + span: $DIR/issue-75439.rs:10:23: 10:32
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32) -> [u8; 4] {
std::intrinsics::
transmute::<u32, [u8; 4]>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32) -> [u8; 4] {transmute::<u32, [u8; 4]>}, val: Value(Scalar(<ZST>)) }
}
bb5: {
...
...
src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
浏览文件 @
ee0b5648
...
...
@@ -32,7 +32,7 @@
- _2 = discriminant_value::<T>(move _3) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:74:5: 74:45
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:74:5: 74:41
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r T) -> <T as
std::marker::DiscriminantKind>::Discriminant {std::intrinsics::
discriminant_value::<T>}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r T) -> <T as
DiscriminantKind>::Discriminant {
discriminant_value::<T>}, val: Value(Scalar(<ZST>)) }
+ _2 = discriminant((*_3)); // scope 0 at $DIR/lower_intrinsics.rs:74:5: 74:45
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:74:5: 74:45
}
...
...
@@ -45,18 +45,15 @@
StorageLive(_6); // scope 0 at $DIR/lower_intrinsics.rs:75:42: 75:44
StorageLive(_7); // scope 0 at $DIR/lower_intrinsics.rs:75:42: 75:44
_19 = const discriminant::<T>::promoted[2]; // scope 0 at $DIR/lower_intrinsics.rs:75:42: 75:44
// ty::Const
// + ty: &i32
// + val: Unevaluated(discriminant, [T], Some(promoted[2]))
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:75:42: 75:44
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:29 ~ lower_intrinsics[49eb]::discriminant), const_param_did: None }, substs: [T], promoted: Some(promoted[2]) }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
discriminant, [T], Some(promoted[2])
) }
_7 = &(*_19); // scope 0 at $DIR/lower_intrinsics.rs:75:42: 75:44
_6 = &(*_7); // scope 0 at $DIR/lower_intrinsics.rs:75:42: 75:44
- _5 = discriminant_value::<i32>(move _6) -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:75:5: 75:45
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:75:5: 75:41
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r i32) -> <i32 as
std::marker::DiscriminantKind>::Discriminant {std::intrinsics::
discriminant_value::<i32>}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r i32) -> <i32 as
DiscriminantKind>::Discriminant {
discriminant_value::<i32>}, val: Value(Scalar(<ZST>)) }
+ _5 = discriminant((*_6)); // scope 0 at $DIR/lower_intrinsics.rs:75:5: 75:45
+ goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:75:5: 75:45
}
...
...
@@ -69,18 +66,15 @@
StorageLive(_10); // scope 0 at $DIR/lower_intrinsics.rs:76:42: 76:45
StorageLive(_11); // scope 0 at $DIR/lower_intrinsics.rs:76:42: 76:45
_18 = const discriminant::<T>::promoted[1]; // scope 0 at $DIR/lower_intrinsics.rs:76:42: 76:45
// ty::Const
// + ty: &()
// + val: Unevaluated(discriminant, [T], Some(promoted[1]))
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:76:42: 76:45
// + literal: Const { ty: &(), val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:29 ~ lower_intrinsics[49eb]::discriminant), const_param_did: None }, substs: [T], promoted: Some(promoted[1]) }
) }
// + literal: Const { ty: &(), val: Unevaluated(
discriminant, [T], Some(promoted[1])
) }
_11 = &(*_18); // scope 0 at $DIR/lower_intrinsics.rs:76:42: 76:45
_10 = &(*_11); // scope 0 at $DIR/lower_intrinsics.rs:76:42: 76:45
- _9 = discriminant_value::<()>(move _10) -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:76:5: 76:46
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:76:5: 76:41
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r ()) -> <() as
std::marker::DiscriminantKind>::Discriminant {std::intrinsics::
discriminant_value::<()>}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r ()) -> <() as
DiscriminantKind>::Discriminant {
discriminant_value::<()>}, val: Value(Scalar(<ZST>)) }
+ _9 = discriminant((*_10)); // scope 0 at $DIR/lower_intrinsics.rs:76:5: 76:46
+ goto -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:76:5: 76:46
}
...
...
@@ -93,18 +87,15 @@
StorageLive(_14); // scope 0 at $DIR/lower_intrinsics.rs:77:42: 77:47
StorageLive(_15); // scope 0 at $DIR/lower_intrinsics.rs:77:42: 77:47
_17 = const discriminant::<T>::promoted[0]; // scope 0 at $DIR/lower_intrinsics.rs:77:42: 77:47
// ty::Const
// + ty: &E
// + val: Unevaluated(discriminant, [T], Some(promoted[0]))
// mir::Constant
// + span: $DIR/lower_intrinsics.rs:77:42: 77:47
// + literal: Const { ty: &E, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:29 ~ lower_intrinsics[49eb]::discriminant), const_param_did: None }, substs: [T], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &E, val: Unevaluated(
discriminant, [T], Some(promoted[0])
) }
_15 = &(*_17); // scope 0 at $DIR/lower_intrinsics.rs:77:42: 77:47
_14 = &(*_15); // scope 0 at $DIR/lower_intrinsics.rs:77:42: 77:47
- _13 = discriminant_value::<E>(move _14) -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:77:5: 77:48
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:77:5: 77:41
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r E) -> <E as
std::marker::DiscriminantKind>::Discriminant {std::intrinsics::
discriminant_value::<E>}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r E) -> <E as
DiscriminantKind>::Discriminant {
discriminant_value::<E>}, val: Value(Scalar(<ZST>)) }
+ _13 = discriminant((*_14)); // scope 0 at $DIR/lower_intrinsics.rs:77:5: 77:48
+ goto -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:77:5: 77:48
}
...
...
src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
浏览文件 @
ee0b5648
...
...
@@ -33,7 +33,7 @@
- _3 = wrapping_add::<T>(move _4, move _5) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:7:14: 7:50
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:7:14: 7:44
- // + literal: Const { ty: extern "rust-intrinsic" fn(T, T) -> T {
std::intrinsics::
wrapping_add::<T>}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: extern "rust-intrinsic" fn(T, T) -> T {wrapping_add::<T>}, val: Value(Scalar(<ZST>)) }
+ _3 = Add(move _4, move _5); // scope 0 at $DIR/lower_intrinsics.rs:7:14: 7:50
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:7:14: 7:50
}
...
...
@@ -49,7 +49,7 @@
- _6 = wrapping_sub::<T>(move _7, move _8) -> bb2; // scope 1 at $DIR/lower_intrinsics.rs:8:14: 8:50
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:8:14: 8:44
- // + literal: Const { ty: extern "rust-intrinsic" fn(T, T) -> T {
std::intrinsics::
wrapping_sub::<T>}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: extern "rust-intrinsic" fn(T, T) -> T {wrapping_sub::<T>}, val: Value(Scalar(<ZST>)) }
+ _6 = Sub(move _7, move _8); // scope 1 at $DIR/lower_intrinsics.rs:8:14: 8:50
+ goto -> bb2; // scope 1 at $DIR/lower_intrinsics.rs:8:14: 8:50
}
...
...
@@ -65,7 +65,7 @@
- _9 = wrapping_mul::<T>(move _10, move _11) -> bb3; // scope 2 at $DIR/lower_intrinsics.rs:9:14: 9:50
- // mir::Constant
- // + span: $DIR/lower_intrinsics.rs:9:14: 9:44
- // + literal: Const { ty: extern "rust-intrinsic" fn(T, T) -> T {
std::intrinsics::
wrapping_mul::<T>}, val: Value(Scalar(<ZST>)) }
- // + literal: Const { ty: extern "rust-intrinsic" fn(T, T) -> T {wrapping_mul::<T>}, val: Value(Scalar(<ZST>)) }
+ _9 = Mul(move _10, move _11); // scope 2 at $DIR/lower_intrinsics.rs:9:14: 9:50
+ goto -> bb3; // scope 2 at $DIR/lower_intrinsics.rs:9:14: 9:50
}
...
...
src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir
浏览文件 @
ee0b5648
...
...
@@ -52,12 +52,9 @@ fn full_tested_match() -> () {
bb5: {
StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
_11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
// ty::Const
// + ty: &std::option::Option<i32>
// + val: Unevaluated(full_tested_match, [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/match_false_edges.rs:16:14: 16:15
// + literal: Const { ty: &
std::option::Option<i32>, val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:5 ~ match_false_edges[5411]::full_tested_match), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &
Option<i32>, val: Unevaluated(full_tested_match, [], Some(promoted[0])
) }
_6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
_4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
...
...
src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir
浏览文件 @
ee0b5648
...
...
@@ -23,10 +23,7 @@ fn unwrap(_1: Option<T>) -> T {
begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/std/src/panic.rs:LL:COL
// + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 })
// + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }
// mir::Constant
// + span: $SRC_DIR/std/src/panic.rs:LL:COL
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) }
...
...
src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir
浏览文件 @
ee0b5648
...
...
@@ -13,9 +13,6 @@ fn main() -> () {
StorageLive(_3); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
StorageLive(_4); // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
_4 = const ""; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [], len: Size { raw: 0 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 0 })
// mir::Constant
// + span: $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [], len: Size { raw: 0 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 0 }) }
...
...
@@ -23,7 +20,7 @@ fn main() -> () {
_2 = <str as ToString>::to_string(move _3) -> bb1; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
// mir::Constant
// + span: $DIR/no-spurious-drop-after-call.rs:9:23: 9:32
// + literal: Const { ty: for<'r> fn(&'r str) ->
std::string::String {<str as std::string::
ToString>::to_string}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r> fn(&'r str) ->
String {<str as
ToString>::to_string}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
@@ -31,7 +28,7 @@ fn main() -> () {
_1 = std::mem::drop::<String>(move _2) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
// mir::Constant
// + span: $DIR/no-spurious-drop-after-call.rs:9:5: 9:19
// + literal: Const { ty: fn(
std::string::String) {std::mem::drop::<std::string::
String>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: fn(
String) {std::mem::drop::<
String>}, val: Value(Scalar(<ZST>)) }
}
bb2: {
...
...
src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir
浏览文件 @
ee0b5648
...
...
@@ -32,7 +32,7 @@ fn main() -> () {
_1 = null_mut::<Test>() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/receiver-ptr-mutability.rs:14:26: 14:46
// mir::Constant
// + span: $DIR/receiver-ptr-mutability.rs:14:26: 14:44
// + literal: Const { ty: fn() -> *mut Test {
std::ptr::
null_mut::<Test>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: fn() -> *mut Test {null_mut::<Test>}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
浏览文件 @
ee0b5648
...
...
@@ -59,7 +59,7 @@
_7 = <std::ops::Range<i32> as iter::range::RangeIteratorImpl>::spec_next(move _14) -> bb4; // scope 5 at $DIR/remove_storage_markers.rs:8:14: 8:19
// mir::Constant
// + span: $DIR/remove_storage_markers.rs:8:14: 8:19
// + literal: Const { ty: for<'r> fn(&'r mut std::ops::Range<i32>) ->
std::option::Option<<std::ops::Range<i32> as std::iter::range::RangeIteratorImpl>::Item> {<std::ops::Range<i32> as std::
iter::range::RangeIteratorImpl>::spec_next}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r> fn(&'r mut std::ops::Range<i32>) ->
Option<<std::ops::Range<i32> as iter::range::RangeIteratorImpl>::Item> {<std::ops::Range<i32> as
iter::range::RangeIteratorImpl>::spec_next}, val: Value(Scalar(<ZST>)) }
}
bb2: {
...
...
src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir
浏览文件 @
ee0b5648
...
...
@@ -81,7 +81,7 @@ fn array_casts() -> () {
_6 = ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> bb1; // scope 3 at $DIR/retag.rs:60:15: 60:23
// mir::Constant
// + span: $DIR/retag.rs:60:17: 60:20
// + literal: Const { ty: unsafe fn(*mut usize, usize) -> *mut usize {
std::
ptr::mut_ptr::<impl *mut usize>::add}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: unsafe fn(*mut usize, usize) -> *mut usize {ptr::mut_ptr::<impl *mut usize>::add}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
@@ -112,7 +112,7 @@ fn array_casts() -> () {
_16 = ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> bb2; // scope 6 at $DIR/retag.rs:64:26: 64:34
// mir::Constant
// + span: $DIR/retag.rs:64:28: 64:31
// + literal: Const { ty: unsafe fn(*const usize, usize) -> *const usize {
std::
ptr::const_ptr::<impl *const usize>::add}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: unsafe fn(*const usize, usize) -> *const usize {ptr::const_ptr::<impl *const usize>::add}, val: Value(Scalar(<ZST>)) }
}
bb2: {
...
...
@@ -122,12 +122,9 @@ fn array_casts() -> () {
Retag(_14); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_35 = const array_casts::promoted[0]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// ty::Const
// + ty: &usize
// + val: Unevaluated(array_casts, [], Some(promoted[0]))
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &usize, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:15 ~ retag[4622]::array_casts), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &usize, val: Unevaluated(
array_casts, [], Some(promoted[0])
) }
Retag(_35); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_18 = &(*_35); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Retag(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
...
...
@@ -177,7 +174,7 @@ fn array_casts() -> () {
core::panicking::assert_failed::<usize, usize>(move _29, move _30, move _32, move _34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r usize, &'s usize,
std::option::Option<std::fmt::
Arguments<'t0>>) -> ! {core::panicking::assert_failed::<usize, usize>}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r usize, &'s usize,
Option<
Arguments<'t0>>) -> ! {core::panicking::assert_failed::<usize, usize>}, val: Value(Scalar(<ZST>)) }
}
bb4: {
...
...
src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
浏览文件 @
ee0b5648
...
...
@@ -11,7 +11,7 @@ fn std::ptr::drop_in_place(_1: *mut Test) -> () {
_3 = <Test as Drop>::drop(move _2) -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// + literal: Const { ty: for<'r> fn(&'r mut Test) {<Test as
std::ops::
Drop>::drop}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r> fn(&'r mut Test) {<Test as Drop>::drop}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
浏览文件 @
ee0b5648
...
...
@@ -148,12 +148,9 @@ fn main() -> () {
StorageLive(_22); // scope 7 at $DIR/retag.rs:47:21: 47:23
StorageLive(_23); // scope 7 at $DIR/retag.rs:47:21: 47:23
_28 = const main::promoted[0]; // scope 7 at $DIR/retag.rs:47:21: 47:23
// ty::Const
// + ty: &i32
// + val: Unevaluated(main, [], Some(promoted[0]))
// mir::Constant
// + span: $DIR/retag.rs:47:21: 47:23
// + literal: Const { ty: &i32, val: Unevaluated(
Unevaluated { def: WithOptConstParam { did: DefId(0:13 ~ retag[4622]::main), const_param_did: None }, substs: [], promoted: Some(promoted[0]) }
) }
// + literal: Const { ty: &i32, val: Unevaluated(
main, [], Some(promoted[0])
) }
Retag(_28); // scope 7 at $DIR/retag.rs:47:21: 47:23
_23 = &(*_28); // scope 7 at $DIR/retag.rs:47:21: 47:23
Retag(_23); // scope 7 at $DIR/retag.rs:47:21: 47:23
...
...
src/test/mir-opt/simplify_locals.d2.SimplifyLocals.diff
浏览文件 @
ee0b5648
...
...
@@ -15,17 +15,11 @@
- discriminant(_3) = 0; // scope 0 at $DIR/simplify-locals.rs:28:11: 28:15
- (_2.0: i32) = const 10_i32; // scope 0 at $DIR/simplify-locals.rs:28:6: 28:16
- (_2.1: E) = const E::A; // scope 0 at $DIR/simplify-locals.rs:28:6: 28:16
- // ty::Const
- // + ty: E
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/simplify-locals.rs:28:6: 28:16
- // + literal: Const { ty: E, val: Value(Scalar(0x00)) }
- StorageDead(_3); // scope 0 at $DIR/simplify-locals.rs:28:15: 28:16
- (_2.1: E) = const E::B; // scope 0 at $DIR/simplify-locals.rs:28:5: 28:26
- // ty::Const
- // + ty: E
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/simplify-locals.rs:28:5: 28:26
- // + literal: Const { ty: E, val: Value(Scalar(0x01)) }
...
...
src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir
浏览文件 @
ee0b5648
...
...
@@ -190,9 +190,6 @@ static XXX: &Foo = {
_3 = move _4 as &[(u32, u32)] (Pointer(Unsize)); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
StorageDead(_4); // scope 0 at $DIR/storage_live_dead_in_statics.rs:22:5: 22:6
_2 = Foo { tup: const "hi", data: move _3 }; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:29: 23:2
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [104, 105], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [3], len: Size { raw: 2 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 2 })
// mir::Constant
// + span: $DIR/storage_live_dead_in_statics.rs:6:10: 6:14
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [104, 105], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [3], len: Size { raw: 2 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 2 }) }
...
...
src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
浏览文件 @
ee0b5648
...
...
@@ -19,9 +19,6 @@ fn main() -> () {
_3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
StorageLive(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
_5 = const "C"; // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -39,9 +36,6 @@ fn main() -> () {
bb1: {
StorageLive(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
_9 = const "E"; // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -52,9 +46,6 @@ fn main() -> () {
bb2: {
_6 = const "D"; // scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
浏览文件 @
ee0b5648
...
...
@@ -25,9 +25,6 @@
bb1: {
StorageLive(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
_5 = const "C"; // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -38,9 +35,6 @@
bb2: {
_1 = const "A(Empty)"; // scope 0 at $DIR/uninhabited_enum_branching.rs:21:24: 21:34
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:21:24: 21:34
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
...
...
@@ -50,9 +44,6 @@
bb3: {
StorageLive(_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
_4 = const "B(Empty)"; // scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:22:24: 22:34
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
...
...
@@ -74,9 +65,6 @@
bb5: {
StorageLive(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
_9 = const "E"; // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -87,9 +75,6 @@
bb6: {
_6 = const "D"; // scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
浏览文件 @
ee0b5648
...
...
@@ -36,9 +36,6 @@ fn main() -> () {
bb1: {
StorageLive(_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:25:21: 25:24
_8 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:25:21: 25:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:25:21: 25:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -50,9 +47,6 @@ fn main() -> () {
bb2: {
StorageLive(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:24:21: 24:24
_7 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:24:21: 24:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:24:21: 24:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -72,9 +66,6 @@ fn main() -> () {
bb4: {
StorageLive(_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:32:21: 32:24
_13 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:32:21: 32:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:32:21: 32:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -86,9 +77,6 @@ fn main() -> () {
bb5: {
StorageLive(_12); // scope 1 at $DIR/uninhabited_enum_branching2.rs:31:21: 31:24
_12 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:31:21: 31:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:31:21: 31:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
浏览文件 @
ee0b5648
...
...
@@ -38,9 +38,6 @@
bb1: {
StorageLive(_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:25:21: 25:24
_8 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:25:21: 25:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:25:21: 25:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -51,9 +48,6 @@
bb2: {
_3 = const "A(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:22:24: 22:34
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:22:24: 22:34
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
...
...
@@ -63,9 +57,6 @@
bb3: {
StorageLive(_6); // scope 1 at $DIR/uninhabited_enum_branching2.rs:23:24: 23:34
_6 = const "B(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:23:24: 23:34
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:23:24: 23:34
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
...
...
@@ -77,9 +68,6 @@
bb4: {
StorageLive(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:24:21: 24:24
_7 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:24:21: 24:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:24:21: 24:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -100,9 +88,6 @@
bb6: {
StorageLive(_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:32:21: 32:24
_13 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:32:21: 32:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:32:21: 32:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
@@ -113,9 +98,6 @@
bb7: {
_9 = const "A(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:29:24: 29:34
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:29:24: 29:34
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
...
...
@@ -125,9 +107,6 @@
bb8: {
StorageLive(_11); // scope 1 at $DIR/uninhabited_enum_branching2.rs:30:24: 30:34
_11 = const "B(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:30:24: 30:34
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:30:24: 30:34
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
...
...
@@ -139,9 +118,6 @@
bb9: {
StorageLive(_12); // scope 1 at $DIR/uninhabited_enum_branching2.rs:31:21: 31:24
_12 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:31:21: 31:24
// ty::Const
// + ty: &str
// + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:31:21: 31:24
// + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1], len: Size { raw: 1 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
...
...
src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
浏览文件 @
ee0b5648
...
...
@@ -22,7 +22,7 @@
_1 = empty() -> bb1; // scope 0 at $DIR/unreachable.rs:9:23: 9:30
// mir::Constant
// + span: $DIR/unreachable.rs:9:23: 9:28
// + literal: Const { ty: fn() ->
std::option::
Option<Empty> {empty}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: fn() -> Option<Empty> {empty}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
浏览文件 @
ee0b5648
...
...
@@ -24,7 +24,7 @@
_2 = empty() -> bb1; // scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
// mir::Constant
// + span: $DIR/unreachable_diverging.rs:14:25: 14:30
// + literal: Const { ty: fn() ->
std::option::
Option<Empty> {empty}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: fn() -> Option<Empty> {empty}, val: Value(Scalar(<ZST>)) }
}
bb1: {
...
...
src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir
浏览文件 @
ee0b5648
...
...
@@ -34,6 +34,6 @@ fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
_3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// + literal: Const { ty: for<'r> fn(&'r mut
std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::
Drop>::drop}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r> fn(&'r mut
Vec<i32>) {<Vec<i32> as
Drop>::drop}, val: Value(Scalar(<ZST>)) }
}
}
src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir
浏览文件 @
ee0b5648
...
...
@@ -34,6 +34,6 @@ fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
_3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// + literal: Const { ty: for<'r> fn(&'r mut
std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::
Drop>::drop}, val: Value(Scalar(<ZST>)) }
// + literal: Const { ty: for<'r> fn(&'r mut
Vec<i32>) {<Vec<i32> as
Drop>::drop}, val: Value(Scalar(<ZST>)) }
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录