diff options
| author | Philipp Krones <hello@philkrones.com> | 2024-10-03 16:32:51 +0200 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2024-10-03 16:32:51 +0200 |
| commit | 277c4e4baff50ff0df4b63e86404b8eea70e61ec (patch) | |
| tree | 180f9eae4b5683842ff29520e2ed1ff38f393493 /clippy_lints/src/utils | |
| parent | 4891dd4627be38fa6133fcf3cfb0c1a65867bf87 (diff) | |
| download | rust-277c4e4baff50ff0df4b63e86404b8eea70e61ec.tar.gz rust-277c4e4baff50ff0df4b63e86404b8eea70e61ec.zip | |
Merge commit 'aa0d551351a9c15d8a95fdb3e2946b505893dda8' into clippy-subtree-update
Diffstat (limited to 'clippy_lints/src/utils')
3 files changed, 3 insertions, 4 deletions
diff --git a/clippy_lints/src/utils/internal_lints/interning_defined_symbol.rs b/clippy_lints/src/utils/internal_lints/interning_defined_symbol.rs index 7c2e23995c1..9e400d2391f 100644 --- a/clippy_lints/src/utils/internal_lints/interning_defined_symbol.rs +++ b/clippy_lints/src/utils/internal_lints/interning_defined_symbol.rs @@ -80,7 +80,7 @@ impl<'tcx> LateLintPass<'tcx> for InterningDefinedSymbol { && let ty = cx.tcx.type_of(item_def_id).instantiate_identity() && match_type(cx, ty, &paths::SYMBOL) && let Ok(ConstValue::Scalar(value)) = cx.tcx.const_eval_poly(item_def_id) - && let Ok(value) = value.to_u32() + && let Some(value) = value.to_u32().discard_err() { self.symbol_map.insert(value, item_def_id); } diff --git a/clippy_lints/src/utils/internal_lints/invalid_paths.rs b/clippy_lints/src/utils/internal_lints/invalid_paths.rs index d444ad45087..96397375d5e 100644 --- a/clippy_lints/src/utils/internal_lints/invalid_paths.rs +++ b/clippy_lints/src/utils/internal_lints/invalid_paths.rs @@ -72,8 +72,7 @@ pub fn check_path(cx: &LateContext<'_>, path: &[&str]) -> bool { SimplifiedType::Bool, ] .iter() - .flat_map(|&ty| cx.tcx.incoherent_impls(ty).into_iter()) - .flatten() + .flat_map(|&ty| cx.tcx.incoherent_impls(ty).iter()) .copied(); for item_def_id in lang_items.iter().map(|(_, def_id)| def_id).chain(incoherent_impls) { let lang_item_path = cx.get_def_path(item_def_id); diff --git a/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs b/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs index 7c45a5b2f09..dd456022212 100644 --- a/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs +++ b/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs @@ -270,7 +270,7 @@ struct LintCollector<'a, 'tcx> { cx: &'a LateContext<'tcx>, } -impl<'a, 'tcx> Visitor<'tcx> for LintCollector<'a, 'tcx> { +impl<'tcx> Visitor<'tcx> for LintCollector<'_, 'tcx> { type NestedFilter = nested_filter::All; fn visit_path(&mut self, path: &Path<'_>, _: HirId) { |
