]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_lint/src/internal.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / compiler / rustc_lint / src / internal.rs
index 6cefaea2bc7da8af59508ff2cad32366ccce9d54..2fd0ef3cda8b76bfab36cc67ab26b94f4a521f69 100644 (file)
@@ -216,7 +216,7 @@ fn is_ty_or_ty_ctxt(cx: &LateContext<'_>, path: &Path<'_>) -> Option<String> {
         }
         // Only lint on `&Ty` and `&TyCtxt` if it is used outside of a trait.
         Res::SelfTyAlias { alias_to: did, is_trait_impl: false, .. } => {
-            if let ty::Adt(adt, substs) = cx.tcx.type_of(did).kind() {
+            if let ty::Adt(adt, substs) = cx.tcx.type_of(did).subst_identity().kind() {
                 if let Some(name @ (sym::Ty | sym::TyCtxt)) = cx.tcx.get_diagnostic_name(adt.did())
                 {
                     // NOTE: This path is currently unreachable as `Ty<'tcx>` is