diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-02-17 17:58:38 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-02-19 14:00:36 +0100 |
| commit | c5ce3e1dbc86a9155e5bb81cbbb76c94647f0eb9 (patch) | |
| tree | 313348b0302c6542cdd1ec253684f4aafa6ab7d3 /src | |
| parent | 6421a499a50adbaa7b5d0234bdd4817d970f0933 (diff) | |
| download | rust-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.rs | 6 |
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(); |
