Hotfix ftl err name, added check for err.code in create_feature_err

This commit is contained in:
nidnogg 2022-08-21 13:08:14 -03:00
parent 4c82845b3a
commit 0a58b26e8a
3 changed files with 5 additions and 3 deletions

View File

@ -89,7 +89,7 @@ pub(crate) struct TransientMutBorrowErrRaw {
}
#[derive(SessionDiagnostic)]
#[error(const_eval::const_evaL_max_num_nodes_in_const_err)]
#[error(const_eval::max_num_nodes_in_const)]
pub(crate) struct MaxNumNodesInConstErr {
#[primary_span]
pub span: Span,

View File

@ -30,7 +30,7 @@ const_eval_transient_mut_borrow = mutable references are not allowed in {$kind}s
const_eval_transient_mut_borrow_raw = raw mutable references are not allowed in {$kind}s
const_evaL_max_num_nodes_in_const_err = maximum number of nodes exceeded in constant {$s}
const_eval_max_num_nodes_in_const = maximum number of nodes exceeded in constant {$s}
const_eval_unallowed_fn_pointer_call = function pointer calls are not allowed in {$kind}s

View File

@ -467,7 +467,9 @@ impl Session {
feature: Symbol,
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
let mut err = self.parse_sess.create_err(err);
err.code = std::option::Option::Some(error_code!(E0658));
if err.code.is_none() {
err.code = std::option::Option::Some(error_code!(E0658));
}
add_feature_diagnostics(&mut err, &self.parse_sess, feature);
err
}