mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Hotfix ftl err name, added check for err.code in create_feature_err
This commit is contained in:
parent
4c82845b3a
commit
0a58b26e8a
@ -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,
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user