Account for let foo = expr
; to suggest const foo: Ty = expr;
This commit is contained in:
parent
b56dc8ee90
commit
cbe75486f7
13 changed files with 85 additions and 56 deletions
|
@ -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} ",
|
||||
style = "verbose",
|
||||
applicability = "maybe-incorrect"
|
||||
applicability = "has-placeholders"
|
||||
)]
|
||||
pub(crate) struct AttemptToUseNonConstantValueInConstantWithSuggestion<'a> {
|
||||
#[primary_span]
|
||||
// #[primary_span]
|
||||
#[suggestion_part(code = "{suggestion} ")]
|
||||
pub(crate) span: Span,
|
||||
pub(crate) suggestion: &'a str,
|
||||
#[suggestion_part(code = ": /* Type */")]
|
||||
pub(crate) type_span: Option<Span>,
|
||||
pub(crate) current: &'a str,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue