From ce7b069fd840916415adf2357c6133e2c1e4625b Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Fri, 19 Jul 2024 16:52:33 -0700 Subject: 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. --- compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_codegen_ssa/src/debuginfo') diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs index c4e5c858240..6a6d47fcbba 100644 --- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs +++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs @@ -459,7 +459,7 @@ fn push_debuginfo_type_name<'tcx>( output: &mut String, visited: &mut FxHashSet>, ) { - debug_assert!(!wants_c_like_enum_debuginfo(ty_and_layout)); + assert!(!wants_c_like_enum_debuginfo(ty_and_layout)); output.push_str("enum2$<"); push_inner(output, visited); push_close_angle_bracket(true, output); @@ -660,7 +660,7 @@ fn push_generic_params_internal<'tcx>( output: &mut String, visited: &mut FxHashSet>, ) -> bool { - debug_assert_eq!(args, tcx.normalize_erasing_regions(ty::ParamEnv::reveal_all(), args)); + assert_eq!(args, tcx.normalize_erasing_regions(ty::ParamEnv::reveal_all(), args)); let mut args = args.non_erasable_generics(tcx, def_id).peekable(); if args.peek().is_none() { return false; -- cgit 1.4.1-3-g733a5