Skip to content

Commit 0a58b26

Browse files
committed
Hotfix ftl err name, added check for err.code in create_feature_err
1 parent 4c82845 commit 0a58b26

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

compiler/rustc_const_eval/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub(crate) struct TransientMutBorrowErrRaw {
8989
}
9090

9191
#[derive(SessionDiagnostic)]
92-
#[error(const_eval::const_evaL_max_num_nodes_in_const_err)]
92+
#[error(const_eval::max_num_nodes_in_const)]
9393
pub(crate) struct MaxNumNodesInConstErr {
9494
#[primary_span]
9595
pub span: Span,

compiler/rustc_error_messages/locales/en-US/const_eval.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const_eval_transient_mut_borrow = mutable references are not allowed in {$kind}s
3030
3131
const_eval_transient_mut_borrow_raw = raw mutable references are not allowed in {$kind}s
3232
33-
const_evaL_max_num_nodes_in_const_err = maximum number of nodes exceeded in constant {$s}
33+
const_eval_max_num_nodes_in_const = maximum number of nodes exceeded in constant {$s}
3434
3535
const_eval_unallowed_fn_pointer_call = function pointer calls are not allowed in {$kind}s
3636

compiler/rustc_session/src/session.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,9 @@ impl Session {
467467
feature: Symbol,
468468
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
469469
let mut err = self.parse_sess.create_err(err);
470-
err.code = std::option::Option::Some(error_code!(E0658));
470+
if err.code.is_none() {
471+
err.code = std::option::Option::Some(error_code!(E0658));
472+
}
471473
add_feature_diagnostics(&mut err, &self.parse_sess, feature);
472474
err
473475
}

0 commit comments

Comments
 (0)