Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
12806b70
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
12806b70
编写于
6月 25, 2019
作者:
I
Igor Matuszewski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix clippy::redundant_field_names
上级
dedcd97e
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
29 addition
and
29 deletion
+29
-29
src/librustc_data_structures/vec_linked_list.rs
src/librustc_data_structures/vec_linked_list.rs
+1
-1
src/librustc_errors/annotate_snippet_emitter_writer.rs
src/librustc_errors/annotate_snippet_emitter_writer.rs
+1
-1
src/librustc_errors/diagnostic.rs
src/librustc_errors/diagnostic.rs
+1
-1
src/librustc_target/spec/fuchsia_base.rs
src/librustc_target/spec/fuchsia_base.rs
+1
-1
src/libserialize/json.rs
src/libserialize/json.rs
+1
-1
src/libsyntax/ast.rs
src/libsyntax/ast.rs
+2
-2
src/libsyntax/ext/build.rs
src/libsyntax/ext/build.rs
+1
-1
src/libsyntax/ext/expand.rs
src/libsyntax/ext/expand.rs
+3
-3
src/libsyntax/ext/tt/quoted.rs
src/libsyntax/ext/tt/quoted.rs
+1
-1
src/libsyntax/ext/tt/transcribe.rs
src/libsyntax/ext/tt/transcribe.rs
+3
-3
src/libsyntax/feature_gate.rs
src/libsyntax/feature_gate.rs
+1
-1
src/libsyntax/parse/parser.rs
src/libsyntax/parse/parser.rs
+9
-9
src/libsyntax/source_map.rs
src/libsyntax/source_map.rs
+4
-4
未找到文件。
src/librustc_data_structures/vec_linked_list.rs
浏览文件 @
12806b70
...
...
@@ -8,7 +8,7 @@ pub fn iter<Ls>(
Ls
:
Links
,
{
VecLinkedListIterator
{
links
:
links
,
links
,
current
:
first
,
}
}
...
...
src/librustc_errors/annotate_snippet_emitter_writer.rs
浏览文件 @
12806b70
...
...
@@ -94,7 +94,7 @@ fn to_annotation_snippet(&self) -> Option<Snippet> {
annotation_type
:
Self
::
annotation_type_for_level
(
self
.level
),
}),
footer
:
vec!
[],
slices
:
slices
,
slices
,
})
}
else
{
// FIXME(#59346): Is it ok to return None if there's no source_map?
...
...
src/librustc_errors/diagnostic.rs
浏览文件 @
12806b70
...
...
@@ -388,7 +388,7 @@ pub fn tool_only_span_suggestion(
}],
msg
:
msg
.to_owned
(),
style
:
SuggestionStyle
::
CompletelyHidden
,
applicability
:
applicability
,
applicability
,
});
self
}
...
...
src/librustc_target/spec/fuchsia_base.rs
浏览文件 @
12806b70
...
...
@@ -19,7 +19,7 @@ pub fn opts() -> TargetOptions {
is_like_fuchsia
:
true
,
linker_is_gnu
:
true
,
has_rpath
:
false
,
pre_link_args
:
pre_link_args
,
pre_link_args
,
pre_link_objects_exe
:
vec!
[
"Scrt1.o"
.to_string
()
],
...
...
src/libserialize/json.rs
浏览文件 @
12806b70
...
...
@@ -461,7 +461,7 @@ impl<'a> Encoder<'a> {
/// Creates a new JSON encoder whose output will be written to the writer
/// specified.
pub
fn
new
(
writer
:
&
'a
mut
dyn
fmt
::
Write
)
->
Encoder
<
'a
>
{
Encoder
{
writer
:
writer
,
is_emitting_map_key
:
false
,
}
Encoder
{
writer
,
is_emitting_map_key
:
false
,
}
}
}
...
...
src/libsyntax/ast.rs
浏览文件 @
12806b70
...
...
@@ -1832,7 +1832,7 @@ pub fn from_self(attrs: ThinVec<Attribute>, eself: ExplicitSelf, eself_ident: Id
lt
,
MutTy
{
ty
:
infer_ty
,
mutbl
:
mutbl
,
mutbl
,
},
),
span
,
...
...
@@ -2120,7 +2120,7 @@ pub fn new(generic_params: Vec<GenericParam>, path: Path, span: Span) -> Self {
PolyTraitRef
{
bound_generic_params
:
generic_params
,
trait_ref
:
TraitRef
{
path
:
path
,
path
,
ref_id
:
DUMMY_NODE_ID
,
},
span
,
...
...
src/libsyntax/ext/build.rs
浏览文件 @
12806b70
...
...
@@ -815,7 +815,7 @@ fn expr_try(&self, sp: Span, head: P<ast::Expr>) -> P<ast::Expr> {
fn
pat
(
&
self
,
span
:
Span
,
pat
:
PatKind
)
->
P
<
ast
::
Pat
>
{
P
(
ast
::
Pat
{
id
:
ast
::
DUMMY_NODE_ID
,
node
:
pat
,
span
:
span
})
P
(
ast
::
Pat
{
id
:
ast
::
DUMMY_NODE_ID
,
node
:
pat
,
span
})
}
fn
pat_wild
(
&
self
,
span
:
Span
)
->
P
<
ast
::
Pat
>
{
self
.pat
(
span
,
PatKind
::
Wild
)
...
...
src/libsyntax/ext/expand.rs
浏览文件 @
12806b70
...
...
@@ -231,7 +231,7 @@ pub struct MacroExpander<'a, 'b> {
impl
<
'a
,
'b
>
MacroExpander
<
'a
,
'b
>
{
pub
fn
new
(
cx
:
&
'a
mut
ExtCtxt
<
'b
>
,
monotonic
:
bool
)
->
Self
{
MacroExpander
{
cx
:
cx
,
monotonic
:
monotonic
}
MacroExpander
{
cx
,
monotonic
}
}
pub
fn
expand_crate
(
&
mut
self
,
mut
krate
:
ast
::
Crate
)
->
ast
::
Crate
{
...
...
@@ -377,7 +377,7 @@ fn expand_fragment(&mut self, input_fragment: AstFragment) -> AstFragment {
_
=>
item
.clone
(),
};
invocations
.push
(
Invocation
{
kind
:
InvocationKind
::
Derive
{
path
:
path
.clone
(),
item
:
item
},
kind
:
InvocationKind
::
Derive
{
path
:
path
.clone
(),
item
},
fragment_kind
:
invoc
.fragment_kind
,
expansion_data
:
ExpansionData
{
mark
,
...
...
@@ -944,7 +944,7 @@ fn collect(&mut self, fragment_kind: AstFragmentKind, kind: InvocationKind) -> A
}
fn
collect_bang
(
&
mut
self
,
mac
:
ast
::
Mac
,
span
:
Span
,
kind
:
AstFragmentKind
)
->
AstFragment
{
self
.collect
(
kind
,
InvocationKind
::
Bang
{
mac
:
mac
,
ident
:
None
,
span
:
span
})
self
.collect
(
kind
,
InvocationKind
::
Bang
{
mac
,
ident
:
None
,
span
})
}
fn
collect_attr
(
&
mut
self
,
...
...
src/libsyntax/ext/tt/quoted.rs
浏览文件 @
12806b70
...
...
@@ -319,7 +319,7 @@ fn parse_tree(
tokenstream
::
TokenTree
::
Delimited
(
span
,
delim
,
tts
)
=>
TokenTree
::
Delimited
(
span
,
Lrc
::
new
(
Delimited
{
delim
:
delim
,
delim
,
tts
:
parse
(
tts
.into
(),
expect_matchers
,
...
...
src/libsyntax/ext/tt/transcribe.rs
浏览文件 @
12806b70
...
...
@@ -23,8 +23,8 @@ enum Frame {
impl
Frame
{
/// Construct a new frame around the delimited set of tokens.
fn
new
(
tts
:
Vec
<
quoted
::
TokenTree
>
)
->
Frame
{
let
forest
=
Lrc
::
new
(
quoted
::
Delimited
{
delim
:
token
::
NoDelim
,
tts
:
tts
});
Frame
::
Delimited
{
forest
:
forest
,
idx
:
0
,
span
:
DelimSpan
::
dummy
()
}
let
forest
=
Lrc
::
new
(
quoted
::
Delimited
{
delim
:
token
::
NoDelim
,
tts
});
Frame
::
Delimited
{
forest
,
idx
:
0
,
span
:
DelimSpan
::
dummy
()
}
}
}
...
...
@@ -248,7 +248,7 @@ pub fn transcribe(
// the previous results (from outside the Delimited).
quoted
::
TokenTree
::
Delimited
(
mut
span
,
delimited
)
=>
{
span
=
span
.apply_mark
(
cx
.current_expansion.mark
);
stack
.push
(
Frame
::
Delimited
{
forest
:
delimited
,
idx
:
0
,
span
:
span
});
stack
.push
(
Frame
::
Delimited
{
forest
:
delimited
,
idx
:
0
,
span
});
result_stack
.push
(
mem
::
replace
(
&
mut
result
,
Vec
::
new
()));
}
...
...
src/libsyntax/feature_gate.rs
浏览文件 @
12806b70
...
...
@@ -1665,7 +1665,7 @@ fn check_attribute(
}
pub
fn
check_attribute
(
attr
:
&
ast
::
Attribute
,
parse_sess
:
&
ParseSess
,
features
:
&
Features
)
{
let
cx
=
Context
{
features
:
features
,
parse_sess
:
parse_sess
,
plugin_attributes
:
&
[]
};
let
cx
=
Context
{
features
,
parse_sess
,
plugin_attributes
:
&
[]
};
cx
.check_attribute
(
attr
,
attr
.ident
()
.and_then
(|
ident
|
BUILTIN_ATTRIBUTE_MAP
.get
(
&
ident
.name
)
.map
(|
a
|
*
a
)),
...
...
src/libsyntax/parse/parser.rs
浏览文件 @
12806b70
...
...
@@ -290,10 +290,10 @@ fn drop(&mut self) {
}
impl
TokenCursorFrame
{
fn
new
(
sp
:
DelimSpan
,
delim
:
DelimToken
,
tts
:
&
TokenStream
)
->
Self
{
fn
new
(
sp
an
:
DelimSpan
,
delim
:
DelimToken
,
tts
:
&
TokenStream
)
->
Self
{
TokenCursorFrame
{
delim
:
delim
,
span
:
sp
,
delim
,
span
,
open_delim
:
delim
==
token
::
NoDelim
,
tree_cursor
:
tts
.clone
()
.into_trees
(),
close_delim
:
delim
==
token
::
NoDelim
,
...
...
@@ -1449,7 +1449,7 @@ fn parse_borrowed_pointee(&mut self) -> PResult<'a, TyKind> {
let
opt_lifetime
=
if
self
.check_lifetime
()
{
Some
(
self
.expect_lifetime
())
}
else
{
None
};
let
mutbl
=
self
.parse_mutability
();
let
ty
=
self
.parse_ty_no_plus
()
?
;
return
Ok
(
TyKind
::
Rptr
(
opt_lifetime
,
MutTy
{
ty
:
ty
,
mutbl
:
mutbl
}));
return
Ok
(
TyKind
::
Rptr
(
opt_lifetime
,
MutTy
{
ty
,
mutbl
}));
}
fn
parse_ptr
(
&
mut
self
)
->
PResult
<
'a
,
MutTy
>
{
...
...
@@ -1467,7 +1467,7 @@ fn parse_ptr(&mut self) -> PResult<'a, MutTy> {
Mutability
::
Immutable
};
let
t
=
self
.parse_ty_no_plus
()
?
;
Ok
(
MutTy
{
ty
:
t
,
mutbl
:
mutbl
})
Ok
(
MutTy
{
ty
:
t
,
mutbl
})
}
fn
is_named_argument
(
&
self
)
->
bool
{
...
...
@@ -4366,7 +4366,7 @@ fn eat_macro_def(&mut self, attrs: &[Attribute], vis: &Visibility, lo: Span)
self
.report_invalid_macro_expansion_item
();
}
(
ident
,
ast
::
MacroDef
{
tokens
:
tokens
,
legacy
:
true
})
(
ident
,
ast
::
MacroDef
{
tokens
,
legacy
:
true
})
}
_
=>
return
Ok
(
None
),
};
...
...
@@ -6789,12 +6789,12 @@ fn parse_item_foreign_type(&mut self, vis: ast::Visibility, lo: Span, attrs: Vec
let
hi
=
self
.token.span
;
self
.expect
(
&
token
::
Semi
)
?
;
Ok
(
ast
::
ForeignItem
{
ident
:
ident
,
attrs
:
attrs
,
ident
,
attrs
,
node
:
ForeignItemKind
::
Ty
,
id
:
ast
::
DUMMY_NODE_ID
,
span
:
lo
.to
(
hi
),
vis
:
vis
vis
})
}
...
...
src/libsyntax/source_map.rs
浏览文件 @
12806b70
...
...
@@ -150,7 +150,7 @@ pub fn with_file_loader(file_loader: Box<dyn FileLoader + Sync + Send>,
->
SourceMap
{
SourceMap
{
files
:
Default
::
default
(),
file_loader
:
file_loader
,
file_loader
,
path_mapping
,
}
}
...
...
@@ -396,7 +396,7 @@ pub fn lookup_line(&self, pos: BytePos) -> Result<SourceFileAndLine, Lrc<SourceF
let
f
=
(
*
self
.files
.borrow
()
.source_files
)[
idx
]
.clone
();
match
f
.lookup_line
(
pos
)
{
Some
(
line
)
=>
Ok
(
SourceFileAndLine
{
sf
:
f
,
line
:
line
}),
Some
(
line
)
=>
Ok
(
SourceFileAndLine
{
sf
:
f
,
line
}),
None
=>
Err
(
f
)
}
}
...
...
@@ -511,7 +511,7 @@ pub fn span_to_lines(&self, sp: Span) -> FileLinesResult {
start_col
,
end_col
:
hi
.col
});
Ok
(
FileLines
{
file
:
lo
.file
,
lines
:
lines
})
Ok
(
FileLines
{
file
:
lo
.file
,
lines
})
}
/// Extracts the source surrounding the given `Span` using the `extract_source` function. The
...
...
@@ -820,7 +820,7 @@ pub fn lookup_byte_offset(&self, bpos: BytePos) -> SourceFileAndBytePos {
let
idx
=
self
.lookup_source_file_idx
(
bpos
);
let
sf
=
(
*
self
.files
.borrow
()
.source_files
)[
idx
]
.clone
();
let
offset
=
bpos
-
sf
.start_pos
;
SourceFileAndBytePos
{
sf
:
sf
,
pos
:
offset
}
SourceFileAndBytePos
{
sf
,
pos
:
offset
}
}
/// Converts an absolute BytePos to a CharPos relative to the source_file.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录