Merge remote-tracking branch 'upstream/master' into rustup

This commit is contained in:
Philipp Krones 2024-10-03 14:42:56 +02:00
commit d300cdfcda
No known key found for this signature in database
GPG key ID: 1CA0DF2AF59D68A5
190 changed files with 2531 additions and 865 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) {