Auto merge of #127382 - estebank:const-let, r=compiler-errors

Use verbose style when suggesting changing `const` with `let`
This commit is contained in:
bors 2024-07-12 01:18:12 +00:00
commit 4a31a6c32a
25 changed files with 245 additions and 129 deletions

View file

@ -240,16 +240,18 @@ pub(crate) struct AttemptToUseNonConstantValueInConstant<'a> {
}
#[derive(Subdiagnostic)]
#[suggestion(
#[multipart_suggestion(
resolve_attempt_to_use_non_constant_value_in_constant_with_suggestion,
code = "{suggestion} {ident}",
applicability = "maybe-incorrect"
style = "verbose",
applicability = "has-placeholders"
)]
pub(crate) struct AttemptToUseNonConstantValueInConstantWithSuggestion<'a> {
#[primary_span]
// #[primary_span]
#[suggestion_part(code = "{suggestion} ")]
pub(crate) span: Span,
pub(crate) ident: Ident,
pub(crate) suggestion: &'a str,
#[suggestion_part(code = ": /* Type */")]
pub(crate) type_span: Option<Span>,
pub(crate) current: &'a str,
}