Merge commit 'aa0d551351' into clippy-subtree-update

This commit is contained in:
Philipp Krones 2024-10-03 16:32:51 +02:00
parent 4891dd4627
commit 277c4e4baf
183 changed files with 2484 additions and 848 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -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) {