Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
aca13532
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,发现更多精彩内容 >>
提交
aca13532
编写于
8月 13, 2019
作者:
V
Vadim Petrochenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
resolve: Add some comments to the main modules
上级
310ee4d9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
3 deletion
+26
-3
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/build_reduced_graph.rs
+5
-3
src/librustc_resolve/late.rs
src/librustc_resolve/late.rs
+7
-0
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+9
-0
src/librustc_resolve/macros.rs
src/librustc_resolve/macros.rs
+3
-0
src/librustc_resolve/resolve_imports.rs
src/librustc_resolve/resolve_imports.rs
+2
-0
未找到文件。
src/librustc_resolve/build_reduced_graph.rs
浏览文件 @
aca13532
//! Reduced graph building.
//! After we obtain a fresh AST fragment from a macro, code in this module helps to integrate
//! that fragment into the module structures that are already partially built.
//!
//! Here we build the "reduced graph": the graph of the module tree without
//! any imports resolved.
//! Items from the fragment are placed into modules,
//! unexpanded macros in the fragment are visited and registered.
//! Imports are also considered items and placed into modules here, but not resolved yet.
use
crate
::
macros
::{
LegacyBinding
,
LegacyScope
};
use
crate
::
resolve_imports
::
ImportDirective
;
...
...
src/librustc_resolve/late.rs
浏览文件 @
aca13532
//! "Late resolution" is the pass that resolves most of names in a crate beside imports and macros.
//! It runs when the crate is fully expanded and its module structure is fully built.
//! So it just walks through the crate and resolves all the expressions, types, etc.
//!
//! If you wonder why there's no `early.rs`, that's because it's split into three files -
//! `build_reduced_graph.rs`, `macros.rs` and `resolve_imports.rs`.
use
GenericParameters
::
*
;
use
RibKind
::
*
;
...
...
src/librustc_resolve/lib.rs
浏览文件 @
aca13532
//! This crate is responsible for the part of name resolution that doesn't require type checker.
//!
//! Module structure of the crate is built here.
//! Paths in macros, imports, expressions, types, patterns are resolved here.
//! Label names are resolved here as well.
//!
//! Type-relative name resolution (methods, fields, associated items) happens in `librustc_typeck`.
//! Lifetime names are resolved in `librustc/middle/resolve_lifetime.rs`.
#![doc(html_root_url
=
"https://doc.rust-lang.org/nightly/"
)]
#![feature(crate_visibility_modifier)]
...
...
src/librustc_resolve/macros.rs
浏览文件 @
aca13532
//! A bunch of methods and structures more or less related to resolving macros and
//! interface provided by `Resolver` to macro expander.
use
crate
::{
AmbiguityError
,
AmbiguityKind
,
AmbiguityErrorMisc
,
Determinacy
};
use
crate
::{
CrateLint
,
Resolver
,
ResolutionError
,
Scope
,
ScopeSet
,
ParentScope
,
Weak
};
use
crate
::{
ModuleKind
,
NameBinding
,
PathResult
,
Segment
,
ToNameBinding
};
...
...
src/librustc_resolve/resolve_imports.rs
浏览文件 @
aca13532
//! A bunch of methods and structures more or less related to resolving imports.
use
ImportDirectiveSubclass
::
*
;
use
crate
::{
AmbiguityError
,
AmbiguityKind
,
AmbiguityErrorMisc
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录