Skip to content

Commit ece0946

Browse files
committed
Merge commit '23d11428de3e973b34a5090a78d62887f821c90e' into clippyup
1 parent b2f8a27 commit ece0946

File tree

87 files changed

+2856
-4446
lines changed

Some content is hidden

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

87 files changed

+2856
-4446
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ out
2727
# Generated by dogfood
2828
/target_recur/
2929

30+
# Generated by lintcheck
31+
/lintcheck-logs
32+
3033
# gh pages docs
3134
util/gh-pages/lints.json
32-
**/metadata_collection.json
3335

3436
# rustfmt backups
3537
*.rs.bk

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3118,6 +3118,7 @@ Released 2018-09-13
31183118
[`result_map_or_into_option`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_map_or_into_option
31193119
[`result_map_unit_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_map_unit_fn
31203120
[`result_unit_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
3121+
[`return_self_not_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
31213122
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
31223123
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
31233124
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push
@@ -3209,6 +3210,7 @@ Released 2018-09-13
32093210
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
32103211
[`unnecessary_self_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_self_imports
32113212
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
3213+
[`unnecessary_to_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
32123214
[`unnecessary_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
32133215
[`unnecessary_wraps`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
32143216
[`unneeded_field_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.
162162

163163
You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
164164

165-
* the whole set of `Warn` lints using the `clippy` lint group (`#![deny(clippy::all)]`)
165+
* the whole set of `Warn` lints using the `clippy` lint group (`#![deny(clippy::all)]`).
166+
Note that `rustc` has additional [lint groups](https://doc.rust-lang.org/rustc/lints/groups.html).
166167

167168
* all lints using both the `clippy` and `clippy::pedantic` lint groups (`#![deny(clippy::all)]`,
168169
`#![deny(clippy::pedantic)]`). Note that `clippy::pedantic` contains some very aggressive

clippy_lints/src/asm_syntax.rs

+4
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,15 @@ declare_clippy_lint! {
6565
/// ```rust,no_run
6666
/// # #![feature(asm)]
6767
/// # unsafe { let ptr = "".as_ptr();
68+
/// # use std::arch::asm;
6869
/// asm!("lea {}, [{}]", lateout(reg) _, in(reg) ptr);
6970
/// # }
7071
/// ```
7172
/// Use instead:
7273
/// ```rust,no_run
7374
/// # #![feature(asm)]
7475
/// # unsafe { let ptr = "".as_ptr();
76+
/// # use std::arch::asm;
7577
/// asm!("lea ({}), {}", in(reg) ptr, lateout(reg) _, options(att_syntax));
7678
/// # }
7779
/// ```
@@ -102,13 +104,15 @@ declare_clippy_lint! {
102104
/// ```rust,no_run
103105
/// # #![feature(asm)]
104106
/// # unsafe { let ptr = "".as_ptr();
107+
/// # use std::arch::asm;
105108
/// asm!("lea ({}), {}", in(reg) ptr, lateout(reg) _, options(att_syntax));
106109
/// # }
107110
/// ```
108111
/// Use instead:
109112
/// ```rust,no_run
110113
/// # #![feature(asm)]
111114
/// # unsafe { let ptr = "".as_ptr();
115+
/// # use std::arch::asm;
112116
/// asm!("lea {}, [{}]", lateout(reg) _, in(reg) ptr);
113117
/// # }
114118
/// ```

clippy_lints/src/assertions_on_constants.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clippy_utils::consts::{constant, Constant};
22
use clippy_utils::diagnostics::span_lint_and_help;
33
use clippy_utils::higher;
44
use clippy_utils::source::snippet_opt;
5-
use clippy_utils::{is_direct_expn_of, is_expn_of, match_panic_call};
5+
use clippy_utils::{is_direct_expn_of, is_expn_of, match_panic_call, peel_blocks};
66
use if_chain::if_chain;
77
use rustc_hir::{Expr, ExprKind, UnOp};
88
use rustc_lint::{LateContext, LateLintPass};
@@ -122,15 +122,7 @@ fn match_assert_with_message<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>)
122122
if let ExprKind::Unary(UnOp::Not, expr) = cond.kind;
123123
// bind the first argument of the `assert!` macro
124124
if let Some((Constant::Bool(is_true), _)) = constant(cx, cx.typeck_results(), expr);
125-
// block
126-
if let ExprKind::Block(block, _) = then.kind;
127-
if block.stmts.is_empty();
128-
if let Some(block_expr) = &block.expr;
129-
// inner block is optional. unwrap it if it exists, or use the expression as is otherwise.
130-
if let Some(begin_panic_call) = match block_expr.kind {
131-
ExprKind::Block(inner_block, _) => &inner_block.expr,
132-
_ => &block.expr,
133-
};
125+
let begin_panic_call = peel_blocks(then);
134126
// function call
135127
if let Some(arg) = match_panic_call(cx, begin_panic_call);
136128
// bind the second argument of the `assert!` macro if it exists

clippy_lints/src/blocks_in_if_conditions.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ impl<'a, 'tcx> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
7373

7474
let body = self.cx.tcx.hir().body(eid);
7575
let ex = &body.value;
76-
if matches!(ex.kind, ExprKind::Block(_, _)) && !body.value.span.from_expansion() {
77-
self.found_block = Some(ex);
78-
return;
76+
if let ExprKind::Block(block, _) = ex.kind {
77+
if !body.value.span.from_expansion() && !block.stmts.is_empty() {
78+
self.found_block = Some(ex);
79+
return;
80+
}
7981
}
8082
}
8183
walk_expr(self, expr);

clippy_lints/src/bytecount.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_sugg;
22
use clippy_utils::source::snippet_with_applicability;
33
use clippy_utils::ty::match_type;
44
use clippy_utils::visitors::is_local_used;
5-
use clippy_utils::{path_to_local_id, paths, peel_ref_operators, remove_blocks, strip_pat_refs};
5+
use clippy_utils::{path_to_local_id, paths, peel_blocks, peel_ref_operators, strip_pat_refs};
66
use if_chain::if_chain;
77
use rustc_errors::Applicability;
88
use rustc_hir::{BinOpKind, Expr, ExprKind, PatKind};
@@ -42,7 +42,7 @@ impl<'tcx> LateLintPass<'tcx> for ByteCount {
4242
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
4343
if_chain! {
4444
if let ExprKind::MethodCall(count, _, [count_recv], _) = expr.kind;
45-
if count.ident.name == sym!(count);
45+
if count.ident.name == sym::count;
4646
if let ExprKind::MethodCall(filter, _, [filter_recv, filter_arg], _) = count_recv.kind;
4747
if filter.ident.name == sym!(filter);
4848
if let ExprKind::Closure(_, _, body_id, _, _) = filter_arg.kind;
@@ -55,7 +55,7 @@ impl<'tcx> LateLintPass<'tcx> for ByteCount {
5555
cx.typeck_results().expr_ty(filter_recv).peel_refs(),
5656
&paths::SLICE_ITER);
5757
let operand_is_arg = |expr| {
58-
let expr = peel_ref_operators(cx, remove_blocks(expr));
58+
let expr = peel_ref_operators(cx, peel_blocks(expr));
5959
path_to_local_id(expr, arg_id)
6060
};
6161
let needle = if operand_is_arg(l) {

clippy_lints/src/collapsible_match.rs

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use clippy_utils::diagnostics::span_lint_and_then;
22
use clippy_utils::higher::IfLetOrMatch;
33
use clippy_utils::visitors::is_local_used;
4-
use clippy_utils::{is_lang_ctor, is_unit_expr, path_to_local, peel_ref_operators, SpanlessEq};
4+
use clippy_utils::{is_lang_ctor, is_unit_expr, path_to_local, peel_blocks_with_stmt, peel_ref_operators, SpanlessEq};
55
use if_chain::if_chain;
66
use rustc_hir::LangItem::OptionNone;
7-
use rustc_hir::{Arm, Expr, ExprKind, Guard, HirId, Pat, PatKind, StmtKind};
7+
use rustc_hir::{Arm, Expr, Guard, HirId, Pat, PatKind};
88
use rustc_lint::{LateContext, LateLintPass};
99
use rustc_session::{declare_lint_pass, declare_tool_lint};
1010
use rustc_span::{MultiSpan, Span};
@@ -75,7 +75,7 @@ fn check_arm<'tcx>(
7575
outer_guard: Option<&'tcx Guard<'tcx>>,
7676
outer_else_body: Option<&'tcx Expr<'tcx>>,
7777
) {
78-
let inner_expr = strip_singleton_blocks(outer_then_body);
78+
let inner_expr = peel_blocks_with_stmt(outer_then_body);
7979
if_chain! {
8080
if let Some(inner) = IfLetOrMatch::parse(cx, inner_expr);
8181
if let Some((inner_scrutinee, inner_then_pat, inner_else_body)) = match inner {
@@ -138,20 +138,6 @@ fn check_arm<'tcx>(
138138
}
139139
}
140140

141-
fn strip_singleton_blocks<'hir>(mut expr: &'hir Expr<'hir>) -> &'hir Expr<'hir> {
142-
while let ExprKind::Block(block, _) = expr.kind {
143-
match (block.stmts, block.expr) {
144-
([stmt], None) => match stmt.kind {
145-
StmtKind::Expr(e) | StmtKind::Semi(e) => expr = e,
146-
_ => break,
147-
},
148-
([], Some(e)) => expr = e,
149-
_ => break,
150-
}
151-
}
152-
expr
153-
}
154-
155141
/// A "wild-like" arm has a wild (`_`) or `None` pattern and no guard. Such arms can be "collapsed"
156142
/// into a single wild arm without any significant loss in semantics or readability.
157143
fn arm_is_wild_like(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool {

clippy_lints/src/derivable_impls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clippy_utils::diagnostics::span_lint_and_help;
2-
use clippy_utils::{is_automatically_derived, is_default_equivalent, remove_blocks};
2+
use clippy_utils::{is_automatically_derived, is_default_equivalent, peel_blocks};
33
use rustc_hir::{
44
def::{DefKind, Res},
55
Body, Expr, ExprKind, GenericArg, Impl, ImplItemKind, Item, ItemKind, Node, PathSegment, QPath, TyKind,
@@ -95,7 +95,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
9595
}
9696
}
9797
}
98-
let should_emit = match remove_blocks(func_expr).kind {
98+
let should_emit = match peel_blocks(func_expr).kind {
9999
ExprKind::Tup(fields) => fields.iter().all(|e| is_default_equivalent(cx, e)),
100100
ExprKind::Call(callee, args)
101101
if is_path_self(callee) => args.iter().all(|e| is_default_equivalent(cx, e)),

clippy_lints/src/floating_point_arithmetic.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use clippy_utils::consts::{
44
};
55
use clippy_utils::diagnostics::span_lint_and_sugg;
66
use clippy_utils::higher;
7-
use clippy_utils::{eq_expr_value, get_parent_expr, in_constant, numeric_literal, sugg};
7+
use clippy_utils::{eq_expr_value, get_parent_expr, in_constant, numeric_literal, peel_blocks, sugg};
88
use if_chain::if_chain;
99
use rustc_errors::Applicability;
1010
use rustc_hir::{BinOpKind, Expr, ExprKind, PathSegment, UnOp};
@@ -546,13 +546,9 @@ fn are_negated<'a>(cx: &LateContext<'_>, expr1: &'a Expr<'a>, expr2: &'a Expr<'a
546546

547547
fn check_custom_abs(cx: &LateContext<'_>, expr: &Expr<'_>) {
548548
if_chain! {
549-
if let Some(higher::If { cond, then, r#else }) = higher::If::hir(expr);
550-
if let ExprKind::Block(block, _) = then.kind;
551-
if block.stmts.is_empty();
552-
if let Some(if_body_expr) = block.expr;
553-
if let Some(ExprKind::Block(else_block, _)) = r#else.map(|el| &el.kind);
554-
if else_block.stmts.is_empty();
555-
if let Some(else_body_expr) = else_block.expr;
549+
if let Some(higher::If { cond, then, r#else: Some(r#else) }) = higher::If::hir(expr);
550+
let if_body_expr = peel_blocks(then);
551+
let else_body_expr = peel_blocks(r#else);
556552
if let Some((if_expr_positive, body)) = are_negated(cx, if_body_expr, else_body_expr);
557553
then {
558554
let positive_abs_sugg = (

clippy_lints/src/if_then_some_else_none.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::span_lint_and_help;
22
use clippy_utils::source::snippet_with_macro_callsite;
3-
use clippy_utils::{contains_return, higher, is_else_clause, is_lang_ctor, meets_msrv, msrvs};
3+
use clippy_utils::{contains_return, higher, is_else_clause, is_lang_ctor, meets_msrv, msrvs, peel_blocks};
44
use if_chain::if_chain;
55
use rustc_hir::LangItem::{OptionNone, OptionSome};
66
use rustc_hir::{Expr, ExprKind, Stmt, StmtKind};
@@ -77,10 +77,7 @@ impl LateLintPass<'_> for IfThenSomeElseNone {
7777
if let ExprKind::Call(then_call, [then_arg]) = then_expr.kind;
7878
if let ExprKind::Path(ref then_call_qpath) = then_call.kind;
7979
if is_lang_ctor(cx, then_call_qpath, OptionSome);
80-
if let ExprKind::Block(els_block, _) = els.kind;
81-
if els_block.stmts.is_empty();
82-
if let Some(els_expr) = els_block.expr;
83-
if let ExprKind::Path(ref qpath) = els_expr.kind;
80+
if let ExprKind::Path(ref qpath) = peel_blocks(els).kind;
8481
if is_lang_ctor(cx, qpath, OptionNone);
8582
if !stmts_contains_early_return(then_block.stmts);
8683
then {

clippy_lints/src/implicit_saturating_sub.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use clippy_utils::diagnostics::span_lint_and_sugg;
2-
use clippy_utils::higher;
3-
use clippy_utils::SpanlessEq;
2+
use clippy_utils::{higher, peel_blocks_with_stmt, SpanlessEq};
43
use if_chain::if_chain;
54
use rustc_ast::ast::LitKind;
65
use rustc_errors::Applicability;
7-
use rustc_hir::{lang_items::LangItem, BinOpKind, Expr, ExprKind, QPath, StmtKind};
6+
use rustc_hir::{lang_items::LangItem, BinOpKind, Expr, ExprKind, QPath};
87
use rustc_lint::{LateContext, LateLintPass};
98
use rustc_session::{declare_lint_pass, declare_tool_lint};
109

@@ -52,13 +51,8 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingSub {
5251
// Ensure that the binary operator is >, != and <
5352
if BinOpKind::Ne == cond_op.node || BinOpKind::Gt == cond_op.node || BinOpKind::Lt == cond_op.node;
5453

55-
// Check if the true condition block has only one statement
56-
if let ExprKind::Block(block, _) = then.kind;
57-
if block.stmts.len() == 1 && block.expr.is_none();
58-
5954
// Check if assign operation is done
60-
if let StmtKind::Semi(e) = block.stmts[0].kind;
61-
if let Some(target) = subtracts_one(cx, e);
55+
if let Some(target) = subtracts_one(cx, then);
6256

6357
// Extracting out the variable name
6458
if let ExprKind::Path(QPath::Resolved(_, ares_path)) = target.kind;
@@ -138,8 +132,8 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingSub {
138132
}
139133
}
140134

141-
fn subtracts_one<'a>(cx: &LateContext<'_>, expr: &Expr<'a>) -> Option<&'a Expr<'a>> {
142-
match expr.kind {
135+
fn subtracts_one<'a>(cx: &LateContext<'_>, expr: &'a Expr<'a>) -> Option<&'a Expr<'a>> {
136+
match peel_blocks_with_stmt(expr).kind {
143137
ExprKind::AssignOp(ref op1, target, value) => {
144138
if_chain! {
145139
if BinOpKind::Sub == op1.node;

clippy_lints/src/lib.register_all.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
181181
LintId::of(methods::UNNECESSARY_FILTER_MAP),
182182
LintId::of(methods::UNNECESSARY_FOLD),
183183
LintId::of(methods::UNNECESSARY_LAZY_EVALUATIONS),
184+
LintId::of(methods::UNNECESSARY_TO_OWNED),
184185
LintId::of(methods::UNWRAP_OR_ELSE_DEFAULT),
185186
LintId::of(methods::USELESS_ASREF),
186187
LintId::of(methods::WRONG_SELF_CONVENTION),
@@ -220,7 +221,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
220221
LintId::of(non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
221222
LintId::of(non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
222223
LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS),
223-
LintId::of(non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY),
224224
LintId::of(octal_escapes::OCTAL_ESCAPES),
225225
LintId::of(open_options::NONSENSICAL_OPEN_OPTIONS),
226226
LintId::of(option_env_unwrap::OPTION_ENV_UNWRAP),
@@ -246,6 +246,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
246246
LintId::of(reference::REF_IN_DEREF),
247247
LintId::of(regex::INVALID_REGEX),
248248
LintId::of(repeat_once::REPEAT_ONCE),
249+
LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
249250
LintId::of(returns::LET_AND_RETURN),
250251
LintId::of(returns::NEEDLESS_RETURN),
251252
LintId::of(self_assignment::SELF_ASSIGNMENT),

clippy_lints/src/lib.register_lints.rs

+2
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ store.register_lints(&[
315315
methods::UNNECESSARY_FILTER_MAP,
316316
methods::UNNECESSARY_FOLD,
317317
methods::UNNECESSARY_LAZY_EVALUATIONS,
318+
methods::UNNECESSARY_TO_OWNED,
318319
methods::UNWRAP_OR_ELSE_DEFAULT,
319320
methods::UNWRAP_USED,
320321
methods::USELESS_ASREF,
@@ -422,6 +423,7 @@ store.register_lints(&[
422423
regex::INVALID_REGEX,
423424
regex::TRIVIAL_REGEX,
424425
repeat_once::REPEAT_ONCE,
426+
return_self_not_must_use::RETURN_SELF_NOT_MUST_USE,
425427
returns::LET_AND_RETURN,
426428
returns::NEEDLESS_RETURN,
427429
same_name_method::SAME_NAME_METHOD,

clippy_lints/src/lib.register_nursery.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
1818
LintId::of(missing_const_for_fn::MISSING_CONST_FOR_FN),
1919
LintId::of(mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL),
2020
LintId::of(mutex_atomic::MUTEX_INTEGER),
21+
LintId::of(non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY),
2122
LintId::of(nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES),
2223
LintId::of(option_if_let_else::OPTION_IF_LET_ELSE),
2324
LintId::of(path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),

clippy_lints/src/lib.register_perf.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ store.register_group(true, "clippy::perf", Some("clippy_perf"), vec![
1717
LintId::of(methods::MANUAL_STR_REPEAT),
1818
LintId::of(methods::OR_FUN_CALL),
1919
LintId::of(methods::SINGLE_CHAR_PATTERN),
20+
LintId::of(methods::UNNECESSARY_TO_OWNED),
2021
LintId::of(misc::CMP_OWNED),
2122
LintId::of(mutex_atomic::MUTEX_ATOMIC),
2223
LintId::of(redundant_clone::REDUNDANT_CLONE),

clippy_lints/src/lib.register_suspicious.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec!
1515
LintId::of(loops::MUT_RANGE_BOUND),
1616
LintId::of(methods::SUSPICIOUS_MAP),
1717
LintId::of(mut_key::MUTABLE_KEY_TYPE),
18-
LintId::of(non_send_fields_in_send_ty::NON_SEND_FIELDS_IN_SEND_TY),
1918
LintId::of(octal_escapes::OCTAL_ESCAPES),
19+
LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
2020
LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
2121
LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
2222
])

clippy_lints/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ mod ref_option_ref;
340340
mod reference;
341341
mod regex;
342342
mod repeat_once;
343+
mod return_self_not_must_use;
343344
mod returns;
344345
mod same_name_method;
345346
mod self_assignment;
@@ -852,6 +853,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
852853
store.register_late_pass(|| Box::new(trailing_empty_array::TrailingEmptyArray));
853854
store.register_early_pass(|| Box::new(octal_escapes::OctalEscapes));
854855
store.register_late_pass(|| Box::new(needless_late_init::NeedlessLateInit));
856+
store.register_late_pass(|| Box::new(return_self_not_must_use::ReturnSelfNotMustUse));
855857
// add lints here, do not remove this comment, it's used in `new_lint`
856858
}
857859

clippy_lints/src/lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ declare_clippy_lint! {
2929
///
3030
/// ### Known problems
3131
/// - We bail out if the function has a `where` clause where lifetimes
32-
/// are mentioned due to potenial false positives.
32+
/// are mentioned due to potential false positives.
3333
/// - Lifetime bounds such as `impl Foo + 'a` and `T: 'a` must be elided with the
3434
/// placeholder notation `'_` because the fully elided notation leaves the type bound to `'static`.
3535
///

0 commit comments

Comments
 (0)