Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
52294882
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,发现更多精彩内容 >>
提交
52294882
编写于
10月 13, 2018
作者:
V
Vadim Petrochenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Copy extern prelude from resolver to global context
上级
83bb4306
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
9 addition
and
5 deletion
+9
-5
src/librustc/ty/context.rs
src/librustc/ty/context.rs
+2
-1
src/librustc/ty/item_path.rs
src/librustc/ty/item_path.rs
+1
-1
src/librustc/ty/mod.rs
src/librustc/ty/mod.rs
+2
-1
src/librustc_driver/driver.rs
src/librustc_driver/driver.rs
+1
-0
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+1
-1
src/librustc_typeck/check_unused.rs
src/librustc_typeck/check_unused.rs
+1
-1
src/librustdoc/core.rs
src/librustdoc/core.rs
+1
-0
未找到文件。
src/librustc/ty/context.rs
浏览文件 @
52294882
...
...
@@ -936,8 +936,8 @@ pub struct GlobalCtxt<'tcx> {
freevars
:
FxHashMap
<
DefId
,
Lrc
<
Vec
<
hir
::
Freevar
>>>
,
maybe_unused_trait_imports
:
FxHashSet
<
DefId
>
,
maybe_unused_extern_crates
:
Vec
<
(
DefId
,
Span
)
>
,
pub
extern_prelude
:
FxHashSet
<
ast
::
Name
>
,
// Internal cache for metadata decoding. No need to track deps on this.
pub
rcache
:
Lock
<
FxHashMap
<
ty
::
CReaderCacheKey
,
Ty
<
'tcx
>>>
,
...
...
@@ -1223,6 +1223,7 @@ pub fn create_and_enter<F, R>(s: &'tcx Session,
.into_iter
()
.map
(|(
id
,
sp
)|
(
hir
.local_def_id
(
id
),
sp
))
.collect
(),
extern_prelude
:
resolutions
.extern_prelude
,
hir
,
def_path_hash_to_def_id
,
queries
:
query
::
Queries
::
new
(
...
...
src/librustc/ty/item_path.rs
浏览文件 @
52294882
...
...
@@ -289,7 +289,7 @@ pub fn push_item_path<T>(self, buffer: &mut T, def_id: DefId, pushed_prelude_cra
// printing the `CrateRoot` so we don't prepend a `crate::` to paths.
let
mut
is_prelude_crate
=
false
;
if
let
DefPathData
::
CrateRoot
=
self
.def_key
(
parent_did
)
.disambiguated_data.data
{
if
self
.
sess.
extern_prelude
.contains
(
&
data
.as_interned_str
()
.as_symbol
())
{
if
self
.extern_prelude
.contains
(
&
data
.as_interned_str
()
.as_symbol
())
{
is_prelude_crate
=
true
;
}
}
...
...
src/librustc/ty/mod.rs
浏览文件 @
52294882
...
...
@@ -36,7 +36,7 @@
use
ty
::
util
::{
IntTypeExt
,
Discr
};
use
ty
::
walk
::
TypeWalker
;
use
util
::
captures
::
Captures
;
use
util
::
nodemap
::{
NodeSet
,
DefIdMap
,
FxHashMap
};
use
util
::
nodemap
::{
NodeSet
,
DefIdMap
,
FxHashMap
,
FxHashSet
};
use
arena
::
SyncDroplessArena
;
use
session
::
DataTypeKind
;
...
...
@@ -140,6 +140,7 @@ pub struct Resolutions {
pub
maybe_unused_trait_imports
:
NodeSet
,
pub
maybe_unused_extern_crates
:
Vec
<
(
NodeId
,
Span
)
>
,
pub
export_map
:
ExportMap
,
pub
extern_prelude
:
FxHashSet
<
Name
>
,
}
#[derive(Clone,
Copy,
PartialEq,
Eq,
Debug)]
...
...
src/librustc_driver/driver.rs
浏览文件 @
52294882
...
...
@@ -790,6 +790,7 @@ pub fn phase_2_configure_and_expand<F>(
trait_map
:
resolver
.trait_map
,
maybe_unused_trait_imports
:
resolver
.maybe_unused_trait_imports
,
maybe_unused_extern_crates
:
resolver
.maybe_unused_extern_crates
,
extern_prelude
:
resolver
.extern_prelude
,
},
analysis
:
ty
::
CrateAnalysis
{
...
...
src/librustc_resolve/lib.rs
浏览文件 @
52294882
...
...
@@ -1360,7 +1360,7 @@ pub struct Resolver<'a, 'b: 'a> {
graph_root
:
Module
<
'a
>
,
prelude
:
Option
<
Module
<
'a
>>
,
extern_prelude
:
FxHashSet
<
Name
>
,
pub
extern_prelude
:
FxHashSet
<
Name
>
,
/// n.b. This is used only for better diagnostics, not name resolution itself.
has_self
:
FxHashSet
<
DefId
>
,
...
...
src/librustc_typeck/check_unused.rs
浏览文件 @
52294882
...
...
@@ -164,7 +164,7 @@ fn unused_crates_lint<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>) {
// If the extern crate isn't in the extern prelude,
// there is no way it can be written as an `use`.
let
orig_name
=
extern_crate
.orig_name
.unwrap_or
(
item
.name
);
if
!
tcx
.
sess.
extern_prelude
.contains
(
&
orig_name
)
{
if
!
tcx
.extern_prelude
.contains
(
&
orig_name
)
{
continue
;
}
...
...
src/librustdoc/core.rs
浏览文件 @
52294882
...
...
@@ -474,6 +474,7 @@ pub fn run_core(search_paths: SearchPaths,
trait_map
:
resolver
.trait_map
.clone
(),
maybe_unused_trait_imports
:
resolver
.maybe_unused_trait_imports
.clone
(),
maybe_unused_extern_crates
:
resolver
.maybe_unused_extern_crates
.clone
(),
extern_prelude
:
resolver
.extern_prelude
.clone
(),
};
let
analysis
=
ty
::
CrateAnalysis
{
access_levels
:
Lrc
::
new
(
AccessLevels
::
default
()),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录