Skip to content

Commit 98dbce4

Browse files
author
Michael Wright
committed
Fix E0502 warnings
Fixes #2982
1 parent 9c53b15 commit 98dbce4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

clippy_lints/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,11 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>) {
366366
reg.register_late_lint_pass(box large_enum_variant::LargeEnumVariant::new(conf.enum_variant_size_threshold));
367367
reg.register_late_lint_pass(box explicit_write::Pass);
368368
reg.register_late_lint_pass(box needless_pass_by_value::NeedlessPassByValue);
369+
370+
let target = &reg.sess.target;
369371
reg.register_late_lint_pass(box trivially_copy_pass_by_ref::TriviallyCopyPassByRef::new(
370372
conf.trivial_copy_size_limit,
371-
&reg.sess.target,
373+
target,
372374
));
373375
reg.register_early_lint_pass(box literal_representation::LiteralDigitGrouping);
374376
reg.register_early_lint_pass(box literal_representation::LiteralRepresentation::new(

clippy_lints/src/utils/hir_utils.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
448448
CaptureClause::CaptureByValue => 0,
449449
CaptureClause::CaptureByRef => 1,
450450
}.hash(&mut self.s);
451-
self.hash_expr(&self.cx.tcx.hir.body(eid).value);
451+
let value = &self.cx.tcx.hir.body(eid).value;
452+
self.hash_expr(value);
452453
},
453454
ExprKind::Field(ref e, ref f) => {
454455
let c: fn(_, _) -> _ = ExprKind::Field;
@@ -515,7 +516,8 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
515516
self.hash_expr(e);
516517
let full_table = self.tables;
517518
self.tables = self.cx.tcx.body_tables(l_id.body);
518-
self.hash_expr(&self.cx.tcx.hir.body(l_id.body).value);
519+
let value = &self.cx.tcx.hir.body(l_id.body).value;
520+
self.hash_expr(value);
519521
self.tables = full_table;
520522
},
521523
ExprKind::Ret(ref e) => {

0 commit comments

Comments
 (0)