Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
1ef3598e
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
1ef3598e
编写于
2月 24, 2015
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge conflicts due to eddyb's UFCS branch
上级
abdb42ba
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
9 deletion
+11
-9
src/librustc_typeck/astconv.rs
src/librustc_typeck/astconv.rs
+9
-7
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/mod.rs
+1
-1
src/librustc_typeck/collect.rs
src/librustc_typeck/collect.rs
+1
-1
未找到文件。
src/librustc_typeck/astconv.rs
浏览文件 @
1ef3598e
...
...
@@ -688,7 +688,7 @@ fn ast_path_to_trait_ref<'a,'tcx>(
->
Rc
<
ty
::
TraitRef
<
'tcx
>>
{
debug!
(
"ast_path_to_trait_ref {:?}"
,
trait_segment
);
let
trait_def
=
match
this
.get_trait_def
(
path
.
span
,
trait_def_id
)
{
let
trait_def
=
match
this
.get_trait_def
(
span
,
trait_def_id
)
{
Ok
(
trait_def
)
=>
trait_def
,
Err
(
ErrorReported
)
=>
{
// No convenient way to recover from a cycle here. Just bail. Sorry!
...
...
@@ -873,17 +873,19 @@ fn ast_path_to_ty<'tcx>(
->
Ty
<
'tcx
>
{
let
tcx
=
this
.tcx
();
let
substs
=
match
this
.get_item_type_scheme
(
path
.
span
,
did
)
{
let
(
generics
,
decl_ty
)
=
match
this
.get_item_type_scheme
(
span
,
did
)
{
Ok
(
ty
::
TypeScheme
{
generics
,
ty
:
decl_ty
})
=>
{
ast_path_substs_for_ty
(
this
,
rscope
,
span
,
param_mode
,
&
generics
,
item_segment
)
(
generics
,
decl_ty
)
}
Err
(
ErrorReported
)
=>
{
return
TypeAndSubsts
{
substs
:
Substs
::
empty
(),
ty
:
tcx
.types.err
}
;
return
tcx
.types.err
;
}
};
let
substs
=
ast_path_substs_for_ty
(
this
,
rscope
,
span
,
param_mode
,
&
generics
,
item_segment
);
// FIXME(#12938): This is a hack until we have full support for DST.
if
Some
(
did
)
==
this
.tcx
()
.lang_items
.owned_box
()
{
assert_eq!
(
substs
.types
.len
(
TypeSpace
),
1
);
...
...
@@ -1020,7 +1022,7 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
// FIXME(#20300) -- search where clauses, not bounds
let
bounds
=
this
.get_type_parameter_bounds
(
ast_ty
.span
,
ty_param_ndo
e_id
)
this
.get_type_parameter_bounds
(
span
,
ty_param_nod
e_id
)
.unwrap_or
(
Vec
::
new
());
let
mut
suitable_bounds
:
Vec
<
_
>
=
...
...
src/librustc_typeck/check/mod.rs
浏览文件 @
1ef3598e
...
...
@@ -3637,7 +3637,7 @@ fn check_struct_fields_on_error<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
}
}
else
{
tcx
.sess
.span_bug
(
expr
.span
,
&
format!
(
"unbound path {}"
,
expr
.repr
(
tcx
))
[]
)
&
format!
(
"unbound path {}"
,
expr
.repr
(
tcx
)))
};
let
mut
def
=
path_res
.base_def
;
...
...
src/librustc_typeck/collect.rs
浏览文件 @
1ef3598e
...
...
@@ -504,7 +504,7 @@ fn is_param<'tcx>(tcx: &ty::ctxt<'tcx>,
->
bool
{
if
let
ast
::
TyPath
(
None
,
_
)
=
ast_ty
.node
{
let
path_res
=
ccx
.
tcx.def_map
.borrow
()[
ast_ty
.id
];
let
path_res
=
tcx
.def_map
.borrow
()[
ast_ty
.id
];
if
let
def
::
DefTyParam
(
_
,
_
,
def_id
,
_
)
=
path_res
.base_def
{
path_res
.depth
==
0
&&
def_id
==
local_def
(
param_id
)
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录