Skip to content

Commit 12806b7

Browse files
committed
Fix clippy::redundant_field_names
1 parent dedcd97 commit 12806b7

File tree

13 files changed

+29
-29
lines changed

13 files changed

+29
-29
lines changed

src/librustc_data_structures/vec_linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ where
88
Ls: Links,
99
{
1010
VecLinkedListIterator {
11-
links: links,
11+
links,
1212
current: first,
1313
}
1414
}

src/librustc_errors/annotate_snippet_emitter_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl<'a> DiagnosticConverter<'a> {
9494
annotation_type: Self::annotation_type_for_level(self.level),
9595
}),
9696
footer: vec![],
97-
slices: slices,
97+
slices,
9898
})
9999
} else {
100100
// FIXME(#59346): Is it ok to return None if there's no source_map?

src/librustc_errors/diagnostic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ impl Diagnostic {
388388
}],
389389
msg: msg.to_owned(),
390390
style: SuggestionStyle::CompletelyHidden,
391-
applicability: applicability,
391+
applicability,
392392
});
393393
self
394394
}

src/librustc_target/spec/fuchsia_base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn opts() -> TargetOptions {
1919
is_like_fuchsia: true,
2020
linker_is_gnu: true,
2121
has_rpath: false,
22-
pre_link_args: pre_link_args,
22+
pre_link_args,
2323
pre_link_objects_exe: vec![
2424
"Scrt1.o".to_string()
2525
],

src/libserialize/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ impl<'a> Encoder<'a> {
461461
/// Creates a new JSON encoder whose output will be written to the writer
462462
/// specified.
463463
pub fn new(writer: &'a mut dyn fmt::Write) -> Encoder<'a> {
464-
Encoder { writer: writer, is_emitting_map_key: false, }
464+
Encoder { writer, is_emitting_map_key: false, }
465465
}
466466
}
467467

src/libsyntax/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ impl Arg {
18321832
lt,
18331833
MutTy {
18341834
ty: infer_ty,
1835-
mutbl: mutbl,
1835+
mutbl,
18361836
},
18371837
),
18381838
span,
@@ -2120,7 +2120,7 @@ impl PolyTraitRef {
21202120
PolyTraitRef {
21212121
bound_generic_params: generic_params,
21222122
trait_ref: TraitRef {
2123-
path: path,
2123+
path,
21242124
ref_id: DUMMY_NODE_ID,
21252125
},
21262126
span,

src/libsyntax/ext/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
815815

816816

817817
fn pat(&self, span: Span, pat: PatKind) -> P<ast::Pat> {
818-
P(ast::Pat { id: ast::DUMMY_NODE_ID, node: pat, span: span })
818+
P(ast::Pat { id: ast::DUMMY_NODE_ID, node: pat, span })
819819
}
820820
fn pat_wild(&self, span: Span) -> P<ast::Pat> {
821821
self.pat(span, PatKind::Wild)

src/libsyntax/ext/expand.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ pub struct MacroExpander<'a, 'b> {
231231

232232
impl<'a, 'b> MacroExpander<'a, 'b> {
233233
pub fn new(cx: &'a mut ExtCtxt<'b>, monotonic: bool) -> Self {
234-
MacroExpander { cx: cx, monotonic: monotonic }
234+
MacroExpander { cx, monotonic }
235235
}
236236

237237
pub fn expand_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
@@ -377,7 +377,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
377377
_ => item.clone(),
378378
};
379379
invocations.push(Invocation {
380-
kind: InvocationKind::Derive { path: path.clone(), item: item },
380+
kind: InvocationKind::Derive { path: path.clone(), item },
381381
fragment_kind: invoc.fragment_kind,
382382
expansion_data: ExpansionData {
383383
mark,
@@ -944,7 +944,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
944944
}
945945

946946
fn collect_bang(&mut self, mac: ast::Mac, span: Span, kind: AstFragmentKind) -> AstFragment {
947-
self.collect(kind, InvocationKind::Bang { mac: mac, ident: None, span: span })
947+
self.collect(kind, InvocationKind::Bang { mac, ident: None, span })
948948
}
949949

950950
fn collect_attr(&mut self,

src/libsyntax/ext/tt/quoted.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ fn parse_tree(
319319
tokenstream::TokenTree::Delimited(span, delim, tts) => TokenTree::Delimited(
320320
span,
321321
Lrc::new(Delimited {
322-
delim: delim,
322+
delim,
323323
tts: parse(
324324
tts.into(),
325325
expect_matchers,

src/libsyntax/ext/tt/transcribe.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ enum Frame {
2323
impl Frame {
2424
/// Construct a new frame around the delimited set of tokens.
2525
fn new(tts: Vec<quoted::TokenTree>) -> Frame {
26-
let forest = Lrc::new(quoted::Delimited { delim: token::NoDelim, tts: tts });
27-
Frame::Delimited { forest: forest, idx: 0, span: DelimSpan::dummy() }
26+
let forest = Lrc::new(quoted::Delimited { delim: token::NoDelim, tts });
27+
Frame::Delimited { forest, idx: 0, span: DelimSpan::dummy() }
2828
}
2929
}
3030

@@ -248,7 +248,7 @@ pub fn transcribe(
248248
// the previous results (from outside the Delimited).
249249
quoted::TokenTree::Delimited(mut span, delimited) => {
250250
span = span.apply_mark(cx.current_expansion.mark);
251-
stack.push(Frame::Delimited { forest: delimited, idx: 0, span: span });
251+
stack.push(Frame::Delimited { forest: delimited, idx: 0, span });
252252
result_stack.push(mem::replace(&mut result, Vec::new()));
253253
}
254254

0 commit comments

Comments
 (0)