1
Fork 0

consistently treat None-tagged pointers as ints; get rid of some deprecated Scalar methods

This commit is contained in:
Ralf Jung 2021-07-12 20:29:05 +02:00
parent d4f7dd6702
commit 626605cea0
29 changed files with 145 additions and 139 deletions

View file

@ -2458,7 +2458,7 @@ pub enum ConstantKind<'tcx> {
impl Constant<'tcx> {
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
match self.literal.const_for_ty()?.val.try_to_scalar() {
Some(Scalar::Ptr(ptr)) => match tcx.global_alloc(ptr.provenance) {
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
GlobalAlloc::Static(def_id) => {
assert!(!tcx.is_thread_local_static(def_id));
Some(def_id)