Skip to content

Commit 1325425

Browse files
committed
Auto merge of rust-lang#12748 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents 7eb3809 + d878e0e commit 1325425

File tree

85 files changed

+275
-276
lines changed

Some content is hidden

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

85 files changed

+275
-276
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.79"
3+
version = "0.1.80"
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.79"
3+
version = "0.1.80"
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.79"
3+
version = "0.1.80"
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/dereference.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use rustc_data_structures::fx::FxIndexMap;
99
use rustc_errors::Applicability;
1010
use rustc_hir::intravisit::{walk_ty, Visitor};
1111
use rustc_hir::{
12-
self as hir, BindingAnnotation, Body, BodyId, BorrowKind, Expr, ExprKind, HirId, MatchSource, Mutability, Node,
13-
Pat, PatKind, Path, QPath, TyKind, UnOp,
12+
self as hir, BindingMode, Body, BodyId, BorrowKind, Expr, ExprKind, HirId, MatchSource, Mutability, Node, Pat,
13+
PatKind, Path, QPath, TyKind, UnOp,
1414
};
1515
use rustc_lint::{LateContext, LateLintPass};
1616
use rustc_middle::ty::adjustment::{Adjust, Adjustment, AutoBorrow, AutoBorrowMutability};
@@ -599,7 +599,7 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing<'tcx> {
599599
}
600600

601601
fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) {
602-
if let PatKind::Binding(BindingAnnotation::REF, id, name, _) = pat.kind {
602+
if let PatKind::Binding(BindingMode::REF, id, name, _) = pat.kind {
603603
if let Some(opt_prev_pat) = self.ref_locals.get_mut(&id) {
604604
// This binding id has been seen before. Add this pattern to the list of changes.
605605
if let Some(prev_pat) = opt_prev_pat {

clippy_lints/src/eta_reduction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use clippy_utils::ty::type_diagnostic_name;
55
use clippy_utils::usage::{local_used_after_expr, local_used_in};
66
use clippy_utils::{get_path_from_caller_to_method_type, is_adjusted, path_to_local, path_to_local_id};
77
use rustc_errors::Applicability;
8-
use rustc_hir::{BindingAnnotation, Expr, ExprKind, FnRetTy, Param, PatKind, QPath, TyKind, Unsafety};
8+
use rustc_hir::{BindingMode, Expr, ExprKind, FnRetTy, Param, PatKind, QPath, TyKind, Unsafety};
99
use rustc_infer::infer::TyCtxtInferExt;
1010
use rustc_lint::{LateContext, LateLintPass};
1111
use rustc_middle::ty::{
@@ -229,7 +229,7 @@ fn check_inputs(
229229
&& params.iter().zip(self_arg.into_iter().chain(args)).all(|(p, arg)| {
230230
matches!(
231231
p.pat.kind,
232-
PatKind::Binding(BindingAnnotation::NONE, id, _, None)
232+
PatKind::Binding(BindingMode::NONE, id, _, None)
233233
if path_to_local_id(arg, id)
234234
)
235235
// Only allow adjustments which change regions (i.e. re-borrowing).

clippy_lints/src/explicit_write.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use clippy_utils::source::snippet_with_applicability;
44
use clippy_utils::{is_expn_of, path_def_id};
55
use rustc_errors::Applicability;
66
use rustc_hir::def::Res;
7-
use rustc_hir::{BindingAnnotation, Block, BlockCheckMode, Expr, ExprKind, Node, PatKind, QPath, Stmt, StmtKind};
7+
use rustc_hir::{BindingMode, Block, BlockCheckMode, Expr, ExprKind, Node, PatKind, QPath, Stmt, StmtKind};
88
use rustc_lint::{LateContext, LateLintPass};
99
use rustc_session::declare_lint_pass;
1010
use rustc_span::{sym, ExpnId};
@@ -114,7 +114,7 @@ fn look_in_block<'tcx, 'hir>(cx: &LateContext<'tcx>, kind: &'tcx ExprKind<'hir>)
114114
&& let Node::Pat(res_pat) = cx.tcx.hir_node(expr_res)
115115

116116
// Find id of the local we found in the block
117-
&& let PatKind::Binding(BindingAnnotation::NONE, local_hir_id, _ident, None) = local.pat.kind
117+
&& let PatKind::Binding(BindingMode::NONE, local_hir_id, _ident, None) = local.pat.kind
118118

119119
// If those two are the same hir id
120120
&& res_pat.hir_id == local_hir_id

clippy_lints/src/functions/must_use.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn is_mutable_pat(cx: &LateContext<'_>, pat: &hir::Pat<'_>, tys: &mut DefIdSet)
185185
if let hir::PatKind::Wild = pat.kind {
186186
return false; // ignore `_` patterns
187187
}
188-
if cx.tcx.has_typeck_results(pat.hir_id.owner.to_def_id()) {
188+
if cx.tcx.has_typeck_results(pat.hir_id.owner.def_id) {
189189
is_mutable_ty(cx, cx.tcx.typeck(pat.hir_id.owner.def_id).pat_ty(pat), tys)
190190
} else {
191191
false
@@ -233,7 +233,7 @@ fn mutates_static<'tcx>(cx: &LateContext<'tcx>, body: &'tcx hir::Body<'_>) -> bo
233233
Call(_, args) => {
234234
let mut tys = DefIdSet::default();
235235
for arg in args {
236-
if cx.tcx.has_typeck_results(arg.hir_id.owner.to_def_id())
236+
if cx.tcx.has_typeck_results(arg.hir_id.owner.def_id)
237237
&& is_mutable_ty(cx, cx.tcx.typeck(arg.hir_id.owner.def_id).expr_ty(arg), &mut tys)
238238
&& is_mutated_static(arg)
239239
{
@@ -246,7 +246,7 @@ fn mutates_static<'tcx>(cx: &LateContext<'tcx>, body: &'tcx hir::Body<'_>) -> bo
246246
MethodCall(_, receiver, args, _) => {
247247
let mut tys = DefIdSet::default();
248248
for arg in std::iter::once(receiver).chain(args.iter()) {
249-
if cx.tcx.has_typeck_results(arg.hir_id.owner.to_def_id())
249+
if cx.tcx.has_typeck_results(arg.hir_id.owner.def_id)
250250
&& is_mutable_ty(cx, cx.tcx.typeck(arg.hir_id.owner.def_id).expr_ty(arg), &mut tys)
251251
&& is_mutated_static(arg)
252252
{

clippy_lints/src/index_refutable_slice.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,9 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<Hir
9393
let mut slices: FxIndexMap<HirId, SliceLintInformation> = FxIndexMap::default();
9494
pat.walk_always(|pat| {
9595
// We'll just ignore mut and ref mut for simplicity sake right now
96-
if let hir::PatKind::Binding(
97-
hir::BindingAnnotation(by_ref, hir::Mutability::Not),
98-
value_hir_id,
99-
ident,
100-
sub_pat,
101-
) = pat.kind && by_ref != hir::ByRef::Yes(hir::Mutability::Mut)
96+
if let hir::PatKind::Binding(hir::BindingMode(by_ref, hir::Mutability::Not), value_hir_id, ident, sub_pat) =
97+
pat.kind
98+
&& by_ref != hir::ByRef::Yes(hir::Mutability::Mut)
10299
{
103100
// This block catches bindings with sub patterns. It would be hard to build a correct suggestion
104101
// for them and it's likely that the user knows what they are doing in such a case.

clippy_lints/src/let_if_seq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use clippy_utils::source::snippet;
44
use clippy_utils::visitors::is_local_used;
55
use rustc_errors::Applicability;
66
use rustc_hir as hir;
7-
use rustc_hir::{BindingAnnotation, Mutability};
7+
use rustc_hir::{BindingMode, Mutability};
88
use rustc_lint::{LateContext, LateLintPass};
99
use rustc_session::declare_lint_pass;
1010

@@ -106,7 +106,7 @@ impl<'tcx> LateLintPass<'tcx> for LetIfSeq {
106106
};
107107

108108
let mutability = match mode {
109-
BindingAnnotation(_, Mutability::Mut) => "<mut> ",
109+
BindingMode(_, Mutability::Mut) => "<mut> ",
110110
_ => "",
111111
};
112112

clippy_lints/src/loops/manual_find.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use clippy_utils::{higher, is_res_lang_ctor, path_res, peel_blocks_with_stmt};
77
use rustc_errors::Applicability;
88
use rustc_hir::def::Res;
99
use rustc_hir::lang_items::LangItem;
10-
use rustc_hir::{BindingAnnotation, Block, Expr, ExprKind, HirId, Node, Pat, PatKind, Stmt, StmtKind};
10+
use rustc_hir::{BindingMode, Block, Expr, ExprKind, HirId, Node, Pat, PatKind, Stmt, StmtKind};
1111
use rustc_lint::LateContext;
1212
use rustc_span::Span;
1313

@@ -107,7 +107,7 @@ fn get_binding(pat: &Pat<'_>) -> Option<HirId> {
107107
hir_id = None;
108108
return;
109109
}
110-
if let BindingAnnotation::NONE = annotation {
110+
if let BindingMode::NONE = annotation {
111111
hir_id = Some(id);
112112
}
113113
});

0 commit comments

Comments
 (0)