File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use crate::ty::{
1111} ;
1212use crate :: ty:: { GenericArg , GenericArgs , GenericArgsRef } ;
1313use crate :: ty:: { List , ParamEnv } ;
14- use hir:: def:: DefKind ;
14+ use hir:: def:: { CtorKind , DefKind } ;
1515use rustc_data_structures:: captures:: Captures ;
1616use rustc_errors:: { DiagArgValue , ErrorGuaranteed , IntoDiagArg , MultiSpan } ;
1717use rustc_hir as hir;
@@ -1677,6 +1677,10 @@ impl<'tcx> Ty<'tcx> {
16771677 def_id : DefId ,
16781678 args : impl IntoIterator < Item : Into < GenericArg < ' tcx > > > ,
16791679 ) -> Ty < ' tcx > {
1680+ debug_assert_matches ! (
1681+ tcx. def_kind( def_id) ,
1682+ DefKind :: AssocFn | DefKind :: Fn | DefKind :: Ctor ( _, CtorKind :: Fn )
1683+ ) ;
16801684 let args = tcx. check_and_mk_args ( def_id, args) ;
16811685 Ty :: new ( tcx, FnDef ( def_id, args) )
16821686 }
You can’t perform that action at this time.
0 commit comments