Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
9a0af163
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,发现更多精彩内容 >>
提交
9a0af163
编写于
1月 25, 2017
作者:
E
Eduard-Mihai Burtescu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustc: remove unused `bounds` field from `RegionParameterDef`.
上级
4eac052a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
38 deletion
+12
-38
src/librustc/ty/mod.rs
src/librustc/ty/mod.rs
+5
-6
src/librustc/ty/structural_impls.rs
src/librustc/ty/structural_impls.rs
+1
-17
src/librustc/util/ppaux.rs
src/librustc/util/ppaux.rs
+3
-4
src/librustc_metadata/schema.rs
src/librustc_metadata/schema.rs
+1
-1
src/librustc_typeck/collect.rs
src/librustc_typeck/collect.rs
+0
-3
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+2
-7
未找到文件。
src/librustc/ty/mod.rs
浏览文件 @
9a0af163
...
...
@@ -606,12 +606,11 @@ pub struct TypeParameterDef<'tcx> {
pub
pure_wrt_drop
:
bool
,
}
#[derive(Clone,
RustcEncodable,
RustcDecodable)]
pub
struct
RegionParameterDef
<
'tcx
>
{
#[derive(C
opy,
C
lone,
RustcEncodable,
RustcDecodable)]
pub
struct
RegionParameterDef
{
pub
name
:
Name
,
pub
def_id
:
DefId
,
pub
index
:
u32
,
pub
bounds
:
Vec
<&
'tcx
ty
::
Region
>
,
/// `pure_wrt_drop`, set by the (unsafe) `#[may_dangle]` attribute
/// on generic parameter `'a`, asserts data of lifetime `'a`
...
...
@@ -619,7 +618,7 @@ pub struct RegionParameterDef<'tcx> {
pub
pure_wrt_drop
:
bool
,
}
impl
<
'tcx
>
RegionParameterDef
<
'tcx
>
{
impl
RegionParameterDef
{
pub
fn
to_early_bound_region_data
(
&
self
)
->
ty
::
EarlyBoundRegion
{
ty
::
EarlyBoundRegion
{
index
:
self
.index
,
...
...
@@ -640,7 +639,7 @@ pub struct Generics<'tcx> {
pub
parent
:
Option
<
DefId
>
,
pub
parent_regions
:
u32
,
pub
parent_types
:
u32
,
pub
regions
:
Vec
<
RegionParameterDef
<
'tcx
>
>
,
pub
regions
:
Vec
<
RegionParameterDef
>
,
pub
types
:
Vec
<
TypeParameterDef
<
'tcx
>>
,
pub
has_self
:
bool
,
}
...
...
@@ -658,7 +657,7 @@ pub fn count(&self) -> usize {
self
.parent_count
()
+
self
.own_count
()
}
pub
fn
region_param
(
&
self
,
param
:
&
EarlyBoundRegion
)
->
&
RegionParameterDef
<
'tcx
>
{
pub
fn
region_param
(
&
self
,
param
:
&
EarlyBoundRegion
)
->
&
RegionParameterDef
{
&
self
.regions
[
param
.index
as
usize
-
self
.has_self
as
usize
]
}
...
...
src/librustc/ty/structural_impls.rs
浏览文件 @
9a0af163
...
...
@@ -353,7 +353,7 @@ fn super_visit_with<F: TypeVisitor<'tcx>>(&self, _: &mut F) -> bool {
}
}
CopyImpls!
{
(),
hir
::
Unsafety
,
abi
::
Abi
}
CopyImpls!
{
(),
hir
::
Unsafety
,
abi
::
Abi
,
ty
::
RegionParameterDef
}
impl
<
'tcx
,
T
:
TypeFoldable
<
'tcx
>
,
U
:
TypeFoldable
<
'tcx
>>
TypeFoldable
<
'tcx
>
for
(
T
,
U
)
{
fn
super_fold_with
<
'gcx
:
'tcx
,
F
:
TypeFolder
<
'gcx
,
'tcx
>>
(
&
self
,
folder
:
&
mut
F
)
->
(
T
,
U
)
{
...
...
@@ -735,22 +735,6 @@ fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
}
}
impl
<
'tcx
>
TypeFoldable
<
'tcx
>
for
ty
::
RegionParameterDef
<
'tcx
>
{
fn
super_fold_with
<
'gcx
:
'tcx
,
F
:
TypeFolder
<
'gcx
,
'tcx
>>
(
&
self
,
folder
:
&
mut
F
)
->
Self
{
ty
::
RegionParameterDef
{
name
:
self
.name
,
def_id
:
self
.def_id
,
index
:
self
.index
,
bounds
:
self
.bounds
.fold_with
(
folder
),
pure_wrt_drop
:
self
.pure_wrt_drop
,
}
}
fn
super_visit_with
<
V
:
TypeVisitor
<
'tcx
>>
(
&
self
,
visitor
:
&
mut
V
)
->
bool
{
self
.bounds
.visit_with
(
visitor
)
}
}
impl
<
'tcx
>
TypeFoldable
<
'tcx
>
for
ty
::
Generics
<
'tcx
>
{
fn
super_fold_with
<
'gcx
:
'tcx
,
F
:
TypeFolder
<
'gcx
,
'tcx
>>
(
&
self
,
folder
:
&
mut
F
)
->
Self
{
ty
::
Generics
{
...
...
src/librustc/util/ppaux.rs
浏览文件 @
9a0af163
...
...
@@ -336,13 +336,12 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
}
}
impl
<
'tcx
>
fmt
::
Debug
for
ty
::
RegionParameterDef
<
'tcx
>
{
impl
fmt
::
Debug
for
ty
::
RegionParameterDef
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
)
->
fmt
::
Result
{
write!
(
f
,
"RegionParameterDef({}, {:?}, {}
, {:?}
)"
,
write!
(
f
,
"RegionParameterDef({}, {:?}, {})"
,
self
.name
,
self
.def_id
,
self
.index
,
self
.bounds
)
self
.index
)
}
}
...
...
src/librustc_metadata/schema.rs
浏览文件 @
9a0af163
...
...
@@ -256,7 +256,7 @@ pub struct Generics<'tcx> {
pub
parent
:
Option
<
DefId
>
,
pub
parent_regions
:
u32
,
pub
parent_types
:
u32
,
pub
regions
:
LazySeq
<
ty
::
RegionParameterDef
<
'tcx
>
>
,
pub
regions
:
LazySeq
<
ty
::
RegionParameterDef
>
,
pub
types
:
LazySeq
<
ty
::
TypeParameterDef
<
'tcx
>>
,
pub
has_self
:
bool
,
pub
object_lifetime_defaults
:
LazySeq
<
ObjectLifetimeDefault
>
,
...
...
src/librustc_typeck/collect.rs
浏览文件 @
9a0af163
...
...
@@ -1446,9 +1446,6 @@ fn generics_of_def_id<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
name
:
l
.lifetime.name
,
index
:
own_start
+
i
as
u32
,
def_id
:
tcx
.hir
.local_def_id
(
l
.lifetime.id
),
bounds
:
l
.bounds
.iter
()
.map
(|
l
|
{
AstConv
::
ast_region_to_region
(
&
ccx
.icx
(
&
()),
l
,
None
)
})
.collect
(),
pure_wrt_drop
:
l
.pure_wrt_drop
,
}
})
.collect
::
<
Vec
<
_
>>
();
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
9a0af163
...
...
@@ -794,7 +794,7 @@ fn clean(&self, _: &DocContext) -> Lifetime {
}
}
impl
<
'tcx
>
Clean
<
Lifetime
>
for
ty
::
RegionParameterDef
<
'tcx
>
{
impl
Clean
<
Lifetime
>
for
ty
::
RegionParameterDef
{
fn
clean
(
&
self
,
_
:
&
DocContext
)
->
Lifetime
{
Lifetime
(
self
.name
.to_string
())
}
...
...
@@ -970,11 +970,6 @@ fn clean(&self, cx: &DocContext) -> Generics {
Some
(
tp
.clean
(
cx
))
}
})
.collect
::
<
Vec
<
_
>>
();
let
stripped_lifetimes
=
gens
.regions
.iter
()
.map
(|
rp
|
{
let
mut
srp
=
rp
.clone
();
srp
.bounds
=
Vec
::
new
();
srp
.clean
(
cx
)
})
.collect
::
<
Vec
<
_
>>
();
let
mut
where_predicates
=
preds
.predicates
.to_vec
()
.clean
(
cx
);
...
...
@@ -1017,7 +1012,7 @@ fn clean(&self, cx: &DocContext) -> Generics {
Generics
{
type_params
:
simplify
::
ty_params
(
stripped_typarams
),
lifetimes
:
stripped_lifetimes
,
lifetimes
:
gens
.regions
.clean
(
cx
)
,
where_predicates
:
simplify
::
where_clauses
(
cx
,
where_predicates
),
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录