about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authoroli <github35764891676564198441@oli-obk.de>2020-11-04 13:41:58 +0000
committeroli <github35764891676564198441@oli-obk.de>2020-11-04 13:41:58 +0000
commitabacaf2aef26043ce09e3aee176a9587bb87eaf6 (patch)
tree71dd864eabe7c9078a135beddbdf8853090f021e /src
parente67c768110f2cd55d6823defcbfca5651fe1f9f5 (diff)
downloadrust-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.rs4
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!(
                 "{}{}",