Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
1cf6d694
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,发现更多精彩内容 >>
提交
1cf6d694
编写于
4月 05, 2022
作者:
O
ouz-a
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
kill temp early
上级
72070d81
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
5 deletion
+4
-5
compiler/rustc_mir_transform/src/deref_separator.rs
compiler/rustc_mir_transform/src/deref_separator.rs
+1
-2
src/test/mir-opt/derefer_test.main.Derefer.diff
src/test/mir-opt/derefer_test.main.Derefer.diff
+2
-2
src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
...nline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
+1
-1
未找到文件。
compiler/rustc_mir_transform/src/deref_separator.rs
浏览文件 @
1cf6d694
...
@@ -8,7 +8,6 @@ pub fn deref_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
...
@@ -8,7 +8,6 @@ pub fn deref_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let
mut
patch
=
MirPatch
::
new
(
body
);
let
mut
patch
=
MirPatch
::
new
(
body
);
let
(
basic_blocks
,
local_decl
)
=
body
.basic_blocks_and_local_decls_mut
();
let
(
basic_blocks
,
local_decl
)
=
body
.basic_blocks_and_local_decls_mut
();
for
(
block
,
data
)
in
basic_blocks
.iter_enumerated_mut
()
{
for
(
block
,
data
)
in
basic_blocks
.iter_enumerated_mut
()
{
let
statement_len
=
data
.statements
.len
();
for
(
i
,
stmt
)
in
data
.statements
.iter_mut
()
.enumerate
()
{
for
(
i
,
stmt
)
in
data
.statements
.iter_mut
()
.enumerate
()
{
match
stmt
.kind
{
match
stmt
.kind
{
StatementKind
::
Assign
(
box
(
og_place
,
Rvalue
::
Ref
(
region
,
borrow_knd
,
place
)))
=>
{
StatementKind
::
Assign
(
box
(
og_place
,
Rvalue
::
Ref
(
region
,
borrow_knd
,
place
)))
=>
{
...
@@ -49,7 +48,7 @@ pub fn deref_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
...
@@ -49,7 +48,7 @@ pub fn deref_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
*
stmt
=
new_stmt
;
*
stmt
=
new_stmt
;
// Since our job with the temp is done it should be gone
// Since our job with the temp is done it should be gone
let
loc
=
Location
{
block
:
block
,
statement_index
:
statement_len
};
let
loc
=
Location
{
block
:
block
,
statement_index
:
i
+
1
};
patch
.add_statement
(
loc
,
StatementKind
::
StorageDead
(
temp
));
patch
.add_statement
(
loc
,
StatementKind
::
StorageDead
(
temp
));
// As all projections are off the base projection, if there are
// As all projections are off the base projection, if there are
...
...
src/test/mir-opt/derefer_test.main.Derefer.diff
浏览文件 @
1cf6d694
...
@@ -38,18 +38,18 @@
...
@@ -38,18 +38,18 @@
+ StorageLive(_6); // scope 2 at $DIR/derefer_test.rs:5:13: 5:26
+ StorageLive(_6); // scope 2 at $DIR/derefer_test.rs:5:13: 5:26
+ _6 = move (_2.1: &mut (i32, i32)); // scope 2 at $DIR/derefer_test.rs:5:13: 5:26
+ _6 = move (_2.1: &mut (i32, i32)); // scope 2 at $DIR/derefer_test.rs:5:13: 5:26
+ _4 = &mut ((*_6).0: i32); // scope 2 at $DIR/derefer_test.rs:5:13: 5:26
+ _4 = &mut ((*_6).0: i32); // scope 2 at $DIR/derefer_test.rs:5:13: 5:26
+ StorageDead(_6); // scope 3 at $DIR/derefer_test.rs:6:9: 6:10
StorageLive(_5); // scope 3 at $DIR/derefer_test.rs:6:9: 6:10
StorageLive(_5); // scope 3 at $DIR/derefer_test.rs:6:9: 6:10
- _5 = &mut ((*(_2.1: &mut (i32, i32))).1: i32); // scope 3 at $DIR/derefer_test.rs:6:13: 6:26
- _5 = &mut ((*(_2.1: &mut (i32, i32))).1: i32); // scope 3 at $DIR/derefer_test.rs:6:13: 6:26
+ StorageLive(_7); // scope 3 at $DIR/derefer_test.rs:6:13: 6:26
+ StorageLive(_7); // scope 3 at $DIR/derefer_test.rs:6:13: 6:26
+ _7 = move (_2.1: &mut (i32, i32)); // scope 3 at $DIR/derefer_test.rs:6:13: 6:26
+ _7 = move (_2.1: &mut (i32, i32)); // scope 3 at $DIR/derefer_test.rs:6:13: 6:26
+ _5 = &mut ((*_7).1: i32); // scope 3 at $DIR/derefer_test.rs:6:13: 6:26
+ _5 = &mut ((*_7).1: i32); // scope 3 at $DIR/derefer_test.rs:6:13: 6:26
+ StorageDead(_7); // scope 0 at $DIR/derefer_test.rs:2:11: 7:2
_0 = const (); // scope 0 at $DIR/derefer_test.rs:2:11: 7:2
_0 = const (); // scope 0 at $DIR/derefer_test.rs:2:11: 7:2
StorageDead(_5); // scope 3 at $DIR/derefer_test.rs:7:1: 7:2
StorageDead(_5); // scope 3 at $DIR/derefer_test.rs:7:1: 7:2
StorageDead(_4); // scope 2 at $DIR/derefer_test.rs:7:1: 7:2
StorageDead(_4); // scope 2 at $DIR/derefer_test.rs:7:1: 7:2
StorageDead(_2); // scope 1 at $DIR/derefer_test.rs:7:1: 7:2
StorageDead(_2); // scope 1 at $DIR/derefer_test.rs:7:1: 7:2
StorageDead(_1); // scope 0 at $DIR/derefer_test.rs:7:1: 7:2
StorageDead(_1); // scope 0 at $DIR/derefer_test.rs:7:1: 7:2
+ StorageDead(_6); // scope 0 at $DIR/derefer_test.rs:7:2: 7:2
+ StorageDead(_7); // scope 0 at $DIR/derefer_test.rs:7:2: 7:2
return; // scope 0 at $DIR/derefer_test.rs:7:2: 7:2
return; // scope 0 at $DIR/derefer_test.rs:7:2: 7:2
+ }
+ }
+
+
...
...
src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
浏览文件 @
1cf6d694
...
@@ -23,11 +23,11 @@ fn b(_1: &mut Box<T>) -> &mut T {
...
@@ -23,11 +23,11 @@ fn b(_1: &mut Box<T>) -> &mut T {
StorageLive(_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageLive(_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_7 = move (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_7 = move (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_6 = &mut (*_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_6 = &mut (*_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageDead(_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_5 = &mut (*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_5 = &mut (*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_3 = &mut (*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_3 = &mut (*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageDead(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageDead(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageDead(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageDead(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageDead(_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_2 = &mut (*_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
_2 = &mut (*_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
StorageDead(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:14: 8:15
StorageDead(_4); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:14: 8:15
_0 = &mut (*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
_0 = &mut (*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录