Port RefLongerThanData
This commit is contained in:
committed by
IQuant
parent
58e901b6fd
commit
cb8ea01096
@@ -980,3 +980,13 @@ pub struct BorrowedTooLong<'a> {
|
||||
#[subdiagnostic]
|
||||
pub notes: Vec<note_and_explain::RegionExplanation<'a>>,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(infer_ref_longer_than_data, code = "E0491")]
|
||||
pub struct RefLongerThanData<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub ty: Ty<'a>,
|
||||
#[subdiagnostic]
|
||||
pub notes: Vec<note_and_explain::RegionExplanation<'a>>,
|
||||
}
|
||||
|
||||
@@ -131,6 +131,8 @@ pub enum PrefixKind {
|
||||
LfMustOutlive,
|
||||
TypeValidFor,
|
||||
BorrowLastsFor,
|
||||
PointerValidFor,
|
||||
DataValidFor,
|
||||
}
|
||||
|
||||
pub enum SuffixKind {
|
||||
@@ -153,6 +155,8 @@ impl IntoDiagnosticArg for PrefixKind {
|
||||
Self::LfMustOutlive => "lf_must_outlive",
|
||||
Self::TypeValidFor => "type_valid_for",
|
||||
Self::BorrowLastsFor => "borrow_lasts_for",
|
||||
Self::PointerValidFor => "pointer_valid_for",
|
||||
Self::DataValidFor => "data_valid_for",
|
||||
}
|
||||
.into();
|
||||
rustc_errors::DiagnosticArgValue::Str(kind)
|
||||
|
||||
Reference in New Issue
Block a user