Resolve rebase
This commit is contained in:
parent
35dbec338a
commit
8d590dc303
4 changed files with 2 additions and 40 deletions
|
@ -150,8 +150,6 @@ infer_region_explanation = {$pref_kind ->
|
||||||
[lf_param_must_outlive] but lifetime parameter must outlive
|
[lf_param_must_outlive] but lifetime parameter must outlive
|
||||||
[lf_instantiated_with] lifetime instantiated with
|
[lf_instantiated_with] lifetime instantiated with
|
||||||
[lf_must_outlive] but lifetime must outlive
|
[lf_must_outlive] but lifetime must outlive
|
||||||
[type_valid_for] the type is valid for
|
|
||||||
[borrow_lasts_for] but the borrow lasts for
|
|
||||||
[pointer_valid_for] the pointer is valid for
|
[pointer_valid_for] the pointer is valid for
|
||||||
[data_valid_for] but the referenced data is only valid for
|
[data_valid_for] but the referenced data is only valid for
|
||||||
[empty] {""}
|
[empty] {""}
|
||||||
|
|
|
@ -971,16 +971,6 @@ pub struct LfBoundNotSatisfied<'a> {
|
||||||
pub notes: Vec<note_and_explain::RegionExplanation<'a>>,
|
pub notes: Vec<note_and_explain::RegionExplanation<'a>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Diagnostic)]
|
|
||||||
#[diag(infer_borrowed_too_long, code = "E0490")]
|
|
||||||
pub struct BorrowedTooLong<'a> {
|
|
||||||
#[primary_span]
|
|
||||||
pub span: Span,
|
|
||||||
pub ty: Ty<'a>,
|
|
||||||
#[subdiagnostic]
|
|
||||||
pub notes: Vec<note_and_explain::RegionExplanation<'a>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Diagnostic)]
|
#[derive(Diagnostic)]
|
||||||
#[diag(infer_ref_longer_than_data, code = "E0491")]
|
#[diag(infer_ref_longer_than_data, code = "E0491")]
|
||||||
pub struct RefLongerThanData<'a> {
|
pub struct RefLongerThanData<'a> {
|
||||||
|
|
|
@ -131,8 +131,6 @@ pub enum PrefixKind {
|
||||||
LfParamMustOutlive,
|
LfParamMustOutlive,
|
||||||
LfInstantiatedWith,
|
LfInstantiatedWith,
|
||||||
LfMustOutlive,
|
LfMustOutlive,
|
||||||
TypeValidFor,
|
|
||||||
BorrowLastsFor,
|
|
||||||
PointerValidFor,
|
PointerValidFor,
|
||||||
DataValidFor,
|
DataValidFor,
|
||||||
}
|
}
|
||||||
|
@ -157,8 +155,6 @@ impl IntoDiagnosticArg for PrefixKind {
|
||||||
Self::LfParamMustOutlive => "lf_param_must_outlive",
|
Self::LfParamMustOutlive => "lf_param_must_outlive",
|
||||||
Self::LfInstantiatedWith => "lf_instantiated_with",
|
Self::LfInstantiatedWith => "lf_instantiated_with",
|
||||||
Self::LfMustOutlive => "lf_must_outlive",
|
Self::LfMustOutlive => "lf_must_outlive",
|
||||||
Self::TypeValidFor => "type_valid_for",
|
|
||||||
Self::BorrowLastsFor => "borrow_lasts_for",
|
|
||||||
Self::PointerValidFor => "pointer_valid_for",
|
Self::PointerValidFor => "pointer_valid_for",
|
||||||
Self::DataValidFor => "data_valid_for",
|
Self::DataValidFor => "data_valid_for",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::errors::{
|
use crate::errors::{
|
||||||
note_and_explain, BorrowedTooLong, FullfillReqLifetime, LfBoundNotSatisfied, OutlivesBound,
|
note_and_explain, FullfillReqLifetime, LfBoundNotSatisfied, OutlivesBound, OutlivesContent,
|
||||||
OutlivesContent, RefLongerThanData, RegionOriginNote,
|
RefLongerThanData, RegionOriginNote,
|
||||||
};
|
};
|
||||||
use crate::infer::error_reporting::{note_and_explain_region, TypeErrCtxt};
|
use crate::infer::error_reporting::{note_and_explain_region, TypeErrCtxt};
|
||||||
use crate::infer::{self, SubregionOrigin};
|
use crate::infer::{self, SubregionOrigin};
|
||||||
|
@ -200,28 +200,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
||||||
}
|
}
|
||||||
.into_diagnostic(&self.tcx.sess.parse_sess.span_diagnostic)
|
.into_diagnostic(&self.tcx.sess.parse_sess.span_diagnostic)
|
||||||
}
|
}
|
||||||
infer::DataBorrowed(ty, span) => {
|
|
||||||
let type_valid = note_and_explain::RegionExplanation::new(
|
|
||||||
self.tcx,
|
|
||||||
sub,
|
|
||||||
None,
|
|
||||||
note_and_explain::PrefixKind::TypeValidFor,
|
|
||||||
note_and_explain::SuffixKind::Empty,
|
|
||||||
);
|
|
||||||
let borrow_lasts_for = note_and_explain::RegionExplanation::new(
|
|
||||||
self.tcx,
|
|
||||||
sup,
|
|
||||||
None,
|
|
||||||
note_and_explain::PrefixKind::BorrowLastsFor,
|
|
||||||
note_and_explain::SuffixKind::Empty,
|
|
||||||
);
|
|
||||||
BorrowedTooLong {
|
|
||||||
span,
|
|
||||||
ty: self.resolve_vars_if_possible(ty),
|
|
||||||
notes: type_valid.into_iter().chain(borrow_lasts_for).collect(),
|
|
||||||
}
|
|
||||||
.into_diagnostic(&self.tcx.sess.parse_sess.span_diagnostic)
|
|
||||||
}
|
|
||||||
infer::ReferenceOutlivesReferent(ty, span) => {
|
infer::ReferenceOutlivesReferent(ty, span) => {
|
||||||
let pointer_valid = note_and_explain::RegionExplanation::new(
|
let pointer_valid = note_and_explain::RegionExplanation::new(
|
||||||
self.tcx,
|
self.tcx,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue