2022-06-23 04:43:01 +00:00
|
|
|
use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic};
|
|
|
|
use rustc_middle::ty::Ty;
|
|
|
|
use rustc_span::Span;
|
|
|
|
|
|
|
|
#[derive(SessionDiagnostic)]
|
2022-08-19 13:40:48 +00:00
|
|
|
#[diag(borrowck::move_unsized, code = "E0161")]
|
2022-06-23 04:43:01 +00:00
|
|
|
pub(crate) struct MoveUnsized<'tcx> {
|
|
|
|
pub ty: Ty<'tcx>,
|
|
|
|
#[primary_span]
|
|
|
|
#[label]
|
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(SessionDiagnostic)]
|
2022-08-19 13:40:48 +00:00
|
|
|
#[diag(borrowck::higher_ranked_lifetime_error)]
|
2022-06-23 04:43:01 +00:00
|
|
|
pub(crate) struct HigherRankedLifetimeError {
|
|
|
|
#[subdiagnostic]
|
|
|
|
pub cause: Option<HigherRankedErrorCause>,
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(SessionSubdiagnostic)]
|
|
|
|
pub(crate) enum HigherRankedErrorCause {
|
|
|
|
#[note(borrowck::could_not_prove)]
|
|
|
|
CouldNotProve { predicate: String },
|
|
|
|
#[note(borrowck::could_not_normalize)]
|
|
|
|
CouldNotNormalize { value: String },
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(SessionDiagnostic)]
|
2022-08-19 13:40:48 +00:00
|
|
|
#[diag(borrowck::higher_ranked_subtype_error)]
|
2022-06-23 04:43:01 +00:00
|
|
|
pub(crate) struct HigherRankedSubtypeError {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(SessionDiagnostic)]
|
2022-08-19 13:40:48 +00:00
|
|
|
#[diag(borrowck::generic_does_not_live_long_enough)]
|
2022-06-23 04:43:01 +00:00
|
|
|
pub(crate) struct GenericDoesNotLiveLongEnough {
|
|
|
|
pub kind: String,
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
}
|