Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
eb3cc132
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,发现更多精彩内容 >>
未验证
提交
eb3cc132
编写于
12月 18, 2021
作者:
M
Matthias Krüger
提交者:
GitHub
12月 18, 2021
浏览文件
操作
浏览文件
下载
差异文件
Rollup merge of #91896 - pitaj:91867-passes, r=michaelwoerister
Remove `in_band_lifetimes` for `rustc_passes` #91867
上级
57d49f15
c4bafafa
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
33 addition
and
34 deletion
+33
-34
compiler/rustc_passes/src/check_attr.rs
compiler/rustc_passes/src/check_attr.rs
+5
-5
compiler/rustc_passes/src/check_const.rs
compiler/rustc_passes/src/check_const.rs
+4
-4
compiler/rustc_passes/src/dead.rs
compiler/rustc_passes/src/dead.rs
+3
-3
compiler/rustc_passes/src/intrinsicck.rs
compiler/rustc_passes/src/intrinsicck.rs
+3
-3
compiler/rustc_passes/src/lang_items.rs
compiler/rustc_passes/src/lang_items.rs
+2
-2
compiler/rustc_passes/src/layout_test.rs
compiler/rustc_passes/src/layout_test.rs
+6
-6
compiler/rustc_passes/src/lib.rs
compiler/rustc_passes/src/lib.rs
+0
-1
compiler/rustc_passes/src/lib_features.rs
compiler/rustc_passes/src/lib_features.rs
+2
-2
compiler/rustc_passes/src/liveness.rs
compiler/rustc_passes/src/liveness.rs
+1
-1
compiler/rustc_passes/src/naked_functions.rs
compiler/rustc_passes/src/naked_functions.rs
+1
-1
compiler/rustc_passes/src/reachable.rs
compiler/rustc_passes/src/reachable.rs
+1
-1
compiler/rustc_passes/src/stability.rs
compiler/rustc_passes/src/stability.rs
+3
-3
compiler/rustc_passes/src/upvars.rs
compiler/rustc_passes/src/upvars.rs
+2
-2
未找到文件。
compiler/rustc_passes/src/check_attr.rs
浏览文件 @
eb3cc132
...
...
@@ -58,7 +58,7 @@ struct CheckAttrVisitor<'tcx> {
tcx
:
TyCtxt
<
'tcx
>
,
}
impl
CheckAttrVisitor
<
'
tcx
>
{
impl
CheckAttrVisitor
<
'
_
>
{
/// Checks any attribute.
fn
check_attributes
(
&
self
,
...
...
@@ -382,7 +382,7 @@ fn check_track_caller(
&
self
,
hir_id
:
HirId
,
attr_span
:
&
Span
,
attrs
:
&
'hir
[
Attribute
],
attrs
:
&
[
Attribute
],
span
:
&
Span
,
target
:
Target
,
)
->
bool
{
...
...
@@ -1481,7 +1481,7 @@ fn check_no_mangle(&self, hir_id: HirId, attr: &Attribute, span: &Span, target:
/// Checks if the `#[repr]` attributes on `item` are valid.
fn
check_repr
(
&
self
,
attrs
:
&
'hir
[
Attribute
],
attrs
:
&
[
Attribute
],
span
:
&
Span
,
target
:
Target
,
item
:
Option
<
ItemLike
<
'_
>>
,
...
...
@@ -1663,7 +1663,7 @@ fn check_repr(
}
}
fn
check_used
(
&
self
,
attrs
:
&
'hir
[
Attribute
],
target
:
Target
)
{
fn
check_used
(
&
self
,
attrs
:
&
[
Attribute
],
target
:
Target
)
{
for
attr
in
attrs
{
if
attr
.has_name
(
sym
::
used
)
&&
target
!=
Target
::
Static
{
self
.tcx
...
...
@@ -1842,7 +1842,7 @@ fn check_plugin_registrar(&self, hir_id: HirId, attr: &Attribute, target: Target
}
}
impl
Visitor
<
'tcx
>
for
CheckAttrVisitor
<
'tcx
>
{
impl
<
'tcx
>
Visitor
<
'tcx
>
for
CheckAttrVisitor
<
'tcx
>
{
type
Map
=
Map
<
'tcx
>
;
fn
nested_visit_map
(
&
mut
self
)
->
NestedVisitorMap
<
Self
::
Map
>
{
...
...
compiler/rustc_passes/src/check_const.rs
浏览文件 @
eb3cc132
...
...
@@ -78,7 +78,7 @@ fn new(tcx: TyCtxt<'tcx>) -> Self {
impl
<
'tcx
>
hir
::
itemlikevisit
::
ItemLikeVisitor
<
'tcx
>
for
CheckConstTraitVisitor
<
'tcx
>
{
/// check for const trait impls, and errors if the impl uses provided/default functions
/// of the trait being implemented; as those provided functions can be non-const.
fn
visit_item
(
&
mut
self
,
item
:
&
'hir
hir
::
Item
<
'hir
>
)
{
fn
visit_item
<
'hir
>
(
&
mut
self
,
item
:
&
'hir
hir
::
Item
<
'hir
>
)
{
let
_
:
Option
<
_
>
=
try
{
if
let
hir
::
ItemKind
::
Impl
(
ref
imp
)
=
item
.kind
{
if
let
hir
::
Constness
::
Const
=
imp
.constness
{
...
...
@@ -134,11 +134,11 @@ fn visit_item(&mut self, item: &'hir hir::Item<'hir>) {
};
}
fn
visit_trait_item
(
&
mut
self
,
_
:
&
'hir
hir
::
TraitItem
<
'hir
>
)
{}
fn
visit_trait_item
<
'hir
>
(
&
mut
self
,
_
:
&
'hir
hir
::
TraitItem
<
'hir
>
)
{}
fn
visit_impl_item
(
&
mut
self
,
_
:
&
'hir
hir
::
ImplItem
<
'hir
>
)
{}
fn
visit_impl_item
<
'hir
>
(
&
mut
self
,
_
:
&
'hir
hir
::
ImplItem
<
'hir
>
)
{}
fn
visit_foreign_item
(
&
mut
self
,
_
:
&
'hir
hir
::
ForeignItem
<
'hir
>
)
{}
fn
visit_foreign_item
<
'hir
>
(
&
mut
self
,
_
:
&
'hir
hir
::
ForeignItem
<
'hir
>
)
{}
}
#[derive(Copy,
Clone)]
...
...
compiler/rustc_passes/src/dead.rs
浏览文件 @
eb3cc132
...
...
@@ -150,7 +150,7 @@ fn handle_assign(&mut self, expr: &'tcx hir::Expr<'tcx>) {
#[allow(dead_code)]
// FIXME(81658): should be used + lint reinstated after #83171 relands.
fn
check_for_self_assign
(
&
mut
self
,
assign
:
&
'tcx
hir
::
Expr
<
'tcx
>
)
{
fn
check_for_self_assign_helper
(
fn
check_for_self_assign_helper
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
typeck_results
:
&
'tcx
ty
::
TypeckResults
<
'tcx
>
,
lhs
:
&
'tcx
hir
::
Expr
<
'tcx
>
,
...
...
@@ -600,7 +600,7 @@ struct DeadVisitor<'tcx> {
live_symbols
:
FxHashSet
<
LocalDefId
>
,
}
impl
DeadVisitor
<
'tcx
>
{
impl
<
'tcx
>
DeadVisitor
<
'tcx
>
{
fn
should_warn_about_item
(
&
mut
self
,
item
:
&
hir
::
Item
<
'_
>
)
->
bool
{
let
should_warn
=
matches!
(
item
.kind
,
...
...
@@ -672,7 +672,7 @@ fn warn_dead_code(
}
}
impl
Visitor
<
'tcx
>
for
DeadVisitor
<
'tcx
>
{
impl
<
'tcx
>
Visitor
<
'tcx
>
for
DeadVisitor
<
'tcx
>
{
type
Map
=
Map
<
'tcx
>
;
/// Walk nested items in place so that we don't report dead-code
...
...
compiler/rustc_passes/src/intrinsicck.rs
浏览文件 @
eb3cc132
...
...
@@ -62,7 +62,7 @@ fn unpack_option_like<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
ty
}
impl
ExprVisitor
<
'tcx
>
{
impl
<
'tcx
>
ExprVisitor
<
'tcx
>
{
fn
def_id_is_transmute
(
&
self
,
def_id
:
DefId
)
->
bool
{
self
.tcx
.fn_sig
(
def_id
)
.abi
()
==
RustIntrinsic
&&
self
.tcx
.item_name
(
def_id
)
==
sym
::
transmute
...
...
@@ -487,7 +487,7 @@ fn check_asm(&self, asm: &hir::InlineAsm<'tcx>, hir_id: hir::HirId) {
}
}
impl
Visitor
<
'tcx
>
for
ItemVisitor
<
'tcx
>
{
impl
<
'tcx
>
Visitor
<
'tcx
>
for
ItemVisitor
<
'tcx
>
{
type
Map
=
intravisit
::
ErasedMap
<
'tcx
>
;
fn
nested_visit_map
(
&
mut
self
)
->
NestedVisitorMap
<
Self
::
Map
>
{
...
...
@@ -504,7 +504,7 @@ fn visit_nested_body(&mut self, body_id: hir::BodyId) {
}
}
impl
Visitor
<
'tcx
>
for
ExprVisitor
<
'tcx
>
{
impl
<
'tcx
>
Visitor
<
'tcx
>
for
ExprVisitor
<
'tcx
>
{
type
Map
=
intravisit
::
ErasedMap
<
'tcx
>
;
fn
nested_visit_map
(
&
mut
self
)
->
NestedVisitorMap
<
Self
::
Map
>
{
...
...
compiler/rustc_passes/src/lang_items.rs
浏览文件 @
eb3cc132
...
...
@@ -28,7 +28,7 @@ struct LanguageItemCollector<'tcx> {
tcx
:
TyCtxt
<
'tcx
>
,
}
impl
ItemLikeVisitor
<
'v
>
for
LanguageItemCollector
<
'tcx
>
{
impl
<
'v
,
'tcx
>
ItemLikeVisitor
<
'v
>
for
LanguageItemCollector
<
'tcx
>
{
fn
visit_item
(
&
mut
self
,
item
:
&
hir
::
Item
<
'_
>
)
{
self
.check_for_lang
(
Target
::
from_item
(
item
),
item
.hir_id
());
...
...
@@ -50,7 +50,7 @@ fn visit_impl_item(&mut self, impl_item: &hir::ImplItem<'_>) {
fn
visit_foreign_item
(
&
mut
self
,
_
:
&
hir
::
ForeignItem
<
'_
>
)
{}
}
impl
LanguageItemCollector
<
'tcx
>
{
impl
<
'tcx
>
LanguageItemCollector
<
'tcx
>
{
fn
new
(
tcx
:
TyCtxt
<
'tcx
>
)
->
LanguageItemCollector
<
'tcx
>
{
LanguageItemCollector
{
tcx
,
items
:
LanguageItems
::
new
()
}
}
...
...
compiler/rustc_passes/src/layout_test.rs
浏览文件 @
eb3cc132
...
...
@@ -20,7 +20,7 @@ struct LayoutTest<'tcx> {
tcx
:
TyCtxt
<
'tcx
>
,
}
impl
ItemLikeVisitor
<
'tcx
>
for
LayoutTest
<
'tcx
>
{
impl
<
'tcx
>
ItemLikeVisitor
<
'tcx
>
for
LayoutTest
<
'tcx
>
{
fn
visit_item
(
&
mut
self
,
item
:
&
'tcx
hir
::
Item
<
'tcx
>
)
{
match
item
.kind
{
ItemKind
::
TyAlias
(
..
)
...
...
@@ -42,7 +42,7 @@ fn visit_impl_item(&mut self, _: &'tcx hir::ImplItem<'tcx>) {}
fn
visit_foreign_item
(
&
mut
self
,
_
:
&
'tcx
hir
::
ForeignItem
<
'tcx
>
)
{}
}
impl
LayoutTest
<
'tcx
>
{
impl
<
'tcx
>
LayoutTest
<
'tcx
>
{
fn
dump_layout_of
(
&
self
,
item_def_id
:
LocalDefId
,
item
:
&
hir
::
Item
<
'tcx
>
,
attr
:
&
Attribute
)
{
let
tcx
=
self
.tcx
;
let
param_env
=
self
.tcx
.param_env
(
item_def_id
);
...
...
@@ -114,7 +114,7 @@ struct UnwrapLayoutCx<'tcx> {
param_env
:
ParamEnv
<
'tcx
>
,
}
impl
LayoutOfHelpers
<
'tcx
>
for
UnwrapLayoutCx
<
'tcx
>
{
impl
<
'tcx
>
LayoutOfHelpers
<
'tcx
>
for
UnwrapLayoutCx
<
'tcx
>
{
type
LayoutOfResult
=
TyAndLayout
<
'tcx
>
;
fn
handle_layout_err
(
&
self
,
err
:
LayoutError
<
'tcx
>
,
span
:
Span
,
ty
:
Ty
<
'tcx
>
)
->
!
{
...
...
@@ -127,19 +127,19 @@ fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) ->
}
}
impl
HasTyCtxt
<
'tcx
>
for
UnwrapLayoutCx
<
'tcx
>
{
impl
<
'tcx
>
HasTyCtxt
<
'tcx
>
for
UnwrapLayoutCx
<
'tcx
>
{
fn
tcx
(
&
self
)
->
TyCtxt
<
'tcx
>
{
self
.tcx
}
}
impl
HasParamEnv
<
'tcx
>
for
UnwrapLayoutCx
<
'tcx
>
{
impl
<
'tcx
>
HasParamEnv
<
'tcx
>
for
UnwrapLayoutCx
<
'tcx
>
{
fn
param_env
(
&
self
)
->
ParamEnv
<
'tcx
>
{
self
.param_env
}
}
impl
HasDataLayout
for
UnwrapLayoutCx
<
'tcx
>
{
impl
<
'tcx
>
HasDataLayout
for
UnwrapLayoutCx
<
'tcx
>
{
fn
data_layout
(
&
self
)
->
&
TargetDataLayout
{
self
.tcx
.data_layout
()
}
...
...
compiler/rustc_passes/src/lib.rs
浏览文件 @
eb3cc132
...
...
@@ -6,7 +6,6 @@
#![doc(html_root_url
=
"https://doc.rust-lang.org/nightly/nightly-rustc/"
)]
#![feature(crate_visibility_modifier)]
#![feature(in_band_lifetimes)]
#![feature(map_try_insert)]
#![feature(min_specialization)]
#![feature(nll)]
...
...
compiler/rustc_passes/src/lib_features.rs
浏览文件 @
eb3cc132
...
...
@@ -23,7 +23,7 @@ pub struct LibFeatureCollector<'tcx> {
lib_features
:
LibFeatures
,
}
impl
LibFeatureCollector
<
'tcx
>
{
impl
<
'tcx
>
LibFeatureCollector
<
'tcx
>
{
fn
new
(
tcx
:
TyCtxt
<
'tcx
>
)
->
LibFeatureCollector
<
'tcx
>
{
LibFeatureCollector
{
tcx
,
lib_features
:
new_lib_features
()
}
}
...
...
@@ -110,7 +110,7 @@ fn span_feature_error(&self, span: Span, msg: &str) {
}
}
impl
Visitor
<
'tcx
>
for
LibFeatureCollector
<
'tcx
>
{
impl
<
'tcx
>
Visitor
<
'tcx
>
for
LibFeatureCollector
<
'tcx
>
{
type
Map
=
Map
<
'tcx
>
;
fn
nested_visit_map
(
&
mut
self
)
->
NestedVisitorMap
<
Self
::
Map
>
{
...
...
compiler/rustc_passes/src/liveness.rs
浏览文件 @
eb3cc132
...
...
@@ -198,7 +198,7 @@ struct IrMaps<'tcx> {
lnks
:
IndexVec
<
LiveNode
,
LiveNodeKind
>
,
}
impl
IrMaps
<
'tcx
>
{
impl
<
'tcx
>
IrMaps
<
'tcx
>
{
fn
new
(
tcx
:
TyCtxt
<
'tcx
>
)
->
IrMaps
<
'tcx
>
{
IrMaps
{
tcx
,
...
...
compiler/rustc_passes/src/naked_functions.rs
浏览文件 @
eb3cc132
...
...
@@ -37,7 +37,7 @@ fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
fn
visit_fn
(
&
mut
self
,
fk
:
FnKind
<
'
v
>
,
fk
:
FnKind
<
'
_
>
,
_
fd
:
&
'tcx
hir
::
FnDecl
<
'tcx
>
,
body_id
:
hir
::
BodyId
,
span
:
Span
,
...
...
compiler/rustc_passes/src/reachable.rs
浏览文件 @
eb3cc132
...
...
@@ -22,7 +22,7 @@
// Returns true if the given item must be inlined because it may be
// monomorphized or it was marked with `#[inline]`. This will only return
// true for functions.
fn
item_might_be_inlined
(
tcx
:
TyCtxt
<
'
tcx
>
,
item
:
&
hir
::
Item
<
'_
>
,
attrs
:
&
CodegenFnAttrs
)
->
bool
{
fn
item_might_be_inlined
(
tcx
:
TyCtxt
<
'
_
>
,
item
:
&
hir
::
Item
<
'_
>
,
attrs
:
&
CodegenFnAttrs
)
->
bool
{
if
attrs
.requests_inline
()
{
return
true
;
}
...
...
compiler/rustc_passes/src/stability.rs
浏览文件 @
eb3cc132
...
...
@@ -655,7 +655,7 @@ fn visit_foreign_item(&mut self, i: &'tcx hir::ForeignItem<'tcx>) {
// stable (assuming they have not inherited instability from their parent).
}
fn
stability_index
(
tcx
:
TyCtxt
<
'tcx
>
,
():
())
->
Index
<
'tcx
>
{
fn
stability_index
<
'tcx
>
(
tcx
:
TyCtxt
<
'tcx
>
,
():
())
->
Index
<
'tcx
>
{
let
is_staged_api
=
tcx
.sess.opts.debugging_opts.force_unstable_if_unmarked
||
tcx
.features
()
.staged_api
;
let
mut
staged_api
=
FxHashMap
::
default
();
...
...
@@ -737,7 +737,7 @@ struct Checker<'tcx> {
tcx
:
TyCtxt
<
'tcx
>
,
}
impl
Visitor
<
'tcx
>
for
Checker
<
'tcx
>
{
impl
<
'tcx
>
Visitor
<
'tcx
>
for
Checker
<
'tcx
>
{
type
Map
=
Map
<
'tcx
>
;
/// Because stability levels are scoped lexically, we want to walk
...
...
@@ -866,7 +866,7 @@ struct CheckTraitImplStable<'tcx> {
fully_stable
:
bool
,
}
impl
Visitor
<
'tcx
>
for
CheckTraitImplStable
<
'tcx
>
{
impl
<
'tcx
>
Visitor
<
'tcx
>
for
CheckTraitImplStable
<
'tcx
>
{
type
Map
=
Map
<
'tcx
>
;
fn
nested_visit_map
(
&
mut
self
)
->
NestedVisitorMap
<
Self
::
Map
>
{
...
...
compiler/rustc_passes/src/upvars.rs
浏览文件 @
eb3cc132
...
...
@@ -42,7 +42,7 @@ struct LocalCollector {
locals
:
FxHashSet
<
HirId
>
,
}
impl
Visitor
<
'tcx
>
for
LocalCollector
{
impl
<
'tcx
>
Visitor
<
'tcx
>
for
LocalCollector
{
type
Map
=
intravisit
::
ErasedMap
<
'tcx
>
;
fn
nested_visit_map
(
&
mut
self
)
->
NestedVisitorMap
<
Self
::
Map
>
{
...
...
@@ -71,7 +71,7 @@ fn visit_local_use(&mut self, var_id: HirId, span: Span) {
}
}
impl
Visitor
<
'tcx
>
for
CaptureCollector
<
'a
,
'tcx
>
{
impl
<
'tcx
>
Visitor
<
'tcx
>
for
CaptureCollector
<
'_
,
'tcx
>
{
type
Map
=
intravisit
::
ErasedMap
<
'tcx
>
;
fn
nested_visit_map
(
&
mut
self
)
->
NestedVisitorMap
<
Self
::
Map
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录