We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e3d4c40 commit 8d042f4Copy full SHA for 8d042f4
2 files changed
compiler/rustc_ast_passes/src/errors.rs
@@ -82,3 +82,11 @@ pub struct TraitFnAsync {
82
#[label]
83
pub span: Span,
84
}
85
+
86
+#[derive(SessionDiagnostic)]
87
+#[error(ast_passes::trait_fn_const, code = "E0379")]
88
+pub struct TraitFnConst {
89
+ #[primary_span]
90
+ #[label]
91
+ pub span: Span,
92
+}
compiler/rustc_error_messages/locales/en-US/ast_passes.ftl
@@ -27,3 +27,7 @@ ast_passes_trait_fn_async =
27
.label = `async` because of this
28
.note = `async` trait functions are not currently supported
29
.note2 = consider using the `async-trait` crate: https://crates.io/crates/async-trait
30
31
+ast_passes_trait_fn_const =
32
+ functions in traits cannot be declared const
33
+ .label = functions in traits cannot be const
0 commit comments