diff options
| author | oli <github35764891676564198441@oli-obk.de> | 2020-11-04 13:41:58 +0000 |
|---|---|---|
| committer | oli <github35764891676564198441@oli-obk.de> | 2020-11-04 13:41:58 +0000 |
| commit | abacaf2aef26043ce09e3aee176a9587bb87eaf6 (patch) | |
| tree | 71dd864eabe7c9078a135beddbdf8853090f021e /src | |
| parent | e67c768110f2cd55d6823defcbfca5651fe1f9f5 (diff) | |
| download | rust-abacaf2aef26043ce09e3aee176a9587bb87eaf6.tar.gz rust-abacaf2aef26043ce09e3aee176a9587bb87eaf6.zip | |
`u128` truncation and sign extension are not just interpreter related
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/utils.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index 167b06428e5..f6258221e32 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -14,7 +14,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_hir as hir; use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::{DefId, LOCAL_CRATE}; -use rustc_middle::mir::interpret::{sign_extend, ConstValue}; +use rustc_middle::mir::interpret::ConstValue; use rustc_middle::ty::subst::{GenericArgKind, SubstsRef}; use rustc_middle::ty::{self, DefIdTree, Ty}; use rustc_span::symbol::{kw, sym, Symbol}; @@ -506,7 +506,7 @@ fn print_const_with_custom_print_scalar(cx: &DocContext<'_>, ct: &'tcx ty::Const let ty = cx.tcx.lift(ct.ty).unwrap(); let size = cx.tcx.layout_of(ty::ParamEnv::empty().and(ty)).unwrap().size; let data = int.assert_bits(size); - let sign_extended_data = sign_extend(data, size) as i128; + let sign_extended_data = size.sign_extend(data) as i128; format!( "{}{}", |
