File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ use rustc_type_ir::WithCachedTypeInfo;
7171use rustc_type_ir:: { CollectAndApply , DynKind , Interner , TypeFlags } ;
7272
7373use std:: any:: Any ;
74+ use std:: assert_matches:: debug_assert_matches;
7475use std:: borrow:: Borrow ;
7576use std:: cmp:: Ordering ;
7677use std:: fmt;
@@ -2049,6 +2050,12 @@ impl<'tcx> TyCtxt<'tcx> {
20492050
20502051 #[ inline]
20512052 pub fn mk_alias ( self , kind : ty:: AliasKind , alias_ty : ty:: AliasTy < ' tcx > ) -> Ty < ' tcx > {
2053+ debug_assert_matches ! (
2054+ ( kind, self . def_kind( alias_ty. def_id) ) ,
2055+ ( ty:: Opaque , DefKind :: OpaqueTy )
2056+ | ( ty:: Projection , DefKind :: AssocTy | DefKind :: AssocConst )
2057+ | ( ty:: Opaque | ty:: Projection , DefKind :: ImplTraitPlaceholder )
2058+ ) ;
20522059 self . mk_ty_from_kind ( Alias ( kind, alias_ty) )
20532060 }
20542061
You can’t perform that action at this time.
0 commit comments