]> 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 683707470f406af0f28ee31f9c2e4127e68043d3..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.
@@ -67,22 +67,22 @@ pub fn predicates(
 
         sized_predicate
             .into_iter()
+            .chain(self.region_bounds.iter().map(|&(region_bound, 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);
+                (predicate, span)
+            }))
             .chain(
-                self.region_bounds
+                self.projection_bounds
                     .iter()
-                    .map(|&(region_bound, span)| {
-                        let outlives = ty::OutlivesPredicate(param_ty, region_bound);
-                        (ty::Binder::bind(outlives).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);
-                        (predicate, span)
-                    }))
-                    .chain(
-                        self.projection_bounds
-                            .iter()
-                            .map(|&(projection, span)| (projection.to_predicate(tcx), span)),
-                    ),
+                    .map(|&(projection, span)| (projection.to_predicate(tcx), span)),
             )
             .collect()
     }