Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
24a0caec
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,发现更多精彩内容 >>
提交
24a0caec
编写于
3月 27, 2019
作者:
T
Taiki Endo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
librustc_driver => 2018
上级
07d35089
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
45 deletion
+23
-45
src/librustc_driver/Cargo.toml
src/librustc_driver/Cargo.toml
+3
-2
src/librustc_driver/lib.rs
src/librustc_driver/lib.rs
+2
-29
src/librustc_driver/pretty.rs
src/librustc_driver/pretty.rs
+18
-14
未找到文件。
src/librustc_driver/Cargo.toml
浏览文件 @
24a0caec
...
...
@@ -2,6 +2,7 @@
authors
=
[
"The Rust Project Developers"
]
name
=
"rustc_driver"
version
=
"0.0.0"
edition
=
"2018"
[lib]
name
=
"rustc_driver"
...
...
@@ -13,14 +14,14 @@ arena = { path = "../libarena" }
graphviz
=
{
path
=
"../libgraphviz"
}
log
=
"0.4"
env_logger
=
{
version
=
"0.5"
,
default-features
=
false
}
r
ustc-rayon
=
"0.1.2"
r
ayon
=
{
version
=
"0.1.2"
,
package
=
"rustc-rayon"
}
scoped-tls
=
"1.0"
rustc
=
{
path
=
"../librustc"
}
rustc_allocator
=
{
path
=
"../librustc_allocator"
}
rustc_target
=
{
path
=
"../librustc_target"
}
rustc_borrowck
=
{
path
=
"../librustc_borrowck"
}
rustc_data_structures
=
{
path
=
"../librustc_data_structures"
}
rustc_errors
=
{
path
=
"../lib
rustc_errors"
}
errors
=
{
path
=
"../librustc_errors"
,
package
=
"
rustc_errors"
}
rustc_incremental
=
{
path
=
"../librustc_incremental"
}
rustc_lint
=
{
path
=
"../librustc_lint"
}
rustc_metadata
=
{
path
=
"../librustc_metadata"
}
...
...
src/librustc_driver/lib.rs
浏览文件 @
24a0caec
...
...
@@ -16,40 +16,13 @@
#![recursion_limit=
"256"
]
extern
crate
arena
;
#![deny(rust_2018_idioms)]
pub
extern
crate
getopts
;
extern
crate
graphviz
;
extern
crate
env_logger
;
#[cfg(unix)]
extern
crate
libc
;
extern
crate
rustc_rayon
as
rayon
;
extern
crate
rustc
;
extern
crate
rustc_allocator
;
extern
crate
rustc_target
;
extern
crate
rustc_borrowck
;
extern
crate
rustc_data_structures
;
extern
crate
rustc_errors
as
errors
;
extern
crate
rustc_passes
;
extern
crate
rustc_lint
;
extern
crate
rustc_plugin
;
extern
crate
rustc_privacy
;
extern
crate
rustc_incremental
;
extern
crate
rustc_metadata
;
extern
crate
rustc_mir
;
extern
crate
rustc_resolve
;
extern
crate
rustc_save_analysis
;
extern
crate
rustc_traits
;
extern
crate
rustc_codegen_utils
;
extern
crate
rustc_typeck
;
extern
crate
rustc_interface
;
extern
crate
scoped_tls
;
extern
crate
serialize
;
extern
crate
smallvec
;
#[macro_use]
extern
crate
log
;
extern
crate
syntax
;
extern
crate
syntax_ext
;
extern
crate
syntax_pos
;
use
pretty
::{
PpMode
,
UserIdentifiedItem
};
...
...
src/librustc_driver/pretty.rs
浏览文件 @
24a0caec
...
...
@@ -35,9 +35,9 @@
pub
use
self
::
PpSourceMode
::
*
;
pub
use
self
::
PpMode
::
*
;
use
self
::
NodesMatchingUII
::
*
;
use
abort_on_err
;
use
crate
::
abort_on_err
;
use
source_name
;
use
crate
::
source_name
;
#[derive(Copy,
Clone,
PartialEq,
Debug)]
pub
enum
PpSourceMode
{
...
...
@@ -191,7 +191,7 @@ fn call_with_pp_support_hir<'tcx, A, F>(
tcx
:
TyCtxt
<
'tcx
,
'tcx
,
'tcx
>
,
f
:
F
)
->
A
where
F
:
FnOnce
(
&
dyn
HirPrinterSupport
,
&
hir
::
Crate
)
->
A
where
F
:
FnOnce
(
&
dyn
HirPrinterSupport
<
'_
>
,
&
hir
::
Crate
)
->
A
{
match
*
self
{
PpmNormal
=>
{
...
...
@@ -296,7 +296,7 @@ fn pp_ann<'a>(&'a self) -> &'a dyn pprust_hir::PpAnn {
impl
<
'hir
>
pprust
::
PpAnn
for
NoAnn
<
'hir
>
{}
impl
<
'hir
>
pprust_hir
::
PpAnn
for
NoAnn
<
'hir
>
{
fn
nested
(
&
self
,
state
:
&
mut
pprust_hir
::
State
,
nested
:
pprust_hir
::
Nested
)
fn
nested
(
&
self
,
state
:
&
mut
pprust_hir
::
State
<
'_
>
,
nested
:
pprust_hir
::
Nested
)
->
io
::
Result
<
()
>
{
if
let
Some
(
tcx
)
=
self
.tcx
{
pprust_hir
::
PpAnn
::
nested
(
tcx
.hir
(),
state
,
nested
)
...
...
@@ -322,13 +322,13 @@ fn pp_ann<'a>(&'a self) -> &'a dyn pprust::PpAnn {
}
impl
<
'hir
>
pprust
::
PpAnn
for
IdentifiedAnnotation
<
'hir
>
{
fn
pre
(
&
self
,
s
:
&
mut
pprust
::
State
,
node
:
pprust
::
AnnNode
)
->
io
::
Result
<
()
>
{
fn
pre
(
&
self
,
s
:
&
mut
pprust
::
State
<
'_
>
,
node
:
pprust
::
AnnNode
<
'_
>
)
->
io
::
Result
<
()
>
{
match
node
{
pprust
::
AnnNode
::
Expr
(
_
)
=>
s
.popen
(),
_
=>
Ok
(()),
}
}
fn
post
(
&
self
,
s
:
&
mut
pprust
::
State
,
node
:
pprust
::
AnnNode
)
->
io
::
Result
<
()
>
{
fn
post
(
&
self
,
s
:
&
mut
pprust
::
State
<
'_
>
,
node
:
pprust
::
AnnNode
<
'_
>
)
->
io
::
Result
<
()
>
{
match
node
{
pprust
::
AnnNode
::
Ident
(
_
)
|
pprust
::
AnnNode
::
Name
(
_
)
=>
Ok
(()),
...
...
@@ -373,7 +373,7 @@ fn pp_ann<'a>(&'a self) -> &'a dyn pprust_hir::PpAnn {
}
impl
<
'hir
>
pprust_hir
::
PpAnn
for
IdentifiedAnnotation
<
'hir
>
{
fn
nested
(
&
self
,
state
:
&
mut
pprust_hir
::
State
,
nested
:
pprust_hir
::
Nested
)
fn
nested
(
&
self
,
state
:
&
mut
pprust_hir
::
State
<
'_
>
,
nested
:
pprust_hir
::
Nested
)
->
io
::
Result
<
()
>
{
if
let
Some
(
ref
tcx
)
=
self
.tcx
{
pprust_hir
::
PpAnn
::
nested
(
tcx
.hir
(),
state
,
nested
)
...
...
@@ -381,13 +381,13 @@ fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
Ok
(())
}
}
fn
pre
(
&
self
,
s
:
&
mut
pprust_hir
::
State
,
node
:
pprust_hir
::
AnnNode
)
->
io
::
Result
<
()
>
{
fn
pre
(
&
self
,
s
:
&
mut
pprust_hir
::
State
<
'_
>
,
node
:
pprust_hir
::
AnnNode
<
'_
>
)
->
io
::
Result
<
()
>
{
match
node
{
pprust_hir
::
AnnNode
::
Expr
(
_
)
=>
s
.popen
(),
_
=>
Ok
(()),
}
}
fn
post
(
&
self
,
s
:
&
mut
pprust_hir
::
State
,
node
:
pprust_hir
::
AnnNode
)
->
io
::
Result
<
()
>
{
fn
post
(
&
self
,
s
:
&
mut
pprust_hir
::
State
<
'_
>
,
node
:
pprust_hir
::
AnnNode
<
'_
>
)
->
io
::
Result
<
()
>
{
match
node
{
pprust_hir
::
AnnNode
::
Name
(
_
)
=>
Ok
(()),
pprust_hir
::
AnnNode
::
Item
(
item
)
=>
{
...
...
@@ -434,7 +434,7 @@ fn pp_ann(&self) -> &dyn pprust::PpAnn {
}
impl
<
'a
>
pprust
::
PpAnn
for
HygieneAnnotation
<
'a
>
{
fn
post
(
&
self
,
s
:
&
mut
pprust
::
State
,
node
:
pprust
::
AnnNode
)
->
io
::
Result
<
()
>
{
fn
post
(
&
self
,
s
:
&
mut
pprust
::
State
<
'_
>
,
node
:
pprust
::
AnnNode
<
'_
>
)
->
io
::
Result
<
()
>
{
match
node
{
pprust
::
AnnNode
::
Ident
(
&
ast
::
Ident
{
name
,
span
})
=>
{
s
.s
.space
()
?
;
...
...
@@ -476,7 +476,7 @@ fn node_path(&self, id: ast::NodeId) -> Option<String> {
}
impl
<
'a
,
'tcx
>
pprust_hir
::
PpAnn
for
TypedAnnotation
<
'a
,
'tcx
>
{
fn
nested
(
&
self
,
state
:
&
mut
pprust_hir
::
State
,
nested
:
pprust_hir
::
Nested
)
fn
nested
(
&
self
,
state
:
&
mut
pprust_hir
::
State
<
'_
>
,
nested
:
pprust_hir
::
Nested
)
->
io
::
Result
<
()
>
{
let
old_tables
=
self
.tables
.get
();
if
let
pprust_hir
::
Nested
::
Body
(
id
)
=
nested
{
...
...
@@ -486,13 +486,13 @@ fn nested(&self, state: &mut pprust_hir::State, nested: pprust_hir::Nested)
self
.tables
.set
(
old_tables
);
Ok
(())
}
fn
pre
(
&
self
,
s
:
&
mut
pprust_hir
::
State
,
node
:
pprust_hir
::
AnnNode
)
->
io
::
Result
<
()
>
{
fn
pre
(
&
self
,
s
:
&
mut
pprust_hir
::
State
<
'_
>
,
node
:
pprust_hir
::
AnnNode
<
'_
>
)
->
io
::
Result
<
()
>
{
match
node
{
pprust_hir
::
AnnNode
::
Expr
(
_
)
=>
s
.popen
(),
_
=>
Ok
(()),
}
}
fn
post
(
&
self
,
s
:
&
mut
pprust_hir
::
State
,
node
:
pprust_hir
::
AnnNode
)
->
io
::
Result
<
()
>
{
fn
post
(
&
self
,
s
:
&
mut
pprust_hir
::
State
<
'_
>
,
node
:
pprust_hir
::
AnnNode
<
'_
>
)
->
io
::
Result
<
()
>
{
match
node
{
pprust_hir
::
AnnNode
::
Expr
(
expr
)
=>
{
s
.s
.space
()
?
;
...
...
@@ -580,7 +580,11 @@ fn all_matching_node_ids<'a, 'hir>(&'a self,
}
}
fn
to_one_node_id
(
self
,
user_option
:
&
str
,
sess
:
&
Session
,
map
:
&
hir_map
::
Map
)
->
ast
::
NodeId
{
fn
to_one_node_id
(
self
,
user_option
:
&
str
,
sess
:
&
Session
,
map
:
&
hir_map
::
Map
<
'_
>
)
->
ast
::
NodeId
{
let
fail_because
=
|
is_wrong_because
|
->
ast
::
NodeId
{
let
message
=
format!
(
"{} needs NodeId (int) or unique path suffix (b::c::d); got
\
{}, which {}"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录