Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 9d6f416

Browse files
committed
Auto merge of rust-lang#12527 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents 443f459 + e1d15b5 commit 9d6f416

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+138
-187
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.78"
3+
version = "0.1.79"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"

clippy_config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_config"
3-
version = "0.1.78"
3+
version = "0.1.79"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_lints"
3-
version = "0.1.78"
3+
version = "0.1.79"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"

clippy_lints/src/attrs/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn is_relevant_block(cx: &LateContext<'_>, typeck_results: &ty::TypeckResults<'_
5252
.as_ref()
5353
.map_or(false, |e| is_relevant_expr(cx, typeck_results, e)),
5454
|stmt| match &stmt.kind {
55-
StmtKind::Local(_) => true,
55+
StmtKind::Let(_) => true,
5656
StmtKind::Expr(expr) | StmtKind::Semi(expr) => is_relevant_expr(cx, typeck_results, expr),
5757
StmtKind::Item(_) => false,
5858
},

clippy_lints/src/copies.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl BlockEq {
349349

350350
/// If the statement is a local, checks if the bound names match the expected list of names.
351351
fn eq_binding_names(s: &Stmt<'_>, names: &[(HirId, Symbol)]) -> bool {
352-
if let StmtKind::Local(l) = s.kind {
352+
if let StmtKind::Let(l) = s.kind {
353353
let mut i = 0usize;
354354
let mut res = true;
355355
l.pat.each_binding_or_first(&mut |_, _, _, name| {
@@ -389,7 +389,7 @@ fn eq_stmts(
389389
eq: &mut HirEqInterExpr<'_, '_, '_>,
390390
moved_bindings: &mut Vec<(HirId, Symbol)>,
391391
) -> bool {
392-
(if let StmtKind::Local(l) = stmt.kind {
392+
(if let StmtKind::Let(l) = stmt.kind {
393393
let old_count = moved_bindings.len();
394394
l.pat.each_binding_or_first(&mut |_, id, _, name| {
395395
moved_bindings.push((id, name.name));
@@ -432,7 +432,7 @@ fn scan_block_for_eq<'tcx>(
432432
.iter()
433433
.enumerate()
434434
.find(|&(i, stmt)| {
435-
if let StmtKind::Local(l) = stmt.kind
435+
if let StmtKind::Let(l) = stmt.kind
436436
&& needs_ordered_drop(cx, cx.typeck_results().node_type(l.hir_id))
437437
{
438438
local_needs_ordered_drop = true;
@@ -509,7 +509,7 @@ fn scan_block_for_eq<'tcx>(
509509
// Clear out all locals seen at the end so far. None of them can be moved.
510510
let stmts = &blocks[0].stmts;
511511
for stmt in &stmts[stmts.len() - init..=stmts.len() - offset] {
512-
if let StmtKind::Local(l) = stmt.kind {
512+
if let StmtKind::Let(l) = stmt.kind {
513513
l.pat.each_binding_or_first(&mut |_, id, _, _| {
514514
// FIXME(rust/#120456) - is `swap_remove` correct?
515515
eq.locals.swap_remove(&id);

clippy_lints/src/default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<'tcx> LateLintPass<'tcx> for Default {
121121
// find all binding statements like `let mut _ = T::default()` where `T::default()` is the
122122
// `default` method of the `Default` trait, and store statement index in current block being
123123
// checked and the name of the bound variable
124-
let (local, variant, binding_name, binding_type, span) = if let StmtKind::Local(local) = stmt.kind
124+
let (local, variant, binding_name, binding_type, span) = if let StmtKind::Let(local) = stmt.kind
125125
// only take `let ...` statements
126126
&& let Some(expr) = local.init
127127
&& !any_parent_is_automatically_derived(cx.tcx, expr.hir_id)

clippy_lints/src/default_numeric_fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
221221
fn visit_stmt(&mut self, stmt: &'tcx Stmt<'_>) {
222222
match stmt.kind {
223223
// we cannot check the exact type since it's a hir::Ty which does not implement `is_numeric`
224-
StmtKind::Local(local) => self.ty_bounds.push(ExplicitTyBound(local.ty.is_some())),
224+
StmtKind::Let(local) => self.ty_bounds.push(ExplicitTyBound(local.ty.is_some())),
225225

226226
_ => self.ty_bounds.push(ExplicitTyBound(false)),
227227
}

clippy_lints/src/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl<'tcx> Visitor<'tcx> for InsertSearcher<'_, 'tcx> {
423423
}
424424
},
425425
StmtKind::Expr(e) => self.visit_expr(e),
426-
StmtKind::Local(l) => {
426+
StmtKind::Let(l) => {
427427
self.visit_pat(l.pat);
428428
if let Some(e) = l.init {
429429
self.allow_insert_closure &= !self.in_tail_pos;

clippy_lints/src/escape.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
7676
.hir()
7777
.get_parent_item(cx.tcx.local_def_id_to_hir_id(fn_def_id))
7878
.def_id;
79-
let parent_node = cx.tcx.opt_hir_node_by_def_id(parent_id);
8079

8180
let mut trait_self_ty = None;
82-
if let Some(Node::Item(item)) = parent_node {
81+
if let Node::Item(item) = cx.tcx.hir_node_by_def_id(parent_id) {
8382
// If the method is an impl for a trait, don't warn.
8483
if let ItemKind::Impl(Impl { of_trait: Some(_), .. }) = item.kind {
8584
return;

clippy_lints/src/exit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'tcx> LateLintPass<'tcx> for Exit {
4646
&& let Some(def_id) = cx.qpath_res(path, path_expr.hir_id).opt_def_id()
4747
&& cx.tcx.is_diagnostic_item(sym::process_exit, def_id)
4848
&& let parent = cx.tcx.hir().get_parent_item(e.hir_id).def_id
49-
&& let Some(Node::Item(Item{kind: ItemKind::Fn(..), ..})) = cx.tcx.opt_hir_node_by_def_id(parent)
49+
&& let Node::Item(Item{kind: ItemKind::Fn(..), ..}) = cx.tcx.hir_node_by_def_id(parent)
5050
// If the next item up is a function we check if it is an entry point
5151
// and only then emit a linter warning
5252
&& !is_entrypoint_fn(cx, parent.to_def_id())

0 commit comments

Comments
 (0)