treat mir::ConstantKind::Val correctly in check_static_ptr
This commit is contained in:
parent
5e0fab6da5
commit
c612ef8f48
2 changed files with 4 additions and 37 deletions
|
@ -2522,7 +2522,7 @@ pub enum ConstantKind<'tcx> {
|
|||
|
||||
impl<'tcx> Constant<'tcx> {
|
||||
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
|
||||
match self.literal.const_for_ty()?.val().try_to_scalar() {
|
||||
match self.literal.try_to_scalar() {
|
||||
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
|
||||
GlobalAlloc::Static(def_id) => {
|
||||
assert!(!tcx.is_thread_local_static(def_id));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue