Suggest changing ty to const params if appropriate

This commit is contained in:
León Orell Valerian Liehr 2024-02-02 02:49:13 +01:00
parent 3f7b1a5f49
commit 5906237b32
No known key found for this signature in database
GPG key ID: D17A07215F68E713
7 changed files with 160 additions and 1 deletions

View file

@ -1,4 +1,4 @@
use rustc_errors::codes::*;
use rustc_errors::{codes::*, Applicability};
use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_span::{
symbol::{Ident, Symbol},
@ -787,3 +787,16 @@ pub(crate) struct IsNotDirectlyImportable {
pub(crate) span: Span,
pub(crate) target: Ident,
}
#[derive(Subdiagnostic)]
#[suggestion(
resolve_unexpected_res_change_ty_to_const_param_sugg,
code = "const ",
style = "verbose"
)]
pub(crate) struct UnexpectedResChangeTyToConstParamSugg {
#[primary_span]
pub span: Span,
#[applicability]
pub applicability: Applicability,
}