Debug assertions hate this trick
This commit is contained in:
parent
49536667ff
commit
18373fae35
1 changed files with 3 additions and 3 deletions
|
@ -2577,17 +2577,17 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn check_substs(
|
fn check_substs(
|
||||||
self,
|
self,
|
||||||
def_id: DefId,
|
_def_id: DefId,
|
||||||
substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>,
|
substs: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>,
|
||||||
) -> SubstsRef<'tcx> {
|
) -> SubstsRef<'tcx> {
|
||||||
let substs = substs.into_iter().map(Into::into);
|
let substs = substs.into_iter().map(Into::into);
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
{
|
{
|
||||||
let n = self.generics_of(def_id).count();
|
let n = self.generics_of(_def_id).count();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
(n, Some(n)),
|
(n, Some(n)),
|
||||||
substs.size_hint(),
|
substs.size_hint(),
|
||||||
"wrong number of generic parameters for {def_id:?}: {:?}",
|
"wrong number of generic parameters for {_def_id:?}: {:?}",
|
||||||
substs.collect::<Vec<_>>(),
|
substs.collect::<Vec<_>>(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue