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

rustup https://github.com/rust-lang/rust/pull/60417/ #4054

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion clippy_lints/src/loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ fn never_loop_expr(expr: &Expr, main_loop_id: HirId) -> NeverLoopResult {
| ExprKind::AddrOf(_, ref e)
| ExprKind::Struct(_, _, Some(ref e))
| ExprKind::Repeat(ref e, _)
| ExprKind::Use(ref e) => never_loop_expr(e, main_loop_id),
| ExprKind::DropTemps(ref e) => never_loop_expr(e, main_loop_id),
ExprKind::Array(ref es) | ExprKind::MethodCall(_, _, ref es) | ExprKind::Tup(ref es) => {
never_loop_expr_all(&mut es.iter(), main_loop_id)
},
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
ExprKind::Err => {
println!("Err = {}", current);
},
ExprKind::Use(ref expr) => {
ExprKind::DropTemps(ref expr) => {
let expr_pat = self.next("expr");
println!("Use(ref {}) = {};", expr_pat, current);
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong, should say DropTemps.

self.current = expr_pat;
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/utils/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
&& self.eq_block(lb, rb)
&& both(ll, rl, |l, r| l.ident.as_str() == r.ident.as_str())
},
(&ExprKind::Use(ref le), &ExprKind::Use(ref re)) => self.eq_expr(le, re),
(&ExprKind::DropTemps(ref le), &ExprKind::DropTemps(ref re)) => self.eq_expr(le, re),
_ => false,
}
}
Expand Down Expand Up @@ -607,8 +607,8 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
}
},
ExprKind::Err => {},
ExprKind::Use(ref e) => {
let c: fn(_) -> _ = ExprKind::Use;
ExprKind::DropTemps(ref e) => {
let c: fn(_) -> _ = ExprKind::DropTemps;
c.hash(&mut self.s);
Copy link
Member

Choose a reason for hiding this comment

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

Huh, this should hash mem::discriminant (or thereabouts) like rustc does.
Preexisting though, better not to fix it in this PR.
cc @oli-obk @Manishearth

self.hash_expr(e);
},
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ fn print_expr(cx: &LateContext<'_, '_>, expr: &hir::Expr, indent: usize) {
hir::ExprKind::Err => {
println!("{}Err", ind);
},
hir::ExprKind::Use(ref e) => {
hir::ExprKind::DropTemps(ref e) => {
println!("{}Use", ind);
Copy link
Member

Choose a reason for hiding this comment

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

This should say DropTemps.

print_expr(cx, e, indent + 1);
},
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl<'a> Sugg<'a> {
| hir::ExprKind::Struct(..)
| hir::ExprKind::Tup(..)
| hir::ExprKind::While(..)
| hir::ExprKind::Use(_)
| hir::ExprKind::DropTemps(_)
| hir::ExprKind::Err => Sugg::NonParen(snippet),
hir::ExprKind::Assign(..) => Sugg::BinOp(AssocOp::Assign, snippet),
hir::ExprKind::AssignOp(op, ..) => Sugg::BinOp(hirbinop2assignop(op), snippet),
Expand Down