Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
9ffe9bea
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,发现更多精彩内容 >>
提交
9ffe9bea
编写于
4月 20, 2018
作者:
T
Tyler Mandry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove methods with implicit Binder::skip_bound
Fixes #20664.
上级
98546f8b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
22 deletion
+11
-22
src/librustc/traits/mod.rs
src/librustc/traits/mod.rs
+7
-4
src/librustc/traits/select.rs
src/librustc/traits/select.rs
+2
-1
src/librustc/ty/sty.rs
src/librustc/ty/sty.rs
+0
-15
src/librustc_typeck/check/closure.rs
src/librustc_typeck/check/closure.rs
+1
-1
src/librustc_typeck/check/method/probe.rs
src/librustc_typeck/check/method/probe.rs
+1
-1
未找到文件。
src/librustc/traits/mod.rs
浏览文件 @
9ffe9bea
...
...
@@ -855,16 +855,19 @@ fn vtable_methods<'a, 'tcx>(
// the method may have some early-bound lifetimes, add
// regions for those
let
substs
=
Substs
::
for_item
(
tcx
,
def_id
,
|
_
,
_
|
tcx
.types.re_erased
,
|
def
,
_
|
trait_ref
.substs
()
.type_for_def
(
def
));
let
substs
=
trait_ref
.map_bound
(|
trait_ref
|
{
Substs
::
for_item
(
tcx
,
def_id
,
|
_
,
_
|
tcx
.types.re_erased
,
|
def
,
_
|
trait_ref
.substs
.type_for_def
(
def
))
});
// the trait type may have higher-ranked lifetimes in it;
// so erase them if they appear, so that we get the type
// at some particular call site
let
substs
=
tcx
.normalize_erasing_late_bound_regions
(
ty
::
ParamEnv
::
reveal_all
(),
&
ty
::
Binder
::
bind
(
substs
),
&
substs
);
// It's possible that the method relies on where clauses that
...
...
src/librustc/traits/select.rs
浏览文件 @
9ffe9bea
...
...
@@ -786,7 +786,8 @@ fn evaluate_stack<'o>(&mut self,
// This suffices to allow chains like `FnMut` implemented in
// terms of `Fn` etc, but we could probably make this more
// precise still.
let
unbound_input_types
=
stack
.fresh_trait_ref
.input_types
()
.any
(|
ty
|
ty
.is_fresh
());
let
unbound_input_types
=
stack
.fresh_trait_ref
.skip_binder
()
.input_types
()
.any
(|
ty
|
ty
.is_fresh
());
// this check was an imperfect workaround for a bug n the old
// intercrate mode, it should be removed when that goes away.
if
unbound_input_types
&&
...
...
src/librustc/ty/sty.rs
浏览文件 @
9ffe9bea
...
...
@@ -574,16 +574,6 @@ pub fn def_id(&self) -> DefId {
self
.skip_binder
()
.def_id
}
pub
fn
substs
(
&
self
)
->
&
'tcx
Substs
<
'tcx
>
{
// FIXME(#20664) every use of this fn is probably a bug, it should yield Binder<>
self
.skip_binder
()
.substs
}
pub
fn
input_types
<
'a
>
(
&
'a
self
)
->
impl
DoubleEndedIterator
<
Item
=
Ty
<
'tcx
>>
+
'a
{
// FIXME(#20664) every use of this fn is probably a bug, it should yield Binder<>
self
.skip_binder
()
.input_types
()
}
pub
fn
to_poly_trait_predicate
(
&
self
)
->
ty
::
PolyTraitPredicate
<
'tcx
>
{
// Note that we preserve binding levels
Binder
(
ty
::
TraitPredicate
{
trait_ref
:
self
.skip_binder
()
.clone
()
})
...
...
@@ -635,11 +625,6 @@ impl<'tcx> PolyExistentialTraitRef<'tcx> {
pub
fn
def_id
(
&
self
)
->
DefId
{
self
.skip_binder
()
.def_id
}
pub
fn
input_types
<
'a
>
(
&
'a
self
)
->
impl
DoubleEndedIterator
<
Item
=
Ty
<
'tcx
>>
+
'a
{
// FIXME(#20664) every use of this fn is probably a bug, it should yield Binder<>
self
.skip_binder
()
.input_types
()
}
}
/// Binder is a binder for higher-ranked lifetimes. It is part of the
...
...
src/librustc_typeck/check/closure.rs
浏览文件 @
9ffe9bea
...
...
@@ -303,7 +303,7 @@ fn deduce_sig_from_projection(
return
None
;
}
let
arg_param_ty
=
trait_ref
.s
ubsts
()
.type_at
(
1
);
let
arg_param_ty
=
trait_ref
.s
kip_binder
()
.substs
.type_at
(
1
);
let
arg_param_ty
=
self
.resolve_type_vars_if_possible
(
&
arg_param_ty
);
debug!
(
"deduce_sig_from_projection: arg_param_ty {:?}"
,
...
...
src/librustc_typeck/check/method/probe.rs
浏览文件 @
9ffe9bea
...
...
@@ -1485,7 +1485,7 @@ fn to_unadjusted_pick(&self) -> Pick<'tcx> {
// inference variables or other artifacts. This
// means they are safe to put into the
// `WhereClausePick`.
assert
!
(
!
trait_ref
.s
ubsts
()
.needs_infer
());
assert
!
(
!
trait_ref
.s
kip_binder
()
.substs
.needs_infer
());
WhereClausePick
(
trait_ref
.clone
())
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录