1 use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic};
2 use rustc_middle::ty::Ty;
5 #[derive(SessionDiagnostic)]
6 #[error(borrowck::move_unsized, code = "E0161")]
7 pub(crate) struct MoveUnsized<'tcx> {
14 #[derive(SessionDiagnostic)]
15 #[error(borrowck::higher_ranked_lifetime_error)]
16 pub(crate) struct HigherRankedLifetimeError {
18 pub cause: Option<HigherRankedErrorCause>,
23 #[derive(SessionSubdiagnostic)]
24 pub(crate) enum HigherRankedErrorCause {
25 #[note(borrowck::could_not_prove)]
26 CouldNotProve { predicate: String },
27 #[note(borrowck::could_not_normalize)]
28 CouldNotNormalize { value: String },
31 #[derive(SessionDiagnostic)]
32 #[error(borrowck::higher_ranked_subtype_error)]
33 pub(crate) struct HigherRankedSubtypeError {
38 #[derive(SessionDiagnostic)]
39 #[error(borrowck::generic_does_not_live_long_enough)]
40 pub(crate) struct GenericDoesNotLiveLongEnough {