We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f34086 commit 957ee5cCopy full SHA for 957ee5c
src/librustc/middle/subst.rs
@@ -160,6 +160,15 @@ impl<'tcx> Substs<'tcx> {
160
Substs { types: types, regions: regions }
161
}
162
163
+ pub fn with_method_from_subst(self, other: &Substs<'tcx>) -> Substs<'tcx> {
164
+ let Substs { types, regions } = self;
165
+ let types = types.with_vec(FnSpace, other.types.get_slice(FnSpace).to_vec());
166
+ let regions = regions.map(|r| {
167
+ r.with_vec(FnSpace, other.regions().get_slice(FnSpace).to_vec())
168
+ });
169
+ Substs { types: types, regions: regions }
170
+ }
171
+
172
/// Creates a trait-ref out of this substs, ignoring the FnSpace substs
173
pub fn to_trait_ref(&self, tcx: &TyCtxt<'tcx>, trait_id: DefId)
174
-> ty::TraitRef<'tcx> {
0 commit comments