Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
b5099a70
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,发现更多精彩内容 >>
提交
b5099a70
编写于
2月 04, 2018
作者:
S
Seiichi Uchida
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace dummy spans with empty spans
上级
d6bdf296
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
32 addition
and
25 deletion
+32
-25
src/liblibc
src/liblibc
+1
-1
src/librustc_allocator/expand.rs
src/librustc_allocator/expand.rs
+2
-2
src/librustc_metadata/cstore_impl.rs
src/librustc_metadata/cstore_impl.rs
+1
-1
src/librustc_save_analysis/dump_visitor.rs
src/librustc_save_analysis/dump_visitor.rs
+4
-3
src/libsyntax/diagnostics/plugin.rs
src/libsyntax/diagnostics/plugin.rs
+1
-1
src/libsyntax/ext/build.rs
src/libsyntax/ext/build.rs
+2
-2
src/libsyntax/ext/expand.rs
src/libsyntax/ext/expand.rs
+1
-1
src/libsyntax/ext/quote.rs
src/libsyntax/ext/quote.rs
+2
-2
src/libsyntax/fold.rs
src/libsyntax/fold.rs
+2
-2
src/libsyntax/parse/mod.rs
src/libsyntax/parse/mod.rs
+1
-1
src/libsyntax/print/pprust.rs
src/libsyntax/print/pprust.rs
+2
-2
src/libsyntax/std_inject.rs
src/libsyntax/std_inject.rs
+2
-2
src/libsyntax_ext/deriving/generic/mod.rs
src/libsyntax_ext/deriving/generic/mod.rs
+2
-2
src/libsyntax_ext/global_asm.rs
src/libsyntax_ext/global_asm.rs
+2
-2
src/libsyntax_pos/lib.rs
src/libsyntax_pos/lib.rs
+6
-0
src/tools/cargo
src/tools/cargo
+1
-1
未找到文件。
liblibc
@
2b4cd101
比较
56444a45
...
2b4cd101
Subproject commit
56444a4545bd71430d64b86b8a71714cfdbe9f5d
Subproject commit
2b4cd1016bdba92becb4f982a4dcb18fe6653bc4
src/librustc_allocator/expand.rs
浏览文件 @
b5099a70
...
...
@@ -15,7 +15,7 @@
use
syntax
::
ast
::{
Unsafety
,
Constness
,
Generics
,
Mutability
,
Ty
,
Mac
,
Arg
};
use
syntax
::
ast
::{
self
,
Ident
,
Item
,
ItemKind
,
TyKind
,
VisibilityKind
,
Expr
};
use
syntax
::
attr
;
use
syntax
::
codemap
::
dummy_spanned
;
use
syntax
::
codemap
::
{
dummy_spanned
,
respan
}
;
use
syntax
::
codemap
::{
ExpnInfo
,
NameAndSpan
,
MacroAttribute
};
use
syntax
::
ext
::
base
::
ExtCtxt
;
use
syntax
::
ext
::
base
::
Resolver
;
...
...
@@ -97,7 +97,7 @@ fn fold_item(&mut self, item: P<Item>) -> SmallVector<P<Item>> {
]);
let
mut
items
=
vec!
[
f
.cx
.item_extern_crate
(
f
.span
,
f
.alloc
),
f
.cx
.item_use_simple
(
f
.span
,
dummy_spanned
(
VisibilityKind
::
Inherited
),
super_path
),
f
.cx
.item_use_simple
(
f
.span
,
respan
(
f
.span
.empty
(),
VisibilityKind
::
Inherited
),
super_path
),
];
for
method
in
ALLOCATOR_METHODS
{
items
.push
(
f
.allocator_fn
(
method
));
...
...
src/librustc_metadata/cstore_impl.rs
浏览文件 @
b5099a70
...
...
@@ -497,7 +497,7 @@ fn load_macro_untracked(&self, id: DefId, sess: &Session) -> LoadedMacro {
tokens
:
body
.into
(),
legacy
:
def
.legacy
,
}),
vis
:
codemap
::
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
vis
:
codemap
::
respan
(
local_span
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
tokens
:
None
,
})
}
...
...
src/librustc_save_analysis/dump_visitor.rs
浏览文件 @
b5099a70
...
...
@@ -43,7 +43,7 @@
ty_to_string
};
use
syntax
::
ptr
::
P
;
use
syntax
::
codemap
::{
Spanned
,
DUMMY_SP
,
dummy_spanned
};
use
syntax
::
codemap
::{
Spanned
,
DUMMY_SP
,
respan
};
use
syntax_pos
::
*
;
use
{
escape
,
generated_code
,
lower_attributes
,
PathCollector
,
SaveContext
};
...
...
@@ -1134,6 +1134,7 @@ fn process_macro_use(&mut self, span: Span) {
fn
process_trait_item
(
&
mut
self
,
trait_item
:
&
'l
ast
::
TraitItem
,
trait_id
:
DefId
)
{
self
.process_macro_use
(
trait_item
.span
);
let
vis_span
=
trait_item
.span
.empty
();
match
trait_item
.node
{
ast
::
TraitItemKind
::
Const
(
ref
ty
,
ref
expr
)
=>
{
self
.process_assoc_const
(
...
...
@@ -1143,7 +1144,7 @@ fn process_trait_item(&mut self, trait_item: &'l ast::TraitItem, trait_id: DefId
&
ty
,
expr
.as_ref
()
.map
(|
e
|
&**
e
),
trait_id
,
dummy_spanned
(
ast
::
VisibilityKind
::
Public
),
respan
(
vis_span
,
ast
::
VisibilityKind
::
Public
),
&
trait_item
.attrs
,
);
}
...
...
@@ -1154,7 +1155,7 @@ fn process_trait_item(&mut self, trait_item: &'l ast::TraitItem, trait_id: DefId
trait_item
.id
,
trait_item
.ident
,
&
trait_item
.generics
,
dummy_spanned
(
ast
::
VisibilityKind
::
Public
),
respan
(
vis_span
,
ast
::
VisibilityKind
::
Public
),
trait_item
.span
,
);
}
...
...
src/libsyntax/diagnostics/plugin.rs
浏览文件 @
b5099a70
...
...
@@ -235,7 +235,7 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
ty
,
expr
,
),
vis
:
codemap
::
dummy_spanned
(
ast
::
VisibilityKind
::
Public
),
vis
:
codemap
::
respan
(
span
.empty
(),
ast
::
VisibilityKind
::
Public
),
span
,
tokens
:
None
,
})
...
...
src/libsyntax/ext/build.rs
浏览文件 @
b5099a70
...
...
@@ -987,7 +987,7 @@ fn item(&self, span: Span, name: Ident,
attrs
,
id
:
ast
::
DUMMY_NODE_ID
,
node
,
vis
:
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
vis
:
respan
(
span
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
span
,
tokens
:
None
,
})
...
...
@@ -1033,7 +1033,7 @@ fn variant(&self, span: Span, name: Ident, tys: Vec<P<ast::Ty>> ) -> ast::Varian
span
:
ty
.span
,
ty
,
ident
:
None
,
vis
:
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
vis
:
respan
(
span
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
attrs
:
Vec
::
new
(),
id
:
ast
::
DUMMY_NODE_ID
,
}
...
...
src/libsyntax/ext/expand.rs
浏览文件 @
b5099a70
...
...
@@ -238,7 +238,7 @@ pub fn expand_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
node
:
ast
::
ItemKind
::
Mod
(
krate
.module
),
ident
:
keywords
::
Invalid
.ident
(),
id
:
ast
::
DUMMY_NODE_ID
,
vis
:
dummy_spanned
(
ast
::
VisibilityKind
::
Public
),
vis
:
respan
(
krate
.span
.empty
(),
ast
::
VisibilityKind
::
Public
),
tokens
:
None
,
})));
...
...
src/libsyntax/ext/quote.rs
浏览文件 @
b5099a70
...
...
@@ -9,7 +9,7 @@
// except according to those terms.
use
ast
::{
self
,
Arg
,
Arm
,
Block
,
Expr
,
Item
,
Pat
,
Stmt
,
Ty
};
use
codemap
::
dummy_spanned
;
use
codemap
::
respan
;
use
syntax_pos
::
Span
;
use
ext
::
base
::
ExtCtxt
;
use
ext
::
base
;
...
...
@@ -858,7 +858,7 @@ fn expand_wrapper(cx: &ExtCtxt,
let
path
=
path
.iter
()
.map
(|
s
|
s
.to_string
())
.collect
();
let
use_item
=
cx
.item_use_glob
(
sp
,
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
respan
(
sp
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
ids_ext
(
path
),
);
cx
.stmt_item
(
sp
,
use_item
)
...
...
src/libsyntax/fold.rs
浏览文件 @
b5099a70
...
...
@@ -21,7 +21,7 @@
use
ast
::
*
;
use
ast
;
use
syntax_pos
::
Span
;
use
codemap
::{
Spanned
,
respan
,
dummy_spanned
};
use
codemap
::{
Spanned
,
respan
};
use
parse
::
token
::{
self
,
Token
};
use
ptr
::
P
;
use
symbol
::
keywords
;
...
...
@@ -1018,7 +1018,7 @@ pub fn noop_fold_crate<T: Folder>(Crate {module, attrs, span}: Crate,
ident
:
keywords
::
Invalid
.ident
(),
attrs
,
id
:
ast
::
DUMMY_NODE_ID
,
vis
:
dummy_spanned
(
ast
::
VisibilityKind
::
Public
),
vis
:
respan
(
span
.empty
(),
ast
::
VisibilityKind
::
Public
),
span
,
node
:
ast
::
ItemKind
::
Mod
(
module
),
tokens
:
None
,
...
...
src/libsyntax/parse/mod.rs
浏览文件 @
b5099a70
...
...
@@ -932,7 +932,7 @@ fn parser_done(p: Parser){
span
:
sp
(
15
,
21
),
recovered
:
false
,
})),
vis
:
codemap
::
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
vis
:
codemap
::
respan
(
sp
(
0
,
0
),
ast
::
VisibilityKind
::
Inherited
),
span
:
sp
(
0
,
21
)})));
}
...
...
src/libsyntax/print/pprust.rs
浏览文件 @
b5099a70
...
...
@@ -1573,7 +1573,7 @@ pub fn print_trait_item(&mut self, ti: &ast::TraitItem)
ti
.ident
,
ty
,
default
.as_ref
()
.map
(|
expr
|
&**
expr
),
&
codemap
::
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
&
codemap
::
respan
(
ti
.span
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
)
?
;
}
ast
::
TraitItemKind
::
Method
(
ref
sig
,
ref
body
)
=>
{
...
...
@@ -1584,7 +1584,7 @@ pub fn print_trait_item(&mut self, ti: &ast::TraitItem)
ti
.ident
,
&
ti
.generics
,
sig
,
&
codemap
::
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
&
codemap
::
respan
(
ti
.span
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
)
?
;
if
let
Some
(
ref
body
)
=
*
body
{
self
.nbsp
()
?
;
...
...
src/libsyntax/std_inject.rs
浏览文件 @
b5099a70
...
...
@@ -14,7 +14,7 @@
use
ext
::
hygiene
::{
Mark
,
SyntaxContext
};
use
symbol
::{
Symbol
,
keywords
};
use
syntax_pos
::{
DUMMY_SP
,
Span
};
use
codemap
::{
ExpnInfo
,
NameAndSpan
,
MacroAttribute
,
dummy_spanned
};
use
codemap
::{
ExpnInfo
,
NameAndSpan
,
MacroAttribute
,
dummy_spanned
,
respan
};
use
ptr
::
P
;
use
tokenstream
::
TokenStream
;
...
...
@@ -78,7 +78,7 @@ pub fn maybe_inject_crates_ref(mut krate: ast::Crate, alt_std_name: Option<Strin
is_sugared_doc
:
false
,
span
,
}],
vis
:
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
vis
:
respan
(
span
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
node
:
ast
::
ItemKind
::
Use
(
P
(
ast
::
UseTree
{
prefix
:
ast
::
Path
{
segments
:
[
"{{root}}"
,
name
,
"prelude"
,
"v1"
]
.into_iter
()
.map
(|
name
|
{
...
...
src/libsyntax_ext/deriving/generic/mod.rs
浏览文件 @
b5099a70
...
...
@@ -530,7 +530,7 @@ fn create_derived_impl(&self,
id
:
ast
::
DUMMY_NODE_ID
,
span
:
self
.span
,
ident
,
vis
:
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
vis
:
respan
(
self
.span
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
defaultness
:
ast
::
Defaultness
::
Final
,
attrs
:
Vec
::
new
(),
generics
:
Generics
::
default
(),
...
...
@@ -977,7 +977,7 @@ fn create_method(&self,
attrs
:
self
.attributes
.clone
(),
generics
:
fn_generics
,
span
:
trait_
.span
,
vis
:
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
vis
:
respan
(
trait_
.span
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
defaultness
:
ast
::
Defaultness
::
Final
,
ident
:
method_ident
,
node
:
ast
::
ImplItemKind
::
Method
(
ast
::
MethodSig
{
...
...
src/libsyntax_ext/global_asm.rs
浏览文件 @
b5099a70
...
...
@@ -19,7 +19,7 @@
/// therefore apply.
use
syntax
::
ast
;
use
syntax
::
codemap
::
dummy_spanned
;
use
syntax
::
codemap
::
respan
;
use
syntax
::
ext
::
base
;
use
syntax
::
ext
::
base
::
*
;
use
syntax
::
feature_gate
;
...
...
@@ -60,7 +60,7 @@ pub fn expand_global_asm<'cx>(cx: &'cx mut ExtCtxt,
asm
,
ctxt
:
cx
.backtrace
(),
})),
vis
:
dummy_spanned
(
ast
::
VisibilityKind
::
Inherited
),
vis
:
respan
(
sp
.empty
(),
ast
::
VisibilityKind
::
Inherited
),
span
:
sp
,
tokens
:
None
,
})))
...
...
src/libsyntax_pos/lib.rs
浏览文件 @
b5099a70
...
...
@@ -216,6 +216,12 @@ pub fn with_ctxt(self, ctxt: SyntaxContext) -> Span {
self
.data
()
.with_ctxt
(
ctxt
)
}
/// Returns a new span representing an empty span at the beginning of this span
#[inline]
pub
fn
empty
(
self
)
->
Span
{
span
.with_hi
(
self
.lo
())
}
/// Returns `self` if `self` is not the dummy span, and `other` otherwise.
pub
fn
substitute_dummy
(
self
,
other
:
Span
)
->
Span
{
if
self
.source_equal
(
&
DUMMY_SP
)
{
other
}
else
{
self
}
...
...
cargo
@
91e36aa8
比较
1d6dfea4
...
91e36aa8
Subproject commit
1d6dfea44f97199d5d5c177c7dadcde393eaff9a
Subproject commit
91e36aa86c7037de50642f2fec1cf47c3d18af02
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录