compiler: Never debug_assert in codegen

The gains in performance are not worth the costs in correctness.
This is partly because the gains are zero and the costs are unknown.
This commit is contained in:
Jubilee Young
2024-07-19 16:52:33 -07:00
parent 9057c3ffec
commit ce7b069fd8
16 changed files with 57 additions and 65 deletions

View File

@@ -565,7 +565,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
for elem in place_ref.projection.iter() {
match elem {
mir::ProjectionElem::Field(ref f, _) => {
debug_assert!(
assert!(
!o.layout.ty.is_any_ptr(),
"Bad PlaceRef: destructing pointers should use cast/PtrMetadata, \
but tried to access field {f:?} of pointer {o:?}",