Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
9f117144
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,发现更多精彩内容 >>
提交
9f117144
编写于
5月 22, 2018
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pacify the mercilous tidy
上级
60c4eb45
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
5 deletion
+29
-5
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+21
-3
src/librustc_resolve/resolve_imports.rs
src/librustc_resolve/resolve_imports.rs
+8
-2
未找到文件。
src/librustc_resolve/lib.rs
浏览文件 @
9f117144
...
...
@@ -1660,7 +1660,13 @@ fn resolve_hir_path_cb<F>(&mut self, path: &mut hir::Path, is_value: bool, error
PathResult
::
Module
(
module
)
=>
*
def
=
module
.def
()
.unwrap
(),
PathResult
::
NonModule
(
path_res
)
if
path_res
.unresolved_segments
()
==
0
=>
*
def
=
path_res
.base_def
(),
PathResult
::
NonModule
(
..
)
=>
match
self
.resolve_path
(
&
path
,
None
,
true
,
span
,
CrateLint
::
No
)
{
PathResult
::
NonModule
(
..
)
=>
match
self
.resolve_path
(
&
path
,
None
,
true
,
span
,
CrateLint
::
No
,
)
{
PathResult
::
Failed
(
span
,
msg
,
_
)
=>
{
error_callback
(
self
,
span
,
ResolutionError
::
FailedToResolve
(
&
msg
));
}
...
...
@@ -3175,7 +3181,13 @@ fn resolve_qpath(&mut self,
));
}
let
result
=
match
self
.resolve_path
(
&
path
,
Some
(
ns
),
true
,
span
,
CrateLint
::
SimplePath
(
id
))
{
let
result
=
match
self
.resolve_path
(
&
path
,
Some
(
ns
),
true
,
span
,
CrateLint
::
SimplePath
(
id
),
)
{
PathResult
::
NonModule
(
path_res
)
=>
path_res
,
PathResult
::
Module
(
module
)
if
!
module
.is_normal
()
=>
{
PathResolution
::
new
(
module
.def
()
.unwrap
())
...
...
@@ -3212,7 +3224,13 @@ fn resolve_qpath(&mut self,
path
[
0
]
.name
!=
keywords
::
CrateRoot
.name
()
&&
path
[
0
]
.name
!=
keywords
::
DollarCrate
.name
()
{
let
unqualified_result
=
{
match
self
.resolve_path
(
&
[
*
path
.last
()
.unwrap
()],
Some
(
ns
),
false
,
span
,
CrateLint
::
No
)
{
match
self
.resolve_path
(
&
[
*
path
.last
()
.unwrap
()],
Some
(
ns
),
false
,
span
,
CrateLint
::
No
,
)
{
PathResult
::
NonModule
(
path_res
)
=>
path_res
.base_def
(),
PathResult
::
Module
(
module
)
=>
module
.def
()
.unwrap
(),
_
=>
return
Some
(
result
),
...
...
src/librustc_resolve/resolve_imports.rs
浏览文件 @
9f117144
...
...
@@ -60,7 +60,7 @@ pub struct ImportDirective<'a> {
/// In the case where the `ImportDirective` was expanded from a "nested" use tree,
/// this id is the id of the leaf tree. For example:
///
/// ```
rust,ignore
/// ```
ignore (pacify the mercilous tidy)
/// use foo::bar::{a, b}
/// ```
///
...
...
@@ -737,7 +737,13 @@ fn finalize_import(&mut self, directive: &'b ImportDirective<'b>) -> Option<(Spa
}
}
let
module_result
=
self
.resolve_path
(
&
module_path
,
None
,
true
,
span
,
directive
.crate_lint
());
let
module_result
=
self
.resolve_path
(
&
module_path
,
None
,
true
,
span
,
directive
.crate_lint
(),
);
let
module
=
match
module_result
{
PathResult
::
Module
(
module
)
=>
module
,
PathResult
::
Failed
(
span
,
msg
,
false
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录