1
Fork 0

Rollup merge of #122173 - compiler-errors:ptr-equality-in-ctfe, r=lcnr

Don't ICE in CTFE if raw/fn-ptr types differ

Fixes #121688

r? lcnr
This commit is contained in:
Matthias Krüger 2024-03-08 13:22:27 +01:00 committed by GitHub
commit 3d71bada5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 1 deletions

View file

@ -581,7 +581,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
if is_int_bool_or_char(lhs_ty) && is_int_bool_or_char(rhs_ty) {
// Int, bool, and char operations are fine.
} else if lhs_ty.is_fn_ptr() || lhs_ty.is_unsafe_ptr() {
assert_eq!(lhs_ty, rhs_ty);
assert!(matches!(
op,
BinOp::Eq