]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/ty/outlives.rs
Make RFC 1214 warnings into errors, and rip out the "warn or err"
[rust.git] / src / librustc / middle / ty / outlives.rs
index ea092ed977edaa11f044c618c8a20402a8e01d64..7752367febb19c6fdbaca3212af2faf1c556df55 100644 (file)
@@ -53,12 +53,6 @@ pub enum Component<'tcx> {
     // them. This gives us room to improve the regionck reasoning in
     // the future without breaking backwards compat.
     EscapingProjection(Vec<Component<'tcx>>),
-
-    // This is a temporary marker indicating "outlives components"
-    // that are due to the new rules introduced by RFC 1214.  For the
-    // time being, violations of these requirements generally induce
-    // warnings, not errors.
-    RFC1214(Vec<Component<'tcx>>),
 }
 
 /// Returns all the things that must outlive `'a` for the condition
@@ -124,20 +118,6 @@ fn compute_components<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
             }
         }
 
-        // Bare functions and traits are both binders. In the RFC,
-        // this means we would add the bound regions to the "bound
-        // regions list".  In our representation, no such list is
-        // maintained explicitly, because bound regions themselves can
-        // be readily identified. However, because the outlives
-        // relation did not used to be applied to fn/trait-object
-        // arguments, we wrap the resulting components in an RFC1214
-        // wrapper so we can issue warnings.
-        ty::TyBareFn(..) | ty::TyTrait(..) => {
-            // OutlivesFunction, OutlivesObject, OutlivesFragment
-            let subcomponents = capture_components(infcx, ty);
-            out.push(Component::RFC1214(subcomponents));
-        }
-
         // OutlivesTypeParameterEnv -- the actual checking that `X:'a`
         // is implied by the environment is done in regionck.
         ty::TyParam(p) => {
@@ -202,7 +182,15 @@ fn compute_components<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
         ty::TyRawPtr(..) |      // ...
         ty::TyRef(..) |         // OutlivesReference
         ty::TyTuple(..) |       // ...
+        ty::TyBareFn(..) |      // OutlivesFunction (*)
+        ty::TyTrait(..) |       // OutlivesObject, OutlivesFragment (*)
         ty::TyError => {
+            // (*) Bare functions and traits are both binders. In the
+            // RFC, this means we would add the bound regions to the
+            // "bound regions list".  In our representation, no such
+            // list is maintained explicitly, because bound regions
+            // themselves can be readily identified.
+
             push_region_constraints(out, ty.regions());
             for subty in ty.walk_shallow() {
                 compute_components(infcx, subty, out);