consistently treat None-tagged pointers as ints; get rid of some deprecated Scalar methods
This commit is contained in:
parent
d4f7dd6702
commit
626605cea0
29 changed files with 145 additions and 139 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue