Skip to content

Commit 31c1621

Browse files
committed
Merge remote-tracking branch 'upstream/master' into rustup
2 parents 4d01529 + 7248d06 commit 31c1621

26 files changed

+71
-82
lines changed

clippy_dev/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(let_chains)]
2-
#![cfg_attr(bootstrap, feature(let_else))]
32
#![feature(once_cell)]
43
#![feature(rustc_private)]
54
#![cfg_attr(feature = "deny-warnings", deny(warnings))]

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ quine-mc_cluskey = "0.2"
1818
regex-syntax = "0.6"
1919
serde = { version = "1.0", features = ["derive"] }
2020
serde_json = { version = "1.0", optional = true }
21-
tempfile = { version = "3.2", optional = true }
21+
tempfile = { version = "3.3", optional = true }
2222
toml = "0.5"
2323
unicode-normalization = "0.1"
2424
unicode-script = { version = "0.5", default-features = false }

clippy_lints/src/blocks_in_if_conditions.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ impl<'tcx> LateLintPass<'tcx> for BlocksInIfConditions {
117117
);
118118
}
119119
} else {
120-
let span =
121-
block.expr.as_ref().map_or_else(|| block.stmts[0].span, |e| e.span);
120+
let span = block.expr.as_ref().map_or_else(|| block.stmts[0].span, |e| e.span);
122121
if span.from_expansion() || expr.span.from_expansion() {
123122
return;
124123
}

clippy_lints/src/disallowed_types.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use clippy_utils::diagnostics::span_lint_and_then;
22

33
use rustc_data_structures::fx::FxHashMap;
4-
use rustc_hir::{
5-
def::Res, def_id::DefId, Item, ItemKind, PolyTraitRef, PrimTy, Ty, TyKind, UseKind,
6-
};
4+
use rustc_hir::{def::Res, def_id::DefId, Item, ItemKind, PolyTraitRef, PrimTy, Ty, TyKind, UseKind};
75
use rustc_lint::{LateContext, LateLintPass};
86
use rustc_session::{declare_tool_lint, impl_lint_pass};
97
use rustc_span::Span;

clippy_lints/src/equatable_if_let.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ fn unary_pattern(pat: &Pat<'_>) -> bool {
5151
false
5252
},
5353
PatKind::Struct(_, a, etc) => !etc && a.iter().all(|x| unary_pattern(x.pat)),
54-
PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => {
55-
!etc.as_opt_usize().is_some() && array_rec(a)
56-
}
54+
PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => etc.as_opt_usize().is_none() && array_rec(a),
5755
PatKind::Ref(x, _) | PatKind::Box(x) => unary_pattern(x),
5856
PatKind::Path(_) | PatKind::Lit(_) => true,
5957
}

clippy_lints/src/format_args.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,7 @@ fn outermost_expn_data(expn_data: ExpnData) -> ExpnData {
9999
}
100100
}
101101

102-
fn check_format_in_format_args(
103-
cx: &LateContext<'_>,
104-
call_site: Span,
105-
name: Symbol,
106-
arg: &Expr<'_>,
107-
) {
102+
fn check_format_in_format_args(cx: &LateContext<'_>, call_site: Span, name: Symbol, arg: &Expr<'_>) {
108103
let expn_data = arg.span.ctxt().outer_expn_data();
109104
if expn_data.call_site.from_expansion() {
110105
return;
@@ -182,7 +177,10 @@ fn check_to_string_in_format_args(cx: &LateContext<'_>, name: Symbol, value: &Ex
182177

183178
// Returns true if `hir_id` is referred to by multiple format params
184179
fn is_aliased(args: &FormatArgsExpn<'_>, hir_id: HirId) -> bool {
185-
args.params().filter(|param| param.value.hir_id == hir_id).at_most_one().is_err()
180+
args.params()
181+
.filter(|param| param.value.hir_id == hir_id)
182+
.at_most_one()
183+
.is_err()
186184
}
187185

188186
fn count_needed_derefs<'tcx, I>(mut ty: Ty<'tcx>, mut iter: I) -> (usize, Ty<'tcx>)
@@ -192,7 +190,11 @@ where
192190
let mut n_total = 0;
193191
let mut n_needed = 0;
194192
loop {
195-
if let Some(Adjustment { kind: Adjust::Deref(overloaded_deref), target }) = iter.next() {
193+
if let Some(Adjustment {
194+
kind: Adjust::Deref(overloaded_deref),
195+
target,
196+
}) = iter.next()
197+
{
196198
n_total += 1;
197199
if overloaded_deref.is_some() {
198200
n_needed = n_total;

clippy_lints/src/lib.register_nursery.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
3030
LintId::of(strings::STRING_LIT_AS_BYTES),
3131
LintId::of(suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS),
3232
LintId::of(trailing_empty_array::TRAILING_EMPTY_ARRAY),
33+
LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
34+
LintId::of(trait_bounds::TYPE_REPETITION_IN_BOUNDS),
3335
LintId::of(transmute::TRANSMUTE_UNDEFINED_REPR),
3436
LintId::of(unused_peekable::UNUSED_PEEKABLE),
3537
LintId::of(unused_rounding::UNUSED_ROUNDING),

clippy_lints/src/lib.register_pedantic.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
8888
LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
8989
LintId::of(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED),
9090
LintId::of(strings::STRING_ADD_ASSIGN),
91-
LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
92-
LintId::of(trait_bounds::TYPE_REPETITION_IN_BOUNDS),
9391
LintId::of(transmute::TRANSMUTE_PTR_TO_PTR),
9492
LintId::of(types::LINKEDLIST),
9593
LintId::of(types::OPTION_OPTION),

clippy_lints/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(drain_filter)]
66
#![feature(iter_intersperse)]
77
#![feature(let_chains)]
8-
#![cfg_attr(bootstrap, feature(let_else))]
98
#![feature(lint_reasons)]
109
#![feature(never_type)]
1110
#![feature(once_cell)]

clippy_lints/src/lifetimes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use rustc_hir::intravisit::{
99
use rustc_hir::FnRetTy::Return;
1010
use rustc_hir::{
1111
BareFnTy, BodyId, FnDecl, GenericArg, GenericBound, GenericParam, GenericParamKind, Generics, Impl, ImplItem,
12-
ImplItemKind, Item, ItemKind, LangItem, Lifetime, LifetimeName, ParamName, PolyTraitRef, PredicateOrigin,
13-
TraitFn, TraitItem, TraitItemKind, Ty, TyKind, WherePredicate,
12+
ImplItemKind, Item, ItemKind, LangItem, Lifetime, LifetimeName, ParamName, PolyTraitRef, PredicateOrigin, TraitFn,
13+
TraitItem, TraitItemKind, Ty, TyKind, WherePredicate,
1414
};
1515
use rustc_lint::{LateContext, LateLintPass};
1616
use rustc_middle::hir::nested_filter as middle_nested_filter;
@@ -461,7 +461,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
461461
sub_visitor.visit_fn_decl(decl);
462462
self.nested_elision_site_lts.append(&mut sub_visitor.all_lts());
463463
},
464-
TyKind::TraitObject(bounds, ref lt, _) => {
464+
TyKind::TraitObject(bounds, lt, _) => {
465465
if !lt.is_elided() {
466466
self.unelided_trait_object_lifetime = true;
467467
}

0 commit comments

Comments
 (0)