Skip to content

Commit 95fedd2

Browse files
author
Michael Wright
committed
Revert "Fix E0502 warnings"
This reverts commit 98dbce4. The compiler no longer emits the warnings in #2982 with the original code.
1 parent 296b79b commit 95fedd2

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,9 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
375375
reg.register_late_lint_pass(box large_enum_variant::LargeEnumVariant::new(conf.enum_variant_size_threshold));
376376
reg.register_late_lint_pass(box explicit_write::Pass);
377377
reg.register_late_lint_pass(box needless_pass_by_value::NeedlessPassByValue);
378-
379-
let target = &reg.sess.target;
380378
reg.register_late_lint_pass(box trivially_copy_pass_by_ref::TriviallyCopyPassByRef::new(
381379
conf.trivial_copy_size_limit,
382-
target,
380+
&reg.sess.target,
383381
));
384382
reg.register_early_lint_pass(box literal_representation::LiteralDigitGrouping);
385383
reg.register_early_lint_pass(box literal_representation::LiteralRepresentation::new(

clippy_lints/src/utils/hir_utils.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
448448
CaptureClause::CaptureByValue => 0,
449449
CaptureClause::CaptureByRef => 1,
450450
}.hash(&mut self.s);
451-
let value = &self.cx.tcx.hir.body(eid).value;
452-
self.hash_expr(value);
451+
self.hash_expr(&self.cx.tcx.hir.body(eid).value);
453452
},
454453
ExprKind::Field(ref e, ref f) => {
455454
let c: fn(_, _) -> _ = ExprKind::Field;
@@ -516,8 +515,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
516515
self.hash_expr(e);
517516
let full_table = self.tables;
518517
self.tables = self.cx.tcx.body_tables(l_id.body);
519-
let value = &self.cx.tcx.hir.body(l_id.body).value;
520-
self.hash_expr(value);
518+
self.hash_expr(&self.cx.tcx.hir.body(l_id.body).value);
521519
self.tables = full_table;
522520
},
523521
ExprKind::Ret(ref e) => {

0 commit comments

Comments
 (0)