Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
d4ea2c43
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,发现更多精彩内容 >>
提交
d4ea2c43
编写于
6月 13, 2018
作者:
O
Oliver Schneider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Various cleanups
上级
c53b7632
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
35 addition
and
11 deletion
+35
-11
src/librustc/hir/map/mod.rs
src/librustc/hir/map/mod.rs
+1
-7
src/librustc_mir/monomorphize/collector.rs
src/librustc_mir/monomorphize/collector.rs
+1
-1
src/librustc_typeck/collect.rs
src/librustc_typeck/collect.rs
+1
-3
src/test/run-pass/impl-trait/bounds_regression.rs
src/test/run-pass/impl-trait/bounds_regression.rs
+32
-0
未找到文件。
src/librustc/hir/map/mod.rs
浏览文件 @
d4ea2c43
...
@@ -558,12 +558,6 @@ pub fn body_owner_kind(&self, id: NodeId) -> BodyOwnerKind {
...
@@ -558,12 +558,6 @@ pub fn body_owner_kind(&self, id: NodeId) -> BodyOwnerKind {
pub
fn
ty_param_owner
(
&
self
,
id
:
NodeId
)
->
NodeId
{
pub
fn
ty_param_owner
(
&
self
,
id
:
NodeId
)
->
NodeId
{
match
self
.get
(
id
)
{
match
self
.get
(
id
)
{
NodeItem
(
&
Item
{
node
:
ItemTrait
(
..
),
..
})
=>
id
,
NodeItem
(
&
Item
{
node
:
ItemTrait
(
..
),
..
})
=>
id
,
NodeItem
(
&
Item
{
node
:
ItemExistential
(
ExistTy
{
impl_trait_fn
:
Some
(
did
),
..
}),
..
})
=>
self
.def_index_to_node_id
(
did
.index
),
NodeTyParam
(
_
)
=>
self
.get_parent_node
(
id
),
NodeTyParam
(
_
)
=>
self
.get_parent_node
(
id
),
_
=>
{
_
=>
{
bug!
(
"ty_param_owner: {} not a type parameter"
,
bug!
(
"ty_param_owner: {} not a type parameter"
,
...
@@ -774,7 +768,7 @@ pub fn get_return_block(&self, id: NodeId) -> Option<NodeId> {
...
@@ -774,7 +768,7 @@ pub fn get_return_block(&self, id: NodeId) -> Option<NodeId> {
/// Retrieve the NodeId for `id`'s parent item, or `id` itself if no
/// Retrieve the NodeId for `id`'s parent item, or `id` itself if no
/// parent item is in this map. The "parent item" is the closest parent node
/// parent item is in this map. The "parent item" is the closest parent node
/// in the
AST
which is recorded by the map and is an item, either an item
/// in the
HIR
which is recorded by the map and is an item, either an item
/// in a module, trait, or impl.
/// in a module, trait, or impl.
pub
fn
get_parent
(
&
self
,
id
:
NodeId
)
->
NodeId
{
pub
fn
get_parent
(
&
self
,
id
:
NodeId
)
->
NodeId
{
match
self
.walk_parent_nodes
(
id
,
|
node
|
match
*
node
{
match
self
.walk_parent_nodes
(
id
,
|
node
|
match
*
node
{
...
...
src/librustc_mir/monomorphize/collector.rs
浏览文件 @
d4ea2c43
...
@@ -944,6 +944,7 @@ fn visit_item(&mut self, item: &'v hir::Item) {
...
@@ -944,6 +944,7 @@ fn visit_item(&mut self, item: &'v hir::Item) {
hir
::
ItemTy
(
..
)
|
hir
::
ItemTy
(
..
)
|
hir
::
ItemTrait
(
..
)
|
hir
::
ItemTrait
(
..
)
|
hir
::
ItemTraitAlias
(
..
)
|
hir
::
ItemTraitAlias
(
..
)
|
hir
::
ItemExistential
(
..
)
|
hir
::
ItemMod
(
..
)
=>
{
hir
::
ItemMod
(
..
)
=>
{
// Nothing to do, just keep recursing...
// Nothing to do, just keep recursing...
}
}
...
@@ -958,7 +959,6 @@ fn visit_item(&mut self, item: &'v hir::Item) {
...
@@ -958,7 +959,6 @@ fn visit_item(&mut self, item: &'v hir::Item) {
hir
::
ItemEnum
(
_
,
ref
generics
)
|
hir
::
ItemEnum
(
_
,
ref
generics
)
|
hir
::
ItemStruct
(
_
,
ref
generics
)
|
hir
::
ItemStruct
(
_
,
ref
generics
)
|
hir
::
ItemExistential
(
hir
::
ExistTy
{
ref
generics
,
..
})
|
hir
::
ItemUnion
(
_
,
ref
generics
)
=>
{
hir
::
ItemUnion
(
_
,
ref
generics
)
=>
{
if
generics
.params
.is_empty
()
{
if
generics
.params
.is_empty
()
{
if
self
.mode
==
MonoItemCollectionMode
::
Eager
{
if
self
.mode
==
MonoItemCollectionMode
::
Eager
{
...
...
src/librustc_typeck/collect.rs
浏览文件 @
d4ea2c43
...
@@ -797,7 +797,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
...
@@ -797,7 +797,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
}
}
NodeItem
(
item
)
=>
{
NodeItem
(
item
)
=>
{
match
item
.node
{
match
item
.node
{
ItemExistential
(
hir
::
ExistTy
{
impl_trait_fn
:
parent_did
,
..
})
=>
parent_did
,
ItemExistential
(
hir
::
ExistTy
{
impl_trait_fn
,
..
})
=>
impl_trait_fn
,
_
=>
None
,
_
=>
None
,
}
}
},
},
...
@@ -1353,8 +1353,6 @@ pub fn explicit_predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
...
@@ -1353,8 +1353,6 @@ pub fn explicit_predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let
predicates
=
bounds
.predicates
(
tcx
,
anon_ty
);
let
predicates
=
bounds
.predicates
(
tcx
,
anon_ty
);
debug!
(
"explicit_predicates_of: predicates={:?}"
,
predicates
);
return
ty
::
GenericPredicates
{
return
ty
::
GenericPredicates
{
parent
:
None
,
parent
:
None
,
predicates
:
predicates
predicates
:
predicates
...
...
src/test/run-pass/impl-trait/bounds_regression.rs
0 → 100644
浏览文件 @
d4ea2c43
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
pub
trait
FakeGenerator
{
type
Yield
;
type
Return
;
}
pub
trait
FakeFuture
{
type
Output
;
}
pub
fn
future_from_generator
<
T
:
FakeGenerator
<
Yield
=
()
>
>
(
x
:
T
)
->
impl
FakeFuture
<
Output
=
T
::
Return
>
{
GenFuture
(
x
)
}
struct
GenFuture
<
T
:
FakeGenerator
<
Yield
=
()
>>
(
T
);
impl
<
T
:
FakeGenerator
<
Yield
=
()
>>
FakeFuture
for
GenFuture
<
T
>
{
type
Output
=
T
::
Return
;
}
fn
main
()
{}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录