diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2023-05-17 10:30:14 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2023-06-01 14:45:18 +0000 |
| commit | 4f83717cf768adb0b0dfe23b8eecf2b259eec354 (patch) | |
| tree | bac79441d2e21eda2a702697484bba96d7cacf7e /compiler/rustc_const_eval/src/const_eval/mod.rs | |
| parent | 642c92e63008ffb49f6ad8344e07bfa7d5b0d9bb (diff) | |
| download | rust-4f83717cf768adb0b0dfe23b8eecf2b259eec354.tar.gz rust-4f83717cf768adb0b0dfe23b8eecf2b259eec354.zip | |
Use translatable diagnostics in `rustc_const_eval`
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval/mod.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/mod.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/mod.rs b/compiler/rustc_const_eval/src/const_eval/mod.rs index b59ca8e2070..6e462d3a1e9 100644 --- a/compiler/rustc_const_eval/src/const_eval/mod.rs +++ b/compiler/rustc_const_eval/src/const_eval/mod.rs @@ -73,17 +73,8 @@ pub(crate) fn eval_to_valtree<'tcx>( let global_const_id = cid.display(tcx); match err { ValTreeCreationError::NodesOverflow => { - 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, global_const_id }) - } - None => tcx.sess.struct_err(msg), - }; - diag.emit(); + let span = tcx.hir().span_if_local(did); + tcx.sess.emit_err(MaxNumNodesInConstErr { span, global_const_id }); Ok(None) } |
