about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-02-17 17:58:38 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-02-19 14:00:36 +0100
commitc5ce3e1dbc86a9155e5bb81cbbb76c94647f0eb9 (patch)
tree313348b0302c6542cdd1ec253684f4aafa6ab7d3 /src
parent6421a499a50adbaa7b5d0234bdd4817d970f0933 (diff)
downloadrust-c5ce3e1dbc86a9155e5bb81cbbb76c94647f0eb9.tar.gz
rust-c5ce3e1dbc86a9155e5bb81cbbb76c94647f0eb9.zip
Don't render Const computed values in hexadecimal for Display
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/clean/utils.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs
index 3a83f4505a5..a68e325481e 100644
--- a/src/librustdoc/clean/utils.rs
+++ b/src/librustdoc/clean/utils.rs
@@ -302,7 +302,11 @@ fn print_const_with_custom_print_scalar(tcx: TyCtxt<'_>, ct: &ty::Const<'_>) ->
     // For all other types, fallback to the original `pretty_print_const`.
     match (ct.val, ct.ty.kind()) {
         (ty::ConstKind::Value(ConstValue::Scalar(int)), ty::Uint(ui)) => {
-            format!("{}{}", format_integer_with_underscore_sep(&int.to_string()), ui.name_str())
+            format!(
+                "{}{}",
+                format_integer_with_underscore_sep(&int.rustdoc_display()),
+                ui.name_str()
+            )
         }
         (ty::ConstKind::Value(ConstValue::Scalar(int)), ty::Int(i)) => {
             let ty = tcx.lift(ct.ty).unwrap();