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

This commit is contained in:
Philipp Krones 2024-03-21 22:05:29 +01:00
commit 7d42d736c5
No known key found for this signature in database
GPG key ID: 1CA0DF2AF59D68A5
195 changed files with 4233 additions and 1076 deletions

View file

@ -925,7 +925,7 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for LintResolver<'a, 'hir> {
&& let (expr_ty, _) = walk_ptrs_ty_depth(self.cx.typeck_results().expr_ty(expr))
&& match_type(self.cx, expr_ty, &paths::LINT)
{
if let hir::def::Res::Def(DefKind::Static(..), _) = path.res {
if let hir::def::Res::Def(DefKind::Static { .. }, _) = path.res {
let lint_name = last_path_segment(qpath).ident.name;
self.lints.push(sym_to_string(lint_name).to_ascii_lowercase());
} else if let Some(local) = get_parent_local(self.cx, expr) {

View file

@ -223,7 +223,7 @@ fn path_to_matched_type(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> Option<Ve
None
}
},
Res::Def(DefKind::Static(_), def_id) => read_mir_alloc_def_path(
Res::Def(DefKind::Static { .. }, def_id) => read_mir_alloc_def_path(
cx,
cx.tcx.eval_static_initializer(def_id).ok()?.inner(),
cx.tcx.type_of(def_id).instantiate_identity(),