]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/infer/error_reporting.rs
Auto merge of #30470 - petrochenkov:owned5, r=nrc
[rust.git] / src / librustc / middle / infer / error_reporting.rs
index 88d6ba43954c54bc163ff62c7447afda14427d23..181e0c0fbc86b895e521de0b8d3633d2d41993c8 100644 (file)
@@ -577,11 +577,6 @@ fn report_generic_bound_failure(&self,
         // where the error was detected. But that span is not readily
         // accessible.
 
-        let is_warning = match origin {
-            infer::RFC1214Subregion(_) => true,
-            _ => false,
-        };
-
         let labeled_user_string = match bound_kind {
             GenericKind::Param(ref p) =>
                 format!("the parameter type `{}`", p),
@@ -592,8 +587,8 @@ fn report_generic_bound_failure(&self,
         match sub {
             ty::ReFree(ty::FreeRegion {bound_region: ty::BrNamed(..), ..}) => {
                 // Does the required lifetime have a nice name we can print?
-                span_err_or_warn!(
-                    is_warning, self.tcx.sess, origin.span(), E0309,
+                span_err!(
+                    self.tcx.sess, origin.span(), E0309,
                     "{} may not live long enough", labeled_user_string);
                 self.tcx.sess.fileline_help(
                     origin.span(),
@@ -605,8 +600,8 @@ fn report_generic_bound_failure(&self,
 
             ty::ReStatic => {
                 // Does the required lifetime have a nice name we can print?
-                span_err_or_warn!(
-                    is_warning, self.tcx.sess, origin.span(), E0310,
+                span_err!(
+                    self.tcx.sess, origin.span(), E0310,
                     "{} may not live long enough", labeled_user_string);
                 self.tcx.sess.fileline_help(
                     origin.span(),
@@ -617,8 +612,8 @@ fn report_generic_bound_failure(&self,
 
             _ => {
                 // If not, be less specific.
-                span_err_or_warn!(
-                    is_warning, self.tcx.sess, origin.span(), E0311,
+                span_err!(
+                    self.tcx.sess, origin.span(), E0311,
                     "{} may not live long enough",
                     labeled_user_string);
                 self.tcx.sess.fileline_help(
@@ -633,10 +628,6 @@ fn report_generic_bound_failure(&self,
             }
         }
 
-        if is_warning {
-            self.tcx.sess.note_rfc_1214(origin.span());
-        }
-
         self.note_region_origin(&origin);
     }
 
@@ -645,13 +636,6 @@ fn report_concrete_failure(&self,
                                sub: Region,
                                sup: Region) {
         match origin {
-            infer::RFC1214Subregion(ref suborigin) => {
-                // Ideally, this would be a warning, but it doesn't
-                // seem to come up in practice, since the changes from
-                // RFC1214 mostly trigger errors in type definitions
-                // that don't wind up coming down this path.
-                self.report_concrete_failure((**suborigin).clone(), sub, sup);
-            }
             infer::Subtype(trace) => {
                 let terr = TypeError::RegionsDoesNotOutlive(sup, sub);
                 self.report_and_explain_type_error(trace, &terr);
@@ -1598,9 +1582,6 @@ fn report_inference_failure(&self,
 
     fn note_region_origin(&self, origin: &SubregionOrigin<'tcx>) {
         match *origin {
-            infer::RFC1214Subregion(ref suborigin) => {
-                self.note_region_origin(suborigin);
-            }
             infer::Subtype(ref trace) => {
                 let desc = match trace.origin {
                     TypeOrigin::Misc(_) => {