Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
0ed6e795
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,发现更多精彩内容 >>
未验证
提交
0ed6e795
编写于
3月 06, 2020
作者:
S
Santiago Pastorino
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mir::Local is Copy we can pass it by value in these cases
上级
865b44a3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
12 deletion
+12
-12
src/librustc/mir/visit.rs
src/librustc/mir/visit.rs
+5
-5
src/librustc_codegen_ssa/mir/analyze.rs
src/librustc_codegen_ssa/mir/analyze.rs
+1
-1
src/librustc_mir/transform/check_consts/validation.rs
src/librustc_mir/transform/check_consts/validation.rs
+6
-6
未找到文件。
src/librustc/mir/visit.rs
浏览文件 @
0ed6e795
...
...
@@ -888,7 +888,7 @@ fn process_projection_elem(
()
=>
(
fn
visit_projection
(
&
mut
self
,
local
:
&
Local
,
local
:
Local
,
projection
:
&
[
PlaceElem
<
'tcx
>
],
context
:
PlaceContext
,
location
:
Location
,
...
...
@@ -898,7 +898,7 @@ fn visit_projection(
fn
visit_projection_elem
(
&
mut
self
,
local
:
&
Local
,
local
:
Local
,
proj_base
:
&
[
PlaceElem
<
'tcx
>
],
elem
:
&
PlaceElem
<
'tcx
>
,
context
:
PlaceContext
,
...
...
@@ -925,7 +925,7 @@ fn super_place(
self
.visit_place_base
(
&
place
.local
,
context
,
location
);
self
.visit_projection
(
&
place
.local
,
self
.visit_projection
(
place
.local
,
&
place
.projection
,
context
,
location
);
...
...
@@ -933,7 +933,7 @@ fn super_place(
fn
super_projection
(
&
mut
self
,
local
:
&
Local
,
local
:
Local
,
projection
:
&
[
PlaceElem
<
'tcx
>
],
context
:
PlaceContext
,
location
:
Location
,
...
...
@@ -947,7 +947,7 @@ fn super_projection(
fn
super_projection_elem
(
&
mut
self
,
_
local
:
&
Local
,
_
local
:
Local
,
_
proj_base
:
&
[
PlaceElem
<
'tcx
>
],
elem
:
&
PlaceElem
<
'tcx
>
,
_
context
:
PlaceContext
,
...
...
src/librustc_codegen_ssa/mir/analyze.rs
浏览文件 @
0ed6e795
...
...
@@ -203,7 +203,7 @@ fn process_place(
}
self
.visit_place_base
(
&
place_ref
.local
,
context
,
location
);
self
.visit_projection
(
&
place_ref
.local
,
place_ref
.projection
,
context
,
location
);
self
.visit_projection
(
place_ref
.local
,
place_ref
.projection
,
context
,
location
);
}
}
}
...
...
src/librustc_mir/transform/check_consts/validation.rs
浏览文件 @
0ed6e795
...
...
@@ -276,7 +276,7 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
}
};
self
.visit_place_base
(
&
place
.local
,
ctx
,
location
);
self
.visit_projection
(
&
place
.local
,
reborrowed_proj
,
ctx
,
location
);
self
.visit_projection
(
place
.local
,
reborrowed_proj
,
ctx
,
location
);
return
;
}
}
...
...
@@ -289,7 +289,7 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
Mutability
::
Mut
=>
PlaceContext
::
MutatingUse
(
MutatingUseContext
::
AddressOf
),
};
self
.visit_place_base
(
&
place
.local
,
ctx
,
location
);
self
.visit_projection
(
&
place
.local
,
reborrowed_proj
,
ctx
,
location
);
self
.visit_projection
(
place
.local
,
reborrowed_proj
,
ctx
,
location
);
return
;
}
}
...
...
@@ -408,7 +408,7 @@ fn visit_operand(&mut self, op: &Operand<'tcx>, location: Location) {
}
fn
visit_projection_elem
(
&
mut
self
,
place_local
:
&
Local
,
place_local
:
Local
,
proj_base
:
&
[
PlaceElem
<
'tcx
>
],
elem
:
&
PlaceElem
<
'tcx
>
,
context
:
PlaceContext
,
...
...
@@ -428,11 +428,11 @@ fn visit_projection_elem(
match
elem
{
ProjectionElem
::
Deref
=>
{
let
base_ty
=
Place
::
ty_from
(
*
place_local
,
proj_base
,
*
self
.body
,
self
.tcx
)
.ty
;
let
base_ty
=
Place
::
ty_from
(
place_local
,
proj_base
,
*
self
.body
,
self
.tcx
)
.ty
;
if
let
ty
::
RawPtr
(
_
)
=
base_ty
.kind
{
if
proj_base
.is_empty
()
{
if
let
(
local
,
[])
=
(
place_local
,
proj_base
)
{
let
decl
=
&
self
.body.local_decls
[
*
local
];
let
decl
=
&
self
.body.local_decls
[
local
];
if
let
LocalInfo
::
StaticRef
{
def_id
,
..
}
=
decl
.local_info
{
let
span
=
decl
.source_info.span
;
self
.check_static
(
def_id
,
span
);
...
...
@@ -452,7 +452,7 @@ fn visit_projection_elem(
|
ProjectionElem
::
Subslice
{
..
}
|
ProjectionElem
::
Field
(
..
)
|
ProjectionElem
::
Index
(
_
)
=>
{
let
base_ty
=
Place
::
ty_from
(
*
place_local
,
proj_base
,
*
self
.body
,
self
.tcx
)
.ty
;
let
base_ty
=
Place
::
ty_from
(
place_local
,
proj_base
,
*
self
.body
,
self
.tcx
)
.ty
;
match
base_ty
.ty_adt_def
()
{
Some
(
def
)
if
def
.is_union
()
=>
{
self
.check_op
(
ops
::
UnionAccess
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录