We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent faae5f1 commit 5e2c549Copy full SHA for 5e2c549
compiler/rustc_middle/src/ty/sty.rs
@@ -1624,6 +1624,13 @@ impl<'tcx> Ty<'tcx> {
1624
1625
#[inline]
1626
pub fn new_adt(tcx: TyCtxt<'tcx>, def: AdtDef<'tcx>, args: GenericArgsRef<'tcx>) -> Ty<'tcx> {
1627
+ debug_assert_eq!(
1628
+ tcx.generics_of(def.did()).count(),
1629
+ args.len(),
1630
+ "wrong number of args for ADT: {:#?} vs {:#?}",
1631
+ tcx.generics_of(def.did()).params,
1632
+ args
1633
+ );
1634
Ty::new(tcx, Adt(def, args))
1635
}
1636
0 commit comments