You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Instantiates a generic value `v`(like `Vec<T>`), substituting its generic arguments and turning it into a concrete one(like `i32`, or `Vec<f32>`).
750
+
/// If a value is not generic, this will do nothing.
751
+
/// This function does not erase lifetimes, so a value like `&'a i32` will remain unchanged.
752
+
/// For monomorphizing generics while also erasing lifetimes, try using [`Self::instantiate_mir_and_normalize_erasing_regions`].
744
753
pubfninstantiate_mir<T>(&self,tcx:TyCtxt<'tcx>,v:EarlyBinder<&T>) -> T
745
754
where
746
755
T:TypeFoldable<TyCtxt<'tcx>> + Copy,
@@ -753,6 +762,11 @@ impl<'tcx> Instance<'tcx> {
753
762
}
754
763
}
755
764
765
+
/// Instantiates a generic value `v`(like `Vec<T>`), substituting its generic arguments and turning it into a concrete one(like `i32`, or `Vec<f32>`).
766
+
/// This function erases lifetimes, so a value like `&'a i32` will become `&ReErased i32`.
767
+
/// If a value is not generic and has no lifetime info, this will do nothing.
768
+
/// For monomorphizing generics while preserving lifetimes, use [`Self::instantiate_mir`].
769
+
/// This function will panic if normalization fails. If you want to handle normalization errors, use [`Self::try_instantiate_mir_and_normalize_erasing_regions`]
756
770
#[inline(always)]
757
771
// Keep me in sync with try_instantiate_mir_and_normalize_erasing_regions
/// A version of [`Self::instantiate_mir_and_normalize_erasing_regions`] which will returns a [`NormalizationError`] on normalization failure instead of panicking.
774
789
#[inline(always)]
775
790
// Keep me in sync with instantiate_mir_and_normalize_erasing_regions
0 commit comments