diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-09-21 07:22:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-21 07:22:49 +0200 |
| commit | ff6cd18a75619f438e971f1db3b1ec43e6659870 (patch) | |
| tree | 2d0e9933e16dff006c1ddc6600ac80aa74a74032 /compiler/rustc_codegen_ssa/src/debuginfo | |
| parent | 43366285f48a3e22ca48e5b4b6bce4632a751c4b (diff) | |
| parent | c0d1a1305d711912f40e325f2111e15fb0791eb1 (diff) | |
| download | rust-ff6cd18a75619f438e971f1db3b1ec43e6659870.tar.gz rust-ff6cd18a75619f438e971f1db3b1ec43e6659870.zip | |
Rollup merge of #130644 - compiler-errors:consts-in-codegen, r=BoxyUwU
Only expect valtree consts in codegen Turn a bunch of `Const::eval_*` calls into `Const::try_to_*` calls, which implicitly assert that we only have valtrees by the time we get to codegen. r? `@BoxyUwU`
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs index 55a71db9bae..369ab387bea 100644 --- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs +++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs @@ -188,7 +188,8 @@ fn push_debuginfo_type_name<'tcx>( _ => write!( output, ",{}>", - len.eval_target_usize(tcx, ty::ParamEnv::reveal_all()) + len.try_to_target_usize(tcx) + .expect("expected monomorphic const in codegen") ) .unwrap(), } @@ -200,7 +201,8 @@ fn push_debuginfo_type_name<'tcx>( _ => write!( output, "; {}]", - len.eval_target_usize(tcx, ty::ParamEnv::reveal_all()) + len.try_to_target_usize(tcx) + .expect("expected monomorphic const in codegen") ) .unwrap(), } |
