Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco
remove unreachable error code `E0490` AFAIK, the untested and undocumented error code `E0490` is now unreachable, it was from the days of the original borrow checker. cc ``@GuillaumeGomez`` #61137
This commit is contained in:
commit
c61f29ca52
6 changed files with 5 additions and 66 deletions
|
@ -618,7 +618,7 @@ E0791: include_str!("./error_codes/E0791.md"),
|
||||||
// E0487, // unsafe use of destructor: destructor might be called while...
|
// E0487, // unsafe use of destructor: destructor might be called while...
|
||||||
// E0488, // lifetime of variable does not enclose its declaration
|
// E0488, // lifetime of variable does not enclose its declaration
|
||||||
// E0489, // type/lifetime parameter not in scope here
|
// E0489, // type/lifetime parameter not in scope here
|
||||||
E0490, // a value of type `..` is borrowed for too long
|
// E0490, // removed: unreachable
|
||||||
E0523, // two dependencies have same (crate-name, disambiguator) but different SVH
|
E0523, // two dependencies have same (crate-name, disambiguator) but different SVH
|
||||||
// E0526, // shuffle indices are not constant
|
// E0526, // shuffle indices are not constant
|
||||||
// E0540, // multiple rustc_deprecated attributes
|
// E0540, // multiple rustc_deprecated attributes
|
||||||
|
|
|
@ -101,7 +101,6 @@ infer_subtype_2 = ...so that {$requirement ->
|
||||||
infer_reborrow = ...so that reference does not outlive borrowed content
|
infer_reborrow = ...so that reference does not outlive borrowed content
|
||||||
infer_reborrow_upvar = ...so that closure can access `{$name}`
|
infer_reborrow_upvar = ...so that closure can access `{$name}`
|
||||||
infer_relate_object_bound = ...so that it can be closed over into an object
|
infer_relate_object_bound = ...so that it can be closed over into an object
|
||||||
infer_data_borrowed = ...so that the type `{$name}` is not borrowed for too long
|
|
||||||
infer_reference_outlives_referent = ...so that the reference type `{$name}` does not outlive the data it points at
|
infer_reference_outlives_referent = ...so that the reference type `{$name}` does not outlive the data it points at
|
||||||
infer_relate_param_bound = ...so that the type `{$name}` will meet its required lifetime bounds{$continues ->
|
infer_relate_param_bound = ...so that the type `{$name}` will meet its required lifetime bounds{$continues ->
|
||||||
[true] ...
|
[true] ...
|
||||||
|
|
|
@ -29,15 +29,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
||||||
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);
|
||||||
}
|
}
|
||||||
infer::DataBorrowed(ty, span) => {
|
|
||||||
RegionOriginNote::WithName {
|
|
||||||
span,
|
|
||||||
msg: fluent::infer_data_borrowed,
|
|
||||||
name: &self.ty_to_string(ty),
|
|
||||||
continues: false,
|
|
||||||
}
|
|
||||||
.add_to_diagnostic(err);
|
|
||||||
}
|
|
||||||
infer::ReferenceOutlivesReferent(ty, span) => {
|
infer::ReferenceOutlivesReferent(ty, span) => {
|
||||||
RegionOriginNote::WithName {
|
RegionOriginNote::WithName {
|
||||||
span,
|
span,
|
||||||
|
@ -227,32 +218,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
||||||
);
|
);
|
||||||
err
|
err
|
||||||
}
|
}
|
||||||
infer::DataBorrowed(ty, span) => {
|
|
||||||
let mut err = struct_span_err!(
|
|
||||||
self.tcx.sess,
|
|
||||||
span,
|
|
||||||
E0490,
|
|
||||||
"a value of type `{}` is borrowed for too long",
|
|
||||||
self.ty_to_string(ty)
|
|
||||||
);
|
|
||||||
note_and_explain_region(
|
|
||||||
self.tcx,
|
|
||||||
&mut err,
|
|
||||||
"the type is valid for ",
|
|
||||||
sub,
|
|
||||||
"",
|
|
||||||
None,
|
|
||||||
);
|
|
||||||
note_and_explain_region(
|
|
||||||
self.tcx,
|
|
||||||
&mut err,
|
|
||||||
"but the borrow lasts for ",
|
|
||||||
sup,
|
|
||||||
"",
|
|
||||||
None,
|
|
||||||
);
|
|
||||||
err
|
|
||||||
}
|
|
||||||
infer::ReferenceOutlivesReferent(ty, span) => {
|
infer::ReferenceOutlivesReferent(ty, span) => {
|
||||||
let mut err = struct_span_err!(
|
let mut err = struct_span_err!(
|
||||||
self.tcx.sess,
|
self.tcx.sess,
|
||||||
|
|
|
@ -702,26 +702,8 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||||
// Obtain the spans for all the places that can
|
// Obtain the spans for all the places that can
|
||||||
// influence the constraints on this value for
|
// influence the constraints on this value for
|
||||||
// richer diagnostics in `static_impl_trait`.
|
// richer diagnostics in `static_impl_trait`.
|
||||||
let influences: Vec<Span> = self
|
|
||||||
.data
|
|
||||||
.constraints
|
|
||||||
.iter()
|
|
||||||
.filter_map(|(constraint, origin)| match (constraint, origin) {
|
|
||||||
(
|
|
||||||
Constraint::VarSubVar(_, sup),
|
|
||||||
SubregionOrigin::DataBorrowed(_, sp),
|
|
||||||
) if sup == &node_vid => Some(*sp),
|
|
||||||
_ => None,
|
|
||||||
})
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
self.collect_error_for_expanding_node(
|
self.collect_error_for_expanding_node(graph, &mut dup_vec, node_vid, errors);
|
||||||
graph,
|
|
||||||
&mut dup_vec,
|
|
||||||
node_vid,
|
|
||||||
errors,
|
|
||||||
influences,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -775,7 +757,6 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||||
dup_vec: &mut IndexVec<RegionVid, Option<RegionVid>>,
|
dup_vec: &mut IndexVec<RegionVid, Option<RegionVid>>,
|
||||||
node_idx: RegionVid,
|
node_idx: RegionVid,
|
||||||
errors: &mut Vec<RegionResolutionError<'tcx>>,
|
errors: &mut Vec<RegionResolutionError<'tcx>>,
|
||||||
influences: Vec<Span>,
|
|
||||||
) {
|
) {
|
||||||
// Errors in expanding nodes result from a lower-bound that is
|
// Errors in expanding nodes result from a lower-bound that is
|
||||||
// not contained by an upper-bound.
|
// not contained by an upper-bound.
|
||||||
|
@ -830,7 +811,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||||
lower_bound.region,
|
lower_bound.region,
|
||||||
upper_bound.origin.clone(),
|
upper_bound.origin.clone(),
|
||||||
upper_bound.region,
|
upper_bound.region,
|
||||||
influences,
|
vec![],
|
||||||
));
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,9 +410,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),
|
||||||
|
|
||||||
/// Data with type `Ty<'tcx>` was borrowed
|
|
||||||
DataBorrowed(Ty<'tcx>, Span),
|
|
||||||
|
|
||||||
/// (&'a &'b T) where a >= b
|
/// (&'a &'b T) where a >= b
|
||||||
ReferenceOutlivesReferent(Ty<'tcx>, Span),
|
ReferenceOutlivesReferent(Ty<'tcx>, Span),
|
||||||
|
|
||||||
|
@ -1978,7 +1975,6 @@ impl<'tcx> SubregionOrigin<'tcx> {
|
||||||
RelateParamBound(a, ..) => a,
|
RelateParamBound(a, ..) => a,
|
||||||
RelateRegionParamBound(a) => a,
|
RelateRegionParamBound(a) => a,
|
||||||
Reborrow(a) => a,
|
Reborrow(a) => a,
|
||||||
DataBorrowed(_, a) => a,
|
|
||||||
ReferenceOutlivesReferent(_, a) => a,
|
ReferenceOutlivesReferent(_, a) => a,
|
||||||
CompareImplItemObligation { span, .. } => span,
|
CompareImplItemObligation { span, .. } => span,
|
||||||
AscribeUserTypeProvePredicate(span) => span,
|
AscribeUserTypeProvePredicate(span) => span,
|
||||||
|
|
|
@ -31,10 +31,8 @@ const IGNORE_DOCTEST_CHECK: &[&str] =
|
||||||
&["E0208", "E0464", "E0570", "E0601", "E0602", "E0640", "E0717"];
|
&["E0208", "E0464", "E0570", "E0601", "E0602", "E0640", "E0717"];
|
||||||
|
|
||||||
// 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] =
|
||||||
"E0461", "E0465", "E0476", "E0490", "E0514", "E0523", "E0554", "E0640", "E0717", "E0729",
|
&["E0461", "E0465", "E0476", "E0514", "E0523", "E0554", "E0640", "E0717", "E0729", "E0789"];
|
||||||
"E0789",
|
|
||||||
];
|
|
||||||
|
|
||||||
macro_rules! verbose_print {
|
macro_rules! verbose_print {
|
||||||
($verbose:expr, $($fmt:tt)*) => {
|
($verbose:expr, $($fmt:tt)*) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue