aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def')
-rw-r--r--crates/hir_def/src/body/lower.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs
index 9f278d35b..b00dcbdf0 100644
--- a/crates/hir_def/src/body/lower.rs
+++ b/crates/hir_def/src/body/lower.rs
@@ -1022,7 +1022,10 @@ impl From<ast::LiteralKind> for Literal {
1022 let ty = lit.suffix().and_then(|it| BuiltinFloat::from_suffix(&it)); 1022 let ty = lit.suffix().and_then(|it| BuiltinFloat::from_suffix(&it));
1023 Literal::Float(Default::default(), ty) 1023 Literal::Float(Default::default(), ty)
1024 } 1024 }
1025 LiteralKind::ByteString(_) => Literal::ByteString(Default::default()), 1025 LiteralKind::ByteString(bs) => {
1026 let text = bs.value().map(Vec::from).unwrap_or_else(Default::default);
1027 Literal::ByteString(text)
1028 }
1026 LiteralKind::String(_) => Literal::String(Default::default()), 1029 LiteralKind::String(_) => Literal::String(Default::default()),
1027 LiteralKind::Byte => Literal::Uint(Default::default(), Some(BuiltinUint::U8)), 1030 LiteralKind::Byte => Literal::Uint(Default::default(), Some(BuiltinUint::U8)),
1028 LiteralKind::Bool(val) => Literal::Bool(val), 1031 LiteralKind::Bool(val) => Literal::Bool(val),