]> git.lizzy.rs Git - rust.git/commitdiff
Addressing last comment on PR review
authornidnogg <henriquevt98@gmail.com>
Mon, 22 Aug 2022 15:14:49 +0000 (12:14 -0300)
committernidnogg <henriquevt98@gmail.com>
Mon, 22 Aug 2022 15:14:49 +0000 (12:14 -0300)
compiler/rustc_const_eval/src/const_eval/mod.rs
compiler/rustc_const_eval/src/errors.rs
compiler/rustc_error_messages/locales/en-US/const_eval.ftl

index 9041d55155eae11d6aaf361dd001d95e293e1ddc..cef74432102dec1ee8163a374d3a41df28eb6a07 100644 (file)
@@ -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();
index c6e00219582514c92160779ac0ce7f6f0be1419a..c3547cb3abdf3ff2fefa5205545281ebb6087bb4 100644 (file)
@@ -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)]
index 8a5e1a7a957093b2faef28e5d1025dac021a31c5..72e7a58cd47588a75ae6ef1e3a3dc0605cf59fcc 100644 (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 = 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