about summary refs log tree commit diff
diff options
context:
space:
mode:
authornidnogg <henriquevt98@gmail.com>2022-08-22 12:14:49 -0300
committernidnogg <henriquevt98@gmail.com>2022-08-22 12:14:49 -0300
commit649749c7b040580abc6b0654584e3a580b1870d7 (patch)
tree8609bb8fef03a526507565a89c8d70c14160e236
parent13abae2deba8cd27cdc9ec81f4291c9047eaa7e1 (diff)
downloadrust-649749c7b040580abc6b0654584e3a580b1870d7.tar.gz
rust-649749c7b040580abc6b0654584e3a580b1870d7.zip
Addressing last comment on PR review
-rw-r--r--compiler/rustc_const_eval/src/const_eval/mod.rs6
-rw-r--r--compiler/rustc_const_eval/src/errors.rs2
-rw-r--r--compiler/rustc_error_messages/locales/en-US/const_eval.ftl2
3 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/mod.rs b/compiler/rustc_const_eval/src/const_eval/mod.rs
index 9041d55155e..cef74432102 100644
--- a/compiler/rustc_const_eval/src/const_eval/mod.rs
+++ b/compiler/rustc_const_eval/src/const_eval/mod.rs
@@ -72,12 +72,12 @@ pub(crate) fn eval_to_valtree<'tcx>(
         Ok(valtree) => Ok(Some(valtree)),
         Err(err) => {
             let did = cid.instance.def_id();
-            let s = cid.display(tcx);
+            let global_const_id = cid.display(tcx);
             match err {
                 ValTreeCreationError::NodesOverflow => {
-                    let msg = format!("maximum number of nodes exceeded in constant {}", &s);
+                    let msg = format!("maximum number of nodes exceeded in constant {}", &global_const_id);
                     let mut diag = match tcx.hir().span_if_local(did) {
-                        Some(span) => tcx.sess.create_err(MaxNumNodesInConstErr { span, s }),
+                        Some(span) => tcx.sess.create_err(MaxNumNodesInConstErr { span, global_const_id }),
                         None => tcx.sess.struct_err(&msg),
                     };
                     diag.emit();
diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs
index c6e00219582..c3547cb3abd 100644
--- a/compiler/rustc_const_eval/src/errors.rs
+++ b/compiler/rustc_const_eval/src/errors.rs
@@ -93,7 +93,7 @@ pub(crate) struct TransientMutBorrowErrRaw {
 pub(crate) struct MaxNumNodesInConstErr {
     #[primary_span]
     pub span: Span,
-    pub s: String,
+    pub global_const_id: String,
 }
 
 #[derive(SessionDiagnostic)]
diff --git a/compiler/rustc_error_messages/locales/en-US/const_eval.ftl b/compiler/rustc_error_messages/locales/en-US/const_eval.ftl
index 8a5e1a7a957..72e7a58cd47 100644
--- a/compiler/rustc_error_messages/locales/en-US/const_eval.ftl
+++ b/compiler/rustc_error_messages/locales/en-US/const_eval.ftl
@@ -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 = maximum number of nodes exceeded in constant {$s}
+const_eval_max_num_nodes_in_const = maximum number of nodes exceeded in constant {$global_const_id}
 
 const_eval_unallowed_fn_pointer_call = function pointer calls are not allowed in {$kind}s