remove unreachable error code E0313
This commit is contained in:
parent
e5d46a5bda
commit
93c0d8d5d5
5 changed files with 3 additions and 46 deletions
|
@ -579,8 +579,7 @@ E0791: include_str!("./error_codes/E0791.md"),
|
||||||
// E0300, // unexpanded macro
|
// E0300, // unexpanded macro
|
||||||
// E0304, // expected signed integer constant
|
// E0304, // expected signed integer constant
|
||||||
// E0305, // expected constant
|
// E0305, // expected constant
|
||||||
E0313, // lifetime of borrowed pointer outlives lifetime of captured
|
// E0313, // removed: found unreachable
|
||||||
// variable
|
|
||||||
// E0314, // closure outlives stack frame
|
// E0314, // closure outlives stack frame
|
||||||
// E0315, // cannot invoke closure outside of its lifetime
|
// E0315, // cannot invoke closure outside of its lifetime
|
||||||
// E0319, // trait impls for defaulted traits allowed just for structs/enums
|
// E0319, // trait impls for defaulted traits allowed just for structs/enums
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
// ignore-tidy-filelength
|
|
||||||
//! Error Reporting Code for the inference engine
|
//! Error Reporting Code for the inference engine
|
||||||
//!
|
//!
|
||||||
//! Because of the way inference, and in particular region inference,
|
//! Because of the way inference, and in particular region inference,
|
||||||
|
|
|
@ -25,16 +25,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
||||||
infer::Reborrow(span) => {
|
infer::Reborrow(span) => {
|
||||||
RegionOriginNote::Plain { span, msg: fluent::infer_reborrow }.add_to_diagnostic(err)
|
RegionOriginNote::Plain { span, msg: fluent::infer_reborrow }.add_to_diagnostic(err)
|
||||||
}
|
}
|
||||||
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);
|
|
||||||
}
|
|
||||||
infer::RelateObjectBound(span) => {
|
infer::RelateObjectBound(span) => {
|
||||||
RegionOriginNote::Plain { span, msg: fluent::infer_relate_object_bound }
|
RegionOriginNote::Plain { span, msg: fluent::infer_relate_object_bound }
|
||||||
.add_to_diagnostic(err);
|
.add_to_diagnostic(err);
|
||||||
|
@ -162,33 +152,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
||||||
);
|
);
|
||||||
err
|
err
|
||||||
}
|
}
|
||||||
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
|
|
||||||
}
|
|
||||||
infer::RelateObjectBound(span) => {
|
infer::RelateObjectBound(span) => {
|
||||||
let mut err = struct_span_err!(
|
let mut err = struct_span_err!(
|
||||||
self.tcx.sess,
|
self.tcx.sess,
|
||||||
|
|
|
@ -409,9 +409,6 @@ pub enum SubregionOrigin<'tcx> {
|
||||||
/// Creating a pointer `b` to contents of another reference
|
/// Creating a pointer `b` to contents of another reference
|
||||||
Reborrow(Span),
|
Reborrow(Span),
|
||||||
|
|
||||||
/// Creating a pointer `b` to contents of an upvar
|
|
||||||
ReborrowUpvar(Span, ty::UpvarId),
|
|
||||||
|
|
||||||
/// Data with type `Ty<'tcx>` was borrowed
|
/// Data with type `Ty<'tcx>` was borrowed
|
||||||
DataBorrowed(Ty<'tcx>, Span),
|
DataBorrowed(Ty<'tcx>, Span),
|
||||||
|
|
||||||
|
@ -1954,7 +1951,6 @@ impl<'tcx> SubregionOrigin<'tcx> {
|
||||||
RelateParamBound(a, ..) => a,
|
RelateParamBound(a, ..) => a,
|
||||||
RelateRegionParamBound(a) => a,
|
RelateRegionParamBound(a) => a,
|
||||||
Reborrow(a) => a,
|
Reborrow(a) => a,
|
||||||
ReborrowUpvar(a, _) => a,
|
|
||||||
DataBorrowed(_, a) => a,
|
DataBorrowed(_, a) => a,
|
||||||
ReferenceOutlivesReferent(_, a) => a,
|
ReferenceOutlivesReferent(_, a) => a,
|
||||||
CompareImplItemObligation { span, .. } => span,
|
CompareImplItemObligation { span, .. } => span,
|
||||||
|
|
|
@ -33,8 +33,8 @@ const IGNORE_DOCTEST_CHECK: &[&str] = &["E0464", "E0570", "E0601", "E0602"];
|
||||||
|
|
||||||
// Error codes that don't yet have a UI test. This list will eventually be removed.
|
// Error codes that don't yet have a UI test. This list will eventually be removed.
|
||||||
const IGNORE_UI_TEST_CHECK: &[&str] = &[
|
const IGNORE_UI_TEST_CHECK: &[&str] = &[
|
||||||
"E0313", "E0461", "E0465", "E0476", "E0490", "E0514", "E0523", "E0554", "E0640", "E0717",
|
"E0461", "E0465", "E0476", "E0490", "E0514", "E0523", "E0554", "E0640", "E0717", "E0729",
|
||||||
"E0729", "E0789",
|
"E0789",
|
||||||
];
|
];
|
||||||
|
|
||||||
macro_rules! verbose_print {
|
macro_rules! verbose_print {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue