E0379: Provide suggestions
This commit is contained in:
parent
ae8e401c9f
commit
aa799049d7
11 changed files with 228 additions and 51 deletions
|
@ -1,7 +1,7 @@
|
|||
//! Errors emitted by ast_passes.
|
||||
|
||||
use rustc_ast::ParamKindOrd;
|
||||
use rustc_errors::AddToDiagnostic;
|
||||
use rustc_errors::{AddToDiagnostic, Applicability};
|
||||
use rustc_macros::{Diagnostic, Subdiagnostic};
|
||||
use rustc_span::{symbol::Ident, Span, Symbol};
|
||||
|
||||
|
@ -50,6 +50,23 @@ pub struct TraitFnConst {
|
|||
#[label]
|
||||
pub span: Span,
|
||||
pub in_impl: bool,
|
||||
#[label(ast_passes_const_context_label)]
|
||||
pub const_context_label: Option<Span>,
|
||||
#[suggestion(ast_passes_remove_const_sugg, code = "")]
|
||||
pub remove_const_sugg: (Span, Applicability),
|
||||
pub requires_multiple_changes: bool,
|
||||
#[suggestion(
|
||||
ast_passes_make_impl_const_sugg,
|
||||
code = "const ",
|
||||
applicability = "maybe-incorrect"
|
||||
)]
|
||||
pub make_impl_const_sugg: Option<Span>,
|
||||
#[suggestion(
|
||||
ast_passes_make_trait_const_sugg,
|
||||
code = "#[const_trait]\n",
|
||||
applicability = "maybe-incorrect"
|
||||
)]
|
||||
pub make_trait_const_sugg: Option<Span>,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue