diff options
| author | Lukas Markeffsky <@> | 2025-01-27 04:30:00 +0100 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2025-01-30 17:47:44 +0100 |
| commit | 10fc0b159ee6e5281bf38f65680082961dd7bec3 (patch) | |
| tree | 9abdb74a542fbec70d97e48b43e660bb01793eac /compiler/rustc_symbol_mangling/src/v0.rs | |
| parent | 5a45ab9738330fb317d49e3594c2db5248b1e971 (diff) | |
| download | rust-10fc0b159ee6e5281bf38f65680082961dd7bec3.tar.gz rust-10fc0b159ee6e5281bf38f65680082961dd7bec3.zip | |
introduce `ty::Value`
Co-authored-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
Diffstat (limited to 'compiler/rustc_symbol_mangling/src/v0.rs')
| -rw-r--r-- | compiler/rustc_symbol_mangling/src/v0.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs index 4ddf530a00d..5b3272feecd 100644 --- a/compiler/rustc_symbol_mangling/src/v0.rs +++ b/compiler/rustc_symbol_mangling/src/v0.rs @@ -590,8 +590,8 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> { fn print_const(&mut self, ct: ty::Const<'tcx>) -> Result<(), PrintError> { // We only mangle a typed value if the const can be evaluated. - let (ct_ty, valtree) = match ct.kind() { - ty::ConstKind::Value(ty, val) => (ty, val), + let cv = match ct.kind() { + ty::ConstKind::Value(cv) => cv, // Should only be encountered within the identity-substituted // impl header of an item nested within an impl item. @@ -619,13 +619,14 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> { return Ok(()); } + let ty::Value { ty: ct_ty, valtree } = cv; let start = self.out.len(); match ct_ty.kind() { ty::Uint(_) | ty::Int(_) | ty::Bool | ty::Char => { ct_ty.print(self)?; - let mut bits = ct + let mut bits = cv .try_to_bits(self.tcx, ty::TypingEnv::fully_monomorphized()) .expect("expected const to be monomorphic"); |
