Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
cb2d3bb1
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,发现更多精彩内容 >>
未验证
提交
cb2d3bb1
编写于
7月 04, 2022
作者:
M
Matthias Krüger
提交者:
GitHub
7月 04, 2022
浏览文件
操作
浏览文件
下载
差异文件
Rollup merge of #98878 - lcnr:more-rustc_pass_by_value, r=oli-obk
add more `rustc_pass_by_value` r? ```@oli-obk``` cc #98766
上级
9ad3ef13
658b7f36
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
14 deletion
+15
-14
compiler/rustc_borrowck/src/constraint_generation.rs
compiler/rustc_borrowck/src/constraint_generation.rs
+1
-1
compiler/rustc_middle/src/mir/syntax.rs
compiler/rustc_middle/src/mir/syntax.rs
+1
-0
compiler/rustc_middle/src/mir/visit.rs
compiler/rustc_middle/src/mir/visit.rs
+12
-13
compiler/rustc_type_ir/src/lib.rs
compiler/rustc_type_ir/src/lib.rs
+1
-0
未找到文件。
compiler/rustc_borrowck/src/constraint_generation.rs
浏览文件 @
cb2d3bb1
...
...
@@ -149,7 +149,7 @@ fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location
fn
visit_ascribe_user_ty
(
&
mut
self
,
_
place
:
&
Place
<
'tcx
>
,
_
variance
:
&
ty
::
Variance
,
_
variance
:
ty
::
Variance
,
_u
ser_ty
:
&
UserTypeProjection
,
_
location
:
Location
,
)
{
...
...
compiler/rustc_middle/src/mir/syntax.rs
浏览文件 @
cb2d3bb1
...
...
@@ -311,6 +311,7 @@ pub enum StatementKind<'tcx> {
/// Describes what kind of retag is to be performed.
#[derive(Copy,
Clone,
TyEncodable,
TyDecodable,
Debug,
PartialEq,
Eq,
Hash,
HashStable)]
#[rustc_pass_by_value]
pub
enum
RetagKind
{
/// The initial retag when entering a function.
FnEntry
,
...
...
compiler/rustc_middle/src/mir/visit.rs
浏览文件 @
cb2d3bb1
...
...
@@ -147,7 +147,7 @@ fn visit_operand(
fn
visit_ascribe_user_ty
(
&
mut
self
,
place
:
&
$
(
$mutability
)
?
Place
<
'tcx
>
,
variance
:
&
$
(
$mutability
)
?
ty
::
Variance
,
variance
:
$
(
&
$mutability
)
?
ty
::
Variance
,
user_ty
:
&
$
(
$mutability
)
?
UserTypeProjection
,
location
:
Location
,
)
{
...
...
@@ -164,7 +164,7 @@ fn visit_coverage(
fn
visit_retag
(
&
mut
self
,
kind
:
&
$
(
$mutability
)
?
RetagKind
,
kind
:
$
(
&
$mutability
)
?
RetagKind
,
place
:
&
$
(
$mutability
)
?
Place
<
'tcx
>
,
location
:
Location
,
)
{
...
...
@@ -425,7 +425,7 @@ fn super_statement(&mut self,
self
.visit_source_info
(
source_info
);
match
kind
{
StatementKind
::
Assign
(
box
(
ref
$
(
$mutability
)
?
place
,
ref
$
(
$mutability
)
?
rvalue
)
box
(
place
,
rvalue
)
)
=>
{
self
.visit_assign
(
place
,
rvalue
,
location
);
}
...
...
@@ -465,13 +465,13 @@ fn super_statement(&mut self,
);
}
StatementKind
::
Retag
(
kind
,
place
)
=>
{
self
.visit_retag
(
kind
,
place
,
location
);
self
.visit_retag
(
$
(
&
$mutability
)
?
*
kind
,
place
,
location
);
}
StatementKind
::
AscribeUserType
(
box
(
ref
$
(
$mutability
)
?
place
,
ref
$
(
$mutability
)
?
user_ty
),
box
(
place
,
user_ty
),
variance
)
=>
{
self
.visit_ascribe_user_ty
(
place
,
variance
,
user_ty
,
location
);
self
.visit_ascribe_user_ty
(
place
,
$
(
&
$mutability
)
?
*
variance
,
user_ty
,
location
);
}
StatementKind
::
Coverage
(
coverage
)
=>
{
self
.visit_coverage
(
...
...
@@ -480,9 +480,9 @@ fn super_statement(&mut self,
)
}
StatementKind
::
CopyNonOverlapping
(
box
crate
::
mir
::
CopyNonOverlapping
{
ref
$
(
$mutability
)
?
src
,
ref
$
(
$mutability
)
?
dst
,
ref
$
(
$mutability
)
?
count
,
src
,
dst
,
count
,
})
=>
{
self
.visit_operand
(
src
,
location
);
self
.visit_operand
(
dst
,
location
);
...
...
@@ -517,8 +517,7 @@ fn super_terminator(&mut self,
TerminatorKind
::
GeneratorDrop
|
TerminatorKind
::
Unreachable
|
TerminatorKind
::
FalseEdge
{
..
}
|
TerminatorKind
::
FalseUnwind
{
..
}
=>
{
}
TerminatorKind
::
FalseUnwind
{
..
}
=>
{}
TerminatorKind
::
Return
=>
{
// `return` logically moves from the return place `_0`. Note that the place
...
...
@@ -830,7 +829,7 @@ fn super_operand(&mut self,
fn
super_ascribe_user_ty
(
&
mut
self
,
place
:
&
$
(
$mutability
)
?
Place
<
'tcx
>
,
_
variance
:
&
$
(
$mutability
)
?
ty
::
Variance
,
_
variance
:
$
(
&
$mutability
)
?
ty
::
Variance
,
user_ty
:
&
$
(
$mutability
)
?
UserTypeProjection
,
location
:
Location
)
{
self
.visit_place
(
...
...
@@ -847,7 +846,7 @@ fn super_coverage(&mut self,
}
fn
super_retag
(
&
mut
self
,
_
kind
:
&
$
(
$mutability
)
?
RetagKind
,
_
kind
:
$
(
&
$mutability
)
?
RetagKind
,
place
:
&
$
(
$mutability
)
?
Place
<
'tcx
>
,
location
:
Location
)
{
self
.visit_place
(
...
...
compiler/rustc_type_ir/src/lib.rs
浏览文件 @
cb2d3bb1
...
...
@@ -599,6 +599,7 @@ fn tag() -> &'static str {
}
#[derive(Copy,
Clone,
PartialEq,
Decodable,
Encodable,
Hash)]
#[rustc_pass_by_value]
pub
enum
Variance
{
Covariant
,
// T<A> <: T<B> iff A <: B -- e.g., function return type
Invariant
,
// T<A> <: T<B> iff B == A -- e.g., type of mutable cell
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录