The <*const T>::guaranteed_* methods now return an option for the unknown case

This commit is contained in:
Oli Scherer
2022-09-06 14:08:59 +00:00
parent a594044533
commit f632dbe46f
16 changed files with 119 additions and 584 deletions

View File

@@ -97,7 +97,7 @@ pub(crate) fn const_to_valtree_inner<'tcx>(
}
// Raw pointers are not allowed in type level constants, as we cannot properly test them for
// equality at compile-time (see `ptr_guaranteed_eq`/`_ne`).
// equality at compile-time (see `ptr_guaranteed_cmp`).
// Technically we could allow function pointers (represented as `ty::Instance`), but this is not guaranteed to
// agree with runtime equality tests.
ty::FnPtr(_) | ty::RawPtr(_) => Err(ValTreeCreationError::NonSupportedType),