// 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),
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(),
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(),
_ => {
// 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(
}
}
- if is_warning {
- self.tcx.sess.note_rfc_1214(origin.span());
- }
-
self.note_region_origin(&origin);
}
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);
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(_) => {