Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
60a836fc
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,发现更多精彩内容 >>
提交
60a836fc
编写于
3月 17, 2016
作者:
J
Jeffrey Seyfried
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary `pub`s
上级
227cc5cd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
24 deletion
+20
-24
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+14
-18
src/librustc_resolve/resolve_imports.rs
src/librustc_resolve/resolve_imports.rs
+6
-6
未找到文件。
src/librustc_resolve/lib.rs
浏览文件 @
60a836fc
...
...
@@ -95,7 +95,7 @@
// NB: This module needs to be declared first so diagnostics are
// registered before they are used.
pub
mod
diagnostics
;
mod
diagnostics
;
mod
check_unused
;
mod
build_reduced_graph
;
...
...
@@ -119,12 +119,12 @@ enum SuggestionType {
}
/// Candidates for a name resolution failure
pub
struct
SuggestedCandidates
{
struct
SuggestedCandidates
{
name
:
String
,
candidates
:
Vec
<
Path
>
,
}
pub
enum
ResolutionError
<
'a
>
{
enum
ResolutionError
<
'a
>
{
/// error E0401: can't use type parameters from outer function
TypeParametersFromOuterFunction
,
/// error E0402: cannot use an outer type parameter in this context
...
...
@@ -201,7 +201,7 @@ pub enum ResolutionError<'a> {
/// Context of where `ResolutionError::UnresolvedName` arose.
#[derive(Clone,
PartialEq,
Eq,
Debug)]
pub
enum
UnresolvedNameContext
{
enum
UnresolvedNameContext
{
/// `PathIsMod(id)` indicates that a given path, used in
/// expression context, actually resolved to a module rather than
/// a value. The `id` attached to the variant is the node id of
...
...
@@ -1131,7 +1131,7 @@ pub struct Resolver<'a, 'tcx: 'a> {
arenas
:
&
'a
ResolverArenas
<
'a
>
,
}
pub
struct
ResolverArenas
<
'a
>
{
struct
ResolverArenas
<
'a
>
{
modules
:
arena
::
TypedArena
<
ModuleS
<
'a
>>
,
name_bindings
:
arena
::
TypedArena
<
NameBinding
<
'a
>>
,
import_directives
:
arena
::
TypedArena
<
ImportDirective
>
,
...
...
@@ -2584,12 +2584,8 @@ fn resolve_possibly_assoc_item(&mut self,
/// Skips `path_depth` trailing segments, which is also reflected in the
/// returned value. See `middle::def::PathResolution` for more info.
pub
fn
resolve_path
(
&
mut
self
,
id
:
NodeId
,
path
:
&
Path
,
path_depth
:
usize
,
namespace
:
Namespace
)
->
Option
<
PathResolution
>
{
fn
resolve_path
(
&
mut
self
,
id
:
NodeId
,
path
:
&
Path
,
path_depth
:
usize
,
namespace
:
Namespace
)
->
Option
<
PathResolution
>
{
let
span
=
path
.span
;
let
segments
=
&
path
.segments
[
..
path
.segments
.len
()
-
path_depth
];
...
...
@@ -3658,13 +3654,13 @@ pub fn resolve_crate<'a, 'tcx>(session: &'a Session,
/// preserving the ribs + current module. This allows resolve_path
/// calls to be made with the correct scope info. The node in the
/// callback corresponds to the current node in the walk.
pub
fn
create_resolver
<
'a
,
'tcx
>
(
session
:
&
'a
Session
,
ast_map
:
&
'a
hir_map
::
Map
<
'tcx
>
,
krate
:
&
'a
Crate
,
make_glob_map
:
MakeGlobMap
,
arenas
:
&
'a
ResolverArenas
<
'a
>
,
callback
:
Option
<
Box
<
Fn
(
hir_map
::
Node
,
&
mut
bool
)
->
bool
>>
)
->
Resolver
<
'a
,
'tcx
>
{
fn
create_resolver
<
'a
,
'tcx
>
(
session
:
&
'a
Session
,
ast_map
:
&
'a
hir_map
::
Map
<
'tcx
>
,
krate
:
&
'a
Crate
,
make_glob_map
:
MakeGlobMap
,
arenas
:
&
'a
ResolverArenas
<
'a
>
,
callback
:
Option
<
Box
<
Fn
(
hir_map
::
Node
,
&
mut
bool
)
->
bool
>>
)
->
Resolver
<
'a
,
'tcx
>
{
let
mut
resolver
=
Resolver
::
new
(
session
,
ast_map
,
make_glob_map
,
arenas
);
resolver
.callback
=
callback
;
...
...
src/librustc_resolve/resolve_imports.rs
浏览文件 @
60a836fc
...
...
@@ -58,12 +58,12 @@ pub fn single(target: Name, source: Name) -> Self {
/// One import directive.
#[derive(Debug,Clone)]
pub
struct
ImportDirective
{
pub
module_path
:
Vec
<
Name
>
,
pub
subclass
:
ImportDirectiveSubclass
,
pub
span
:
Span
,
pub
id
:
NodeId
,
pub
is_public
:
bool
,
// see note in ImportResolutionPerNamespace about how to use this
pub
is_prelude
:
bool
,
module_path
:
Vec
<
Name
>
,
subclass
:
ImportDirectiveSubclass
,
span
:
Span
,
id
:
NodeId
,
is_public
:
bool
,
// see note in ImportResolutionPerNamespace about how to use this
is_prelude
:
bool
,
}
impl
ImportDirective
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录