diff options
| author | nidnogg <henriquevt98@gmail.com> | 2022-08-22 12:14:49 -0300 |
|---|---|---|
| committer | nidnogg <henriquevt98@gmail.com> | 2022-08-22 12:14:49 -0300 |
| commit | 649749c7b040580abc6b0654584e3a580b1870d7 (patch) | |
| tree | 8609bb8fef03a526507565a89c8d70c14160e236 /compiler/rustc_const_eval/src | |
| parent | 13abae2deba8cd27cdc9ec81f4291c9047eaa7e1 (diff) | |
| download | rust-649749c7b040580abc6b0654584e3a580b1870d7.tar.gz rust-649749c7b040580abc6b0654584e3a580b1870d7.zip | |
Addressing last comment on PR review
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/mod.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/errors.rs | 2 |
2 files changed, 4 insertions, 4 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)] |
