Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix E0502 warnings" #3085

Merged
merged 1 commit into from Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,9 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
reg.register_late_lint_pass(box large_enum_variant::LargeEnumVariant::new(conf.enum_variant_size_threshold));
reg.register_late_lint_pass(box explicit_write::Pass);
reg.register_late_lint_pass(box needless_pass_by_value::NeedlessPassByValue);

let target = &reg.sess.target;
reg.register_late_lint_pass(box trivially_copy_pass_by_ref::TriviallyCopyPassByRef::new(
conf.trivial_copy_size_limit,
target,
&reg.sess.target,
));
reg.register_early_lint_pass(box literal_representation::LiteralDigitGrouping);
reg.register_early_lint_pass(box literal_representation::LiteralRepresentation::new(
Expand Down
6 changes: 2 additions & 4 deletions clippy_lints/src/utils/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
CaptureClause::CaptureByValue => 0,
CaptureClause::CaptureByRef => 1,
}.hash(&mut self.s);
let value = &self.cx.tcx.hir.body(eid).value;
self.hash_expr(value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I wonder if this is due to my changes in rust-lang/rust#53177 -- specifically the redundant borrow optimization. It doesn't seem wrong to me that these fixes are working but it is making me nervous. I wonder what changed here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

people who are curious to learn more here may want to read my notes starting here: rust-lang/rust#52934 (comment)

self.hash_expr(&self.cx.tcx.hir.body(eid).value);
},
ExprKind::Field(ref e, ref f) => {
let c: fn(_, _) -> _ = ExprKind::Field;
Expand Down Expand Up @@ -516,8 +515,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
self.hash_expr(e);
let full_table = self.tables;
self.tables = self.cx.tcx.body_tables(l_id.body);
let value = &self.cx.tcx.hir.body(l_id.body).value;
self.hash_expr(value);
self.hash_expr(&self.cx.tcx.hir.body(l_id.body).value);
self.tables = full_table;
},
ExprKind::Ret(ref e) => {
Expand Down