Change:
This issue is a proposal for the deprecation of error code . I opened a PR () as part of an effort to add long error explanations for error codes that didn't have one (). I chose and for my erroneous code example, I used the example from . I quickly realized, through running the example and other code that would also raise and through the CI failure message, that was not being raised. I went back to consult the issue I received the original code example from and noticed comments about not occurring anymore with . The issue was eventually labeled with . But, looking at the current contents of the file, can still be emitted even while it isn't: also doesn't have any UI tests as it is part of the error codes in . Since , is no longer actually emitted (although it is in code that it could) thanks to , I believe it should be deprecated. I would be happy to help deprecate the error code, if it is decided that it should happen. I would just need to know the proper steps to take to deprecate an error code. If there are reasons for why it is still an error code, I would love to be enlightened. claim <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
If is not emitted anymore then it can be removed immediately. A crater run can also be done to ensure that this is the case. I'm also happy to do this if you want.
Sure, that sounds good.
Sorry just for clarification, do you want me to do the PR or you?

Discussion:
//  E0300, // unexpanded macro //  E0304, // expected signed integer constant //  E0305, // expected constant <del> E0313, // lifetime of borrowed pointer outlives lifetime of captured // variable </del> <ins> //  E0313, // removed: found unreachable </ins> //  E0314, // closure outlives stack frame //  E0315, // cannot invoke closure outside of its lifetime //  E0319, // trait impls for defaulted traits allowed just for structs/enums

<del> // ignore-tidy-filelength </del> //! Error Reporting Code for the inference engine //! //! Because of the way inference, and in particular region inference,

infer::Reborrow(span) => { RegionOriginNote::Plain { span, msg: fluent::infer_reborrow }.add_to_diagnostic(err) } <del> infer::ReborrowUpvar(span, ref upvar_id) => { let var_name = self.tcx.hir().name(upvar_id.var_path.hir_id); RegionOriginNote::WithName { span, msg: fluent::infer_reborrow, name: &var_name.to_string(), continues: false, } .add_to_diagnostic(err); } </del> infer::RelateObjectBound(span) => { RegionOriginNote::Plain { span, msg: fluent::infer_relate_object_bound } .add_to_diagnostic(err);

); err } <del> infer::ReborrowUpvar(span, ref upvar_id) => { let var_name = self.tcx.hir().name(upvar_id.var_path.hir_id); let mut err = struct_span_err!( self.tcx.sess, span, E0313, "lifetime of borrowed pointer outlives lifetime of captured variable `{}`...", var_name ); note_and_explain_region( self.tcx, &mut err, "...the borrowed pointer is valid for ", sub, "...", None, ); note_and_explain_region( self.tcx, &mut err, &format!("...but `{}` is only valid for ", var_name), sup, "", None, ); err } </del> infer::RelateObjectBound(span) => { let mut err = struct_span_err!( self.tcx.sess,

/// Creating a pointer `b` to contents of another reference Reborrow(Span), <del> /// Creating a pointer `b` to contents of an upvar ReborrowUpvar(Span, ty::UpvarId), </del> /// Data with type `Ty<'tcx>` was borrowed DataBorrowed(Ty<'tcx>, Span),

RelateParamBound(a, ..) => a, RelateRegionParamBound(a) => a, Reborrow(a) => a, <del> ReborrowUpvar(a, _) => a, </del> DataBorrowed(_, a) => a, ReferenceOutlivesReferent(_, a) => a, CompareImplItemObligation { span, .. } => span,

// Error codes that don't yet have a UI test. This list will eventually be removed. const IGNORE_UI_TEST_CHECK: &[&str] = &[ <del> "E0313", "E0461", "E0465", "E0476", "E0490", "E0514", "E0523", "E0554", "E0640", "E0717", "E0729", "E0789", </del> <ins> "E0461", "E0465", "E0476", "E0490", "E0514", "E0523", "E0554", "E0640", "E0717", "E0729", "E0789", </ins> ]; macro_rules! verbose_print {