We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b6ec3a commit 095fca2Copy full SHA for 095fca2
compiler/rustc_middle/src/mir/mod.rs
@@ -2534,7 +2534,7 @@ pub enum ConstantKind<'tcx> {
2534
2535
impl<'tcx> Constant<'tcx> {
2536
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
2537
- match self.literal.const_for_ty()?.val().try_to_scalar() {
+ match self.literal.try_to_scalar() {
2538
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
2539
GlobalAlloc::Static(def_id) => {
2540
assert!(!tcx.is_thread_local_static(def_id));
0 commit comments