Lint on reference casting to bigger underlying allocation
This commit is contained in:
@@ -716,7 +716,7 @@ pub enum InvalidFromUtf8Diag {
|
||||
|
||||
// reference_casting.rs
|
||||
#[derive(LintDiagnostic)]
|
||||
pub enum InvalidReferenceCastingDiag {
|
||||
pub enum InvalidReferenceCastingDiag<'tcx> {
|
||||
#[diag(lint_invalid_reference_casting_borrow_as_mut)]
|
||||
#[note(lint_invalid_reference_casting_note_book)]
|
||||
BorrowAsMut {
|
||||
@@ -733,6 +733,18 @@ pub enum InvalidReferenceCastingDiag {
|
||||
#[note(lint_invalid_reference_casting_note_ty_has_interior_mutability)]
|
||||
ty_has_interior_mutability: Option<()>,
|
||||
},
|
||||
#[diag(lint_invalid_reference_casting_bigger_layout)]
|
||||
#[note(lint_layout)]
|
||||
BiggerLayout {
|
||||
#[label]
|
||||
orig_cast: Option<Span>,
|
||||
#[label(lint_alloc)]
|
||||
alloc: Span,
|
||||
from_ty: Ty<'tcx>,
|
||||
from_size: u64,
|
||||
to_ty: Ty<'tcx>,
|
||||
to_size: u64,
|
||||
},
|
||||
}
|
||||
|
||||
// hidden_unicode_codepoints.rs
|
||||
|
||||
Reference in New Issue
Block a user