1
Fork 0

Improve note for the invalid_reference_casting lint

Add link to the book interior mutability chapter,
https://doc.rust-lang.org/book/ch15-05-interior-mutability.html.
This commit is contained in:
Urgau 2023-08-22 17:17:44 +02:00
parent 810573919f
commit aa7730003e
4 changed files with 62 additions and 0 deletions

View file

@ -764,11 +764,13 @@ pub enum InvalidFromUtf8Diag {
#[derive(LintDiagnostic)]
pub enum InvalidReferenceCastingDiag {
#[diag(lint_invalid_reference_casting_borrow_as_mut)]
#[note(lint_invalid_reference_casting_note_book)]
BorrowAsMut {
#[label]
orig_cast: Option<Span>,
},
#[diag(lint_invalid_reference_casting_assign_to_ref)]
#[note(lint_invalid_reference_casting_note_book)]
AssignToRef {
#[label]
orig_cast: Option<Span>,