Add invalid_from_utf8 analogous to invalid_from_utf8_unchecked
This commit is contained in:
parent
a0612d90b0
commit
7f99c7d3e6
7 changed files with 169 additions and 21 deletions
|
@ -701,12 +701,21 @@ pub struct ForgetCopyDiag<'a> {
|
|||
|
||||
// invalid_from_utf8.rs
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(lint_invalid_from_utf8_unchecked)]
|
||||
pub struct InvalidFromUtf8UncheckedDiag {
|
||||
pub method: String,
|
||||
pub valid_up_to: usize,
|
||||
#[label]
|
||||
pub label: Span,
|
||||
pub enum InvalidFromUtf8Diag {
|
||||
#[diag(lint_invalid_from_utf8_unchecked)]
|
||||
Unchecked {
|
||||
method: String,
|
||||
valid_up_to: usize,
|
||||
#[label]
|
||||
label: Span,
|
||||
},
|
||||
#[diag(lint_invalid_from_utf8_checked)]
|
||||
Checked {
|
||||
method: String,
|
||||
valid_up_to: usize,
|
||||
#[label]
|
||||
label: Span,
|
||||
},
|
||||
}
|
||||
|
||||
// hidden_unicode_codepoints.rs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue