File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
compiler/rustc_mir/src/const_eval Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -84,11 +84,10 @@ fn const_to_valtree_inner<'tcx>(
8484 Some ( ty:: ValTree :: Leaf ( val. assert_int ( ) ) )
8585 }
8686
87- // Raw pointers are not allowed in type level constants, as raw pointers compare equal if
88- // their addresses are equal. Since we cannot guarantee any kind of pointer stability in
89- // the type system.
90- // Technically we could allow function pointers, but they are not guaranteed to be the
91- // same as the function pointers at runtime.
87+ // Raw pointers are not allowed in type level constants, as we cannot properly test them for
88+ // equality at compile-time (see `ptr_guaranteed_eq`/`_ne`).
89+ // Technically we could allow function pointers (represented as `ty::Instance`), but this is not guaranteed to
90+ // agree with runtime equality tests.
9291 ty:: FnPtr ( _) | ty:: RawPtr ( _) => None ,
9392 ty:: Ref ( ..) => unimplemented ! ( "need to use deref_const" ) ,
9493
You can’t perform that action at this time.
0 commit comments