File tree 1 file changed +4
-5
lines changed
compiler/rustc_mir/src/const_eval
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>(
84
84
Some ( ty:: ValTree :: Leaf ( val. assert_int ( ) ) )
85
85
}
86
86
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.
92
91
ty:: FnPtr ( _) | ty:: RawPtr ( _) => None ,
93
92
ty:: Ref ( ..) => unimplemented ! ( "need to use deref_const" ) ,
94
93
You can’t perform that action at this time.
0 commit comments