Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
7363674f
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,发现更多精彩内容 >>
提交
7363674f
编写于
1月 08, 2017
作者:
V
Vadim Petrochenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix ICE when variant is used as a part of associated type
上级
7ac9d337
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
5 deletion
+24
-5
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+5
-3
src/test/compile-fail/resolve-variant-assoc-item.rs
src/test/compile-fail/resolve-variant-assoc-item.rs
+17
-0
src/test/compile-fail/ufcs-partially-resolved.rs
src/test/compile-fail/ufcs-partially-resolved.rs
+2
-2
未找到文件。
src/librustc_resolve/lib.rs
浏览文件 @
7363674f
...
...
@@ -2410,13 +2410,15 @@ fn resolve_path(&mut self,
match
binding
{
Ok
(
binding
)
=>
{
let
def
=
binding
.def
();
let
maybe_assoc
=
opt_ns
!=
Some
(
MacroNS
)
&&
PathSource
::
Type
.is_expected
(
def
);
if
let
Some
(
next_module
)
=
binding
.module
()
{
module
=
Some
(
next_module
);
}
else
if
binding
.def
()
==
Def
::
Err
{
}
else
if
def
==
Def
::
Err
{
return
PathResult
::
NonModule
(
err_path_resolution
());
}
else
if
opt_ns
.is_some
()
&&
!
(
opt_ns
==
Some
(
MacroNS
)
&&
!
is_last
)
{
}
else
if
opt_ns
.is_some
()
&&
(
is_last
||
maybe_assoc
)
{
return
PathResult
::
NonModule
(
PathResolution
{
base_def
:
binding
.def
()
,
base_def
:
def
,
depth
:
path
.len
()
-
i
-
1
,
});
}
else
{
...
...
src/test/compile-fail/resolve-variant-assoc-item.rs
0 → 100644
浏览文件 @
7363674f
// Copyright 2016 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.
enum
E
{
V
}
use
E
::
V
;
fn
main
()
{
E
::
V
::
associated_item
;
//~ ERROR failed to resolve. Not a module `V`
V
::
associated_item
;
//~ ERROR failed to resolve. Not a module `V`
}
src/test/compile-fail/ufcs-partially-resolved.rs
浏览文件 @
7363674f
...
...
@@ -55,9 +55,9 @@ fn main() {
<
u8
as
E
::
N
>
::
NN
;
//~ ERROR unresolved method or associated constant `E::N::NN`
<
u8
as
A
::
N
>
::
NN
;
//~ ERROR unresolved method or associated constant `A::N::NN`
let
_
:
<
u8
as
Tr
::
Y
>
::
NN
;
//~ ERROR unresolved associated type `Tr::Y::NN`
let
_
:
<
u8
as
E
::
Y
>
::
NN
;
//~ ERROR
unresolved associated type `E::Y::NN
`
let
_
:
<
u8
as
E
::
Y
>
::
NN
;
//~ ERROR
failed to resolve. Not a module `Y
`
<
u8
as
Tr
::
Y
>
::
NN
;
//~ ERROR unresolved method or associated constant `Tr::Y::NN`
<
u8
as
E
::
Y
>
::
NN
;
//~ ERROR
unresolved method or associated constant `E::Y::NN
`
<
u8
as
E
::
Y
>
::
NN
;
//~ ERROR
failed to resolve. Not a module `Y
`
let
_
:
<
u8
as
Dr
>
::
Z
;
//~ ERROR expected associated type, found method `Dr::Z`
<
u8
as
Dr
>
::
X
;
//~ ERROR expected method or associated constant, found associated type `Dr::X`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录