]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/bounds.rs
Rustdoc render public underscore_imports as Re-exports
[rust.git] / compiler / rustc_typeck / src / bounds.rs
index 497754f20e4c5ce9b896f7f76f20ed76e0de1c07..7ba90ad88193f8302ff26cde6120afb803fb6d62 100644 (file)
@@ -26,7 +26,7 @@ pub struct Bounds<'tcx> {
     /// A list of region bounds on the (implicit) self type. So if you
     /// had `T: 'a + 'b` this might would be a list `['a, 'b]` (but
     /// the `T` is not explicitly included).
-    pub region_bounds: Vec<(ty::Region<'tcx>, Span)>,
+    pub region_bounds: Vec<(ty::Binder<ty::Region<'tcx>>, Span)>,
 
     /// A list of trait bounds. So if you had `T: Debug` this would be
     /// `T: Debug`. Note that the self-type is explicit here.
@@ -68,8 +68,12 @@ pub fn predicates(
         sized_predicate
             .into_iter()
             .chain(self.region_bounds.iter().map(|&(region_bound, span)| {
-                let outlives = ty::OutlivesPredicate(param_ty, region_bound);
-                (ty::Binder::bind(outlives).to_predicate(tcx), span)
+                (
+                    region_bound
+                        .map_bound(|region_bound| ty::OutlivesPredicate(param_ty, region_bound))
+                        .to_predicate(tcx),
+                    span,
+                )
             }))
             .chain(self.trait_bounds.iter().map(|&(bound_trait_ref, span, constness)| {
                 let predicate = bound_trait_ref.with_constness(constness).to_predicate(tcx);