Skip to content

Commit 371c74e

Browse files
committed
submodules: update clippy from 8485d40 to 23549a8
Changes: ```` rustup rust-lang/rust#69738 rustup rust-lang/rust#68944 Make use of `or_patterns` feature rustup rust-lang/rust#69589 Rustup to rust-lang/rust#69076 Don't convert Path to lossy str Use `into_path` Use pattern matching instead of manually checking condition Fix typo Remove git2 dependency. Document that wildcard_imports doesn't warn about `use ...::prelude::*;` Change changelog formatting Update changelog_update doc to reflect the actual ordering of the changelog Update CHANGELOG.md ```` Fixes #70007
1 parent b7fc905 commit 371c74e

Some content is hidden

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

53 files changed

+239
-138
lines changed

CHANGELOG.md

+92
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,98 @@ document.
1212

1313
Current Beta
1414

15+
[69f99e7...329923e](https://github.com/rust-lang/rust-clippy/compare/69f99e7...329923e)
16+
17+
### New lints
18+
19+
* [`filetype_is_file`] [#4543](https://github.com/rust-lang/rust-clippy/pull/4543)
20+
* [`let_underscore_must_use`] [#4823](https://github.com/rust-lang/rust-clippy/pull/4823)
21+
* [`modulo_arithmetic`] [#4867](https://github.com/rust-lang/rust-clippy/pull/4867)
22+
* [`mem_replace_with_default`] [#4881](https://github.com/rust-lang/rust-clippy/pull/4881)
23+
* [`mutable_key_type`] [#4885](https://github.com/rust-lang/rust-clippy/pull/4885)
24+
* [`imprecise_flops`] [#4897](https://github.com/rust-lang/rust-clippy/pull/4897)
25+
* [`suboptimal_flops`] [#4897](https://github.com/rust-lang/rust-clippy/pull/4897)
26+
* [`option_as_ref_deref`] [#4945](https://github.com/rust-lang/rust-clippy/pull/4945)
27+
* [`wildcard_in_or_patterns`] [#4960](https://github.com/rust-lang/rust-clippy/pull/4960)
28+
* [`iter_nth_zero`] [#4966](https://github.com/rust-lang/rust-clippy/pull/4966)
29+
* [`invalid_atomic_ordering`] [#4999](https://github.com/rust-lang/rust-clippy/pull/4999)
30+
* [`wildcard_imports`] [#5029](https://github.com/rust-lang/rust-clippy/pull/5029)
31+
* [`single_component_path_imports`] [#5058](https://github.com/rust-lang/rust-clippy/pull/5058)
32+
* [`match_single_binding`] [#5061](https://github.com/rust-lang/rust-clippy/pull/5061)
33+
* [`skip_while_next`] [#5067](https://github.com/rust-lang/rust-clippy/pull/5067)
34+
* [`let_underscore_lock`] [#5101](https://github.com/rust-lang/rust-clippy/pull/5101)
35+
* [`struct_excessive_bools`] [#5125](https://github.com/rust-lang/rust-clippy/pull/5125)
36+
* [`fn_params_excessive_bools`] [#5125](https://github.com/rust-lang/rust-clippy/pull/5125)
37+
* [`option_env_unwrap`] [#5148](https://github.com/rust-lang/rust-clippy/pull/5148)
38+
* [`lossy_float_literal`] [#5202](https://github.com/rust-lang/rust-clippy/pull/5202)
39+
* [`rest_pat_in_fully_bound_structs`] [#5258](https://github.com/rust-lang/rust-clippy/pull/5258)
40+
41+
### Moves and Deprecations
42+
43+
* Move [`transmute_float_to_int`] from nursery to complexity group
44+
[#5015](https://github.com/rust-lang/rust-clippy/pull/5015)
45+
* Move [`range_plus_one`] to pedantic group [#5057](https://github.com/rust-lang/rust-clippy/pull/5057)
46+
* Move [`unneeded_field_pattern`] to pedantic group [#5200](https://github.com/rust-lang/rust-clippy/pull/5200)
47+
* Move [`debug_assert_with_mut_call`] to nursery group [#5106](https://github.com/rust-lang/rust-clippy/pull/5106)
48+
* Deprecate [`unused_label`] [#4930](https://github.com/rust-lang/rust-clippy/pull/4930)
49+
50+
### Enhancements
51+
52+
* Lint vectored IO in [`unused_io_amount`] [#5027](https://github.com/rust-lang/rust-clippy/pull/5027)
53+
* Make [`vec_box`] configurable by adding a size threshold [#5081](https://github.com/rust-lang/rust-clippy/pull/5081)
54+
* Make [`missing_errors_doc`] lint also trigger an `async` functions
55+
[#5181](https://github.com/rust-lang/rust-clippy/pull/5181)
56+
* Add more constants to [`approx_constant`] [#5193](https://github.com/rust-lang/rust-clippy/pull/5193)
57+
* Extend [`question_mark`] lint [#5266](https://github.com/rust-lang/rust-clippy/pull/5266)
58+
* Also lint constants in [`cmp_nan`] [#4910](https://github.com/rust-lang/rust-clippy/pull/4910)
59+
* Fix false negative in [`expect_fun_call`] [#4915](https://github.com/rust-lang/rust-clippy/pull/4915)
60+
* Fix false negative in [`redundant_clone`] [#5017](https://github.com/rust-lang/rust-clippy/pull/5017)
61+
62+
### False Positive Fixes
63+
64+
* [`map_clone`] [#4937](https://github.com/rust-lang/rust-clippy/pull/4937)
65+
* [`replace_consts`] [#4977](https://github.com/rust-lang/rust-clippy/pull/4977)
66+
* [`let_and_return`] [#5008](https://github.com/rust-lang/rust-clippy/pull/5008)
67+
* [`use_debug`] [#5047](https://github.com/rust-lang/rust-clippy/pull/5047)
68+
* [`eq_op`] [#5079](https://github.com/rust-lang/rust-clippy/pull/5079)
69+
* [`possible_missing_comma`] [#5083](https://github.com/rust-lang/rust-clippy/pull/5083)
70+
* [`debug_assert_with_mut_call`] [#5106](https://github.com/rust-lang/rust-clippy/pull/5106)
71+
* [`unnecessary_unwrap`] [#5132](https://github.com/rust-lang/rust-clippy/pull/5132)
72+
* [`zero_prefixed_literal`] [#5170](https://github.com/rust-lang/rust-clippy/pull/5170)
73+
* [`missing_const_for_fn`] [#5216](https://github.com/rust-lang/rust-clippy/pull/5216)
74+
* Don't trigger [`let_underscore_must_use`] in external macros
75+
[#5082](https://github.com/rust-lang/rust-clippy/pull/5082)
76+
* Don't trigger [`empty_loop`] in `no_std` crates [#5086](https://github.com/rust-lang/rust-clippy/pull/5086)
77+
78+
### Suggestion Improvements
79+
80+
* [`option_map_unwrap_or`] [#4634](https://github.com/rust-lang/rust-clippy/pull/4634)
81+
* [`wildcard_enum_match_arm`] [#4934](https://github.com/rust-lang/rust-clippy/pull/4934)
82+
* [`cognitive_complexity`] [#4935](https://github.com/rust-lang/rust-clippy/pull/4935)
83+
* [`decimal_literal_representation`] [#4956](https://github.com/rust-lang/rust-clippy/pull/4956)
84+
* [`unknown_clippy_lints`] [#4963](https://github.com/rust-lang/rust-clippy/pull/4963)
85+
* [`explicit_into_iter_loop`] [#4978](https://github.com/rust-lang/rust-clippy/pull/4978)
86+
* [`useless_attribute`] [#5022](https://github.com/rust-lang/rust-clippy/pull/5022)
87+
* [`if_let_some_result`] [#5032](https://github.com/rust-lang/rust-clippy/pull/5032)
88+
* Improve suggestion when blocks of code are suggested [#5134](https://github.com/rust-lang/rust-clippy/pull/5134)
89+
90+
### ICE fixes
91+
92+
* [`unsound_collection_transmute`] [#4975](https://github.com/rust-lang/rust-clippy/pull/4975)
93+
* `misc_early` lints [#5129](https://github.com/rust-lang/rust-clippy/pull/5129)
94+
* [`missing_errors_doc`] [#5213](https://github.com/rust-lang/rust-clippy/pull/5213)
95+
* Fix ICE when evaluating `usize`s [#5256](https://github.com/rust-lang/rust-clippy/pull/5256)
96+
97+
### Documentation
98+
99+
* Improve documentation of `empty_enum`, `replace_consts`, `redundant_clone`, and `iterator_step_by_zero`
100+
* Add documentation pages for stable releases [#5171](https://github.com/rust-lang/rust-clippy/pull/5171)
101+
102+
### Others
103+
104+
* Clippy now completely runs on GitHub Actions [#5190](https://github.com/rust-lang/rust-clippy/pull/5190)
105+
106+
15107
## Rust 1.41
16108

17109
Current stable, released 2020-01-30

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ clippy_lints = { version = "0.0.212", path = "clippy_lints" }
3737
regex = "1"
3838
semver = "0.9"
3939
rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util"}
40-
git2 = { version = "0.12", optional = true }
4140
tempfile = { version = "3.1.0", optional = true }
4241
lazy_static = "1.0"
4342

@@ -60,4 +59,4 @@ rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util"}
6059

6160
[features]
6261
deny-warnings = []
63-
integration = ["git2", "tempfile"]
62+
integration = ["tempfile"]

clippy_lints/src/assign_ops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ExprVisitor<'a, 'tcx> {
256256

257257
walk_expr(self, expr);
258258
}
259-
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
259+
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
260260
NestedVisitorMap::None
261261
}
262262
}

clippy_lints/src/attrs.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_ast::ast::{AttrKind, AttrStyle, Attribute, Lit, LitKind, MetaItemKind,
1212
use rustc_ast::util::lev_distance::find_best_match_for_name;
1313
use rustc_errors::Applicability;
1414
use rustc_hir::{
15-
Block, Expr, ExprKind, ImplItem, ImplItemKind, Item, ItemKind, StmtKind, TraitItem, TraitItemKind, TraitMethod,
15+
Block, Expr, ExprKind, ImplItem, ImplItemKind, Item, ItemKind, StmtKind, TraitFn, TraitItem, TraitItemKind,
1616
};
1717
use rustc_lint::{CheckLintNameResult, EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext};
1818
use rustc_session::{declare_lint_pass, declare_tool_lint};
@@ -372,15 +372,15 @@ fn is_relevant_item(cx: &LateContext<'_, '_>, item: &Item<'_>) -> bool {
372372

373373
fn is_relevant_impl(cx: &LateContext<'_, '_>, item: &ImplItem<'_>) -> bool {
374374
match item.kind {
375-
ImplItemKind::Method(_, eid) => is_relevant_expr(cx, cx.tcx.body_tables(eid), &cx.tcx.hir().body(eid).value),
375+
ImplItemKind::Fn(_, eid) => is_relevant_expr(cx, cx.tcx.body_tables(eid), &cx.tcx.hir().body(eid).value),
376376
_ => false,
377377
}
378378
}
379379

380380
fn is_relevant_trait(cx: &LateContext<'_, '_>, item: &TraitItem<'_>) -> bool {
381381
match item.kind {
382-
TraitItemKind::Fn(_, TraitMethod::Required(_)) => true,
383-
TraitItemKind::Fn(_, TraitMethod::Provided(eid)) => {
382+
TraitItemKind::Fn(_, TraitFn::Required(_)) => true,
383+
TraitItemKind::Fn(_, TraitFn::Provided(eid)) => {
384384
is_relevant_expr(cx, cx.tcx.body_tables(eid), &cx.tcx.hir().body(eid).value)
385385
},
386386
_ => false,

clippy_lints/src/block_in_if_condition.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
6666
}
6767
walk_expr(self, expr);
6868
}
69-
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
69+
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
7070
NestedVisitorMap::None
7171
}
7272
}

clippy_lints/src/booleans.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
457457
_ => walk_expr(self, e),
458458
}
459459
}
460-
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
460+
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
461461
NestedVisitorMap::None
462462
}
463463
}
@@ -491,7 +491,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NotSimplificationVisitor<'a, 'tcx> {
491491

492492
walk_expr(self, expr);
493493
}
494-
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
494+
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
495495
NestedVisitorMap::None
496496
}
497497
}

clippy_lints/src/cognitive_complexity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl<'tcx> Visitor<'tcx> for CCHelper {
156156
_ => {},
157157
}
158158
}
159-
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
159+
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
160160
NestedVisitorMap::None
161161
}
162162
}

clippy_lints/src/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
320320
fn fetch_path(&mut self, qpath: &QPath<'_>, id: HirId, ty: Ty<'cc>) -> Option<Constant> {
321321
let res = self.tables.qpath_res(qpath, id);
322322
match res {
323-
Res::Def(DefKind::Const, def_id) | Res::Def(DefKind::AssocConst, def_id) => {
323+
Res::Def(DefKind::Const | DefKind::AssocConst, def_id) => {
324324
let substs = self.tables.node_substs(id);
325325
let substs = if self.substs.is_empty() {
326326
substs

clippy_lints/src/dbg_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ declare_clippy_lint! {
3030
declare_lint_pass!(DbgMacro => [DBG_MACRO]);
3131

3232
impl EarlyLintPass for DbgMacro {
33-
fn check_mac(&mut self, cx: &EarlyContext<'_>, mac: &ast::Mac) {
33+
fn check_mac(&mut self, cx: &EarlyContext<'_>, mac: &ast::MacCall) {
3434
if mac.path == sym!(dbg) {
3535
if let Some(sugg) = tts_span(mac.args.inner_tokens()).and_then(|span| snippet_opt(cx, span)) {
3636
span_lint_and_sugg(

clippy_lints/src/doc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl_lint_pass!(DocMarkdown => [DOC_MARKDOWN, MISSING_SAFETY_DOC, MISSING_ERRORS
148148

149149
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DocMarkdown {
150150
fn check_crate(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx hir::Crate<'_>) {
151-
check_attrs(cx, &self.valid_idents, &krate.attrs);
151+
check_attrs(cx, &self.valid_idents, &krate.item.attrs);
152152
}
153153

154154
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item<'_>) {
@@ -191,7 +191,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DocMarkdown {
191191
if self.in_trait_impl || in_external_macro(cx.tcx.sess, item.span) {
192192
return;
193193
}
194-
if let hir::ImplItemKind::Method(ref sig, body_id) = item.kind {
194+
if let hir::ImplItemKind::Fn(ref sig, body_id) = item.kind {
195195
lint_for_missing_headers(cx, item.hir_id, item.span, sig, headers, Some(body_id));
196196
}
197197
}

clippy_lints/src/entry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for InsertVisitor<'a, 'tcx, 'b> {
181181
walk_expr(self, expr);
182182
}
183183
}
184-
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
184+
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
185185
NestedVisitorMap::None
186186
}
187187
}

clippy_lints/src/escape.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxedLocal {
9292
}
9393

9494
// TODO: Replace with Map::is_argument(..) when it's fixed
95-
fn is_argument(map: &rustc::hir::map::Map<'_>, id: HirId) -> bool {
95+
fn is_argument(map: rustc::hir::map::Map<'_>, id: HirId) -> bool {
9696
match map.find(id) {
9797
Some(Node::Binding(_)) => (),
9898
_ => return false,
@@ -136,7 +136,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
136136
fn mutate(&mut self, cmt: &Place<'tcx>) {
137137
if cmt.projections.is_empty() {
138138
let map = &self.cx.tcx.hir();
139-
if is_argument(map, cmt.hir_id) {
139+
if is_argument(*map, cmt.hir_id) {
140140
// Skip closure arguments
141141
let parent_id = map.get_parent_node(cmt.hir_id);
142142
if let Some(Node::Expr(..)) = map.find(map.get_parent_node(parent_id)) {

clippy_lints/src/eval_order_dependence.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ impl<'a, 'tcx> DivergenceVisitor<'a, 'tcx> {
106106
ExprKind::Match(ref e, arms, _) => {
107107
self.visit_expr(e);
108108
for arm in arms {
109-
if let Some(ref guard) = arm.guard {
110-
match guard {
111-
Guard::If(if_expr) => self.visit_expr(if_expr),
112-
}
109+
if let Some(Guard::If(if_expr)) = arm.guard {
110+
self.visit_expr(if_expr)
113111
}
114112
// make sure top level arm expressions aren't linted
115113
self.maybe_walk_expr(&*arm.body);
@@ -158,7 +156,7 @@ impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> {
158156
fn visit_block(&mut self, _: &'tcx Block<'_>) {
159157
// don't continue over blocks, LateLintPass already does that
160158
}
161-
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
159+
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
162160
NestedVisitorMap::None
163161
}
164162
}
@@ -341,7 +339,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ReadVisitor<'a, 'tcx> {
341339

342340
walk_expr(self, expr);
343341
}
344-
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
342+
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
345343
NestedVisitorMap::None
346344
}
347345
}

clippy_lints/src/fallible_impl_from.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_it
8585
intravisit::walk_expr(self, expr);
8686
}
8787

88-
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
88+
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
8989
NestedVisitorMap::None
9090
}
9191
}
9292

9393
for impl_item in impl_items {
9494
if_chain! {
9595
if impl_item.ident.name == sym!(from);
96-
if let ImplItemKind::Method(_, body_id) =
96+
if let ImplItemKind::Fn(_, body_id) =
9797
cx.tcx.hir().impl_item(impl_item.id).kind;
9898
then {
9999
// check the body for `begin_panic` or `unwrap`

clippy_lints/src/functions.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
250250
}
251251

252252
fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::ImplItem<'_>) {
253-
if let hir::ImplItemKind::Method(ref sig, ref body_id) = item.kind {
253+
if let hir::ImplItemKind::Fn(ref sig, ref body_id) = item.kind {
254254
let attr = must_use_attr(&item.attrs);
255255
if let Some(attr) = attr {
256256
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
@@ -284,7 +284,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
284284
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
285285
check_needless_must_use(cx, &sig.decl, item.hir_id, item.span, fn_header_span, attr);
286286
}
287-
if let hir::TraitMethod::Provided(eid) = *eid {
287+
if let hir::TraitFn::Provided(eid) = *eid {
288288
let body = cx.tcx.hir().body(eid);
289289
Self::check_raw_ptr(cx, sig.header.unsafety, &sig.decl, body, item.hir_id);
290290

@@ -561,7 +561,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for DerefVisitor<'a, 'tcx> {
561561
intravisit::walk_expr(self, expr);
562562
}
563563

564-
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
564+
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
565565
intravisit::NestedVisitorMap::None
566566
}
567567
}
@@ -624,7 +624,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for StaticMutVisitor<'a, 'tcx> {
624624
}
625625
}
626626

627-
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
627+
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
628628
intravisit::NestedVisitorMap::None
629629
}
630630
}

clippy_lints/src/inherent_to_string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InherentToString {
100100

101101
if_chain! {
102102
// Check if item is a method, called to_string and has a parameter 'self'
103-
if let ImplItemKind::Method(ref signature, _) = impl_item.kind;
103+
if let ImplItemKind::Fn(ref signature, _) = impl_item.kind;
104104
if impl_item.ident.name.as_str() == "to_string";
105105
let decl = &signature.decl;
106106
if decl.implicit_self.has_implicit_self();

clippy_lints/src/inline_fn_without_body.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::utils::span_lint_and_then;
44
use crate::utils::sugg::DiagnosticBuilderExt;
55
use rustc_ast::ast::{Attribute, Name};
66
use rustc_errors::Applicability;
7-
use rustc_hir::{TraitItem, TraitItemKind, TraitMethod};
7+
use rustc_hir::{TraitFn, TraitItem, TraitItemKind};
88
use rustc_lint::{LateContext, LateLintPass};
99
use rustc_session::{declare_lint_pass, declare_tool_lint};
1010

@@ -32,7 +32,7 @@ declare_lint_pass!(InlineFnWithoutBody => [INLINE_FN_WITHOUT_BODY]);
3232

3333
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InlineFnWithoutBody {
3434
fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem<'_>) {
35-
if let TraitItemKind::Fn(_, TraitMethod::Required(_)) = item.kind {
35+
if let TraitItemKind::Fn(_, TraitFn::Required(_)) = item.kind {
3636
check_attrs(cx, item.ident.name, &item.attrs);
3737
}
3838
}

clippy_lints/src/len_zero.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item<'_>, trait_i
134134
// fill the set with current and super traits
135135
fn fill_trait_set(traitt: DefId, set: &mut FxHashSet<DefId>, cx: &LateContext<'_, '_>) {
136136
if set.insert(traitt) {
137-
for supertrait in rustc_infer::traits::supertrait_def_ids(cx.tcx, traitt) {
137+
for supertrait in rustc_trait_selection::traits::supertrait_def_ids(cx.tcx, traitt) {
138138
fill_trait_set(supertrait, set, cx);
139139
}
140140
}

clippy_lints/src/let_if_seq.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for UsedVisitor<'a, 'tcx> {
158158
}
159159
intravisit::walk_expr(self, expr);
160160
}
161-
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
161+
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
162162
intravisit::NestedVisitorMap::None
163163
}
164164
}

clippy_lints/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#![feature(box_syntax)]
44
#![feature(box_patterns)]
5+
#![feature(or_patterns)]
56
#![feature(rustc_private)]
67
#![feature(stmt_expr_attributes)]
78
#![allow(clippy::missing_docs_in_private_items, clippy::must_use_candidate)]
@@ -51,6 +52,8 @@ extern crate rustc_span;
5152
#[allow(unused_extern_crates)]
5253
extern crate rustc_target;
5354
#[allow(unused_extern_crates)]
55+
extern crate rustc_trait_selection;
56+
#[allow(unused_extern_crates)]
5457
extern crate rustc_typeck;
5558

5659
use rustc::session::Session;

0 commit comments

Comments
 (0)