1
Fork 0

Simplify trait error message for CoercePointee validation

This commit is contained in:
Michael Goulet 2025-02-19 19:51:06 +00:00
parent 96d966b07a
commit 5c5ed92c37
6 changed files with 199 additions and 50 deletions

View file

@ -1321,6 +1321,18 @@ pub(crate) struct CoerceSameStruct {
pub target_path: String,
}
#[derive(Diagnostic)]
#[diag(hir_analysis_coerce_unsized_field_validity)]
pub(crate) struct CoerceFieldValidity<'tcx> {
#[primary_span]
pub span: Span,
pub ty: Ty<'tcx>,
pub trait_name: &'static str,
#[label]
pub field_span: Span,
pub field_ty: Ty<'tcx>,
}
#[derive(Diagnostic)]
#[diag(hir_analysis_trait_cannot_impl_for_ty, code = E0204)]
pub(crate) struct TraitCannotImplForTy {