Skip to content

Instantly share code, notes, and snippets.

@compiler-errors
Created June 10, 2022 05:57
Show Gist options
  • Save compiler-errors/4c57979c330d064830b44b74f542770e to your computer and use it in GitHub Desktop.
Save compiler-errors/4c57979c330d064830b44b74f542770e to your computer and use it in GitHub Desktop.
diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs
index ab79dcd4161..20b178ca6ad 100644
--- a/compiler/rustc_typeck/src/astconv/mod.rs
+++ b/compiler/rustc_typeck/src/astconv/mod.rs
@@ -2364,13 +2364,12 @@ pub fn res_to_ty(
let substs = self.ast_path_substs_for_ty(span, did, item_segment.0);
self.normalize_ty(span, tcx.mk_opaque(did, substs))
}
- Res::Def(DefKind::TyAlias, did) => {
- let item_segment = path.segments.split_last().unwrap();
- let substs = self.ast_path_substs_for_ty(span, did, item_segment.0);
- self.normalize_ty(span, tcx.mk_ty_alias(did, substs))
- }
Res::Def(
- DefKind::Enum | DefKind::Struct | DefKind::Union | DefKind::ForeignTy,
+ DefKind::Enum
+ | DefKind::Struct
+ | DefKind::Union
+ | DefKind::ForeignTy
+ | DefKind::TyAlias,
did,
) => {
assert_eq!(opt_self_ty, None);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment