Skip to content

Commit 8d042f4

Browse files
committed
Migrate trait_fn_const
1 parent e3d4c40 commit 8d042f4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,11 @@ pub struct TraitFnAsync {
8282
#[label]
8383
pub span: Span,
8484
}
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ ast_passes_trait_fn_async =
2727
.label = `async` because of this
2828
.note = `async` trait functions are not currently supported
2929
.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

Comments
 (0)