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;
71
71
use rustc_type_ir:: { CollectAndApply , DynKind , Interner , TypeFlags } ;
72
72
73
73
use std:: any:: Any ;
74
+ use std:: assert_matches:: debug_assert_matches;
74
75
use std:: borrow:: Borrow ;
75
76
use std:: cmp:: Ordering ;
76
77
use std:: fmt;
@@ -2049,6 +2050,12 @@ impl<'tcx> TyCtxt<'tcx> {
2049
2050
2050
2051
#[ inline]
2051
2052
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
+ ) ;
2052
2059
self . mk_ty_from_kind ( Alias ( kind, alias_ty) )
2053
2060
}
2054
2061
You can’t perform that action at this time.
0 commit comments