From de8eed9b8efea12d5b7987206e8e9fb0109966ca Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Thu, 11 May 2023 16:13:41 +0200 Subject: [PATCH] gccrs: ast: Propagate type suffix Propagate back type suffix to created tokens. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Propagate coretype hint. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-collector.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc index 45a760944990..a09869b7e6dd 100644 --- a/gcc/rust/ast/rust-ast-collector.cc +++ b/gcc/rust/ast/rust-ast-collector.cc @@ -809,10 +809,12 @@ TokenCollector::visit (Literal &lit, Location locus) Rust::Token::make_byte_string (locus, std::move (value))); break; case Literal::LitType::INT: - tokens.push_back (Rust::Token::make_int (locus, std::move (value))); + tokens.push_back ( + Rust::Token::make_int (locus, std::move (value), lit.get_type_hint ())); break; case Literal::LitType::FLOAT: - tokens.push_back (Rust::Token::make_float (locus, std::move (value))); + tokens.push_back (Rust::Token::make_float (locus, std::move (value), + lit.get_type_hint ())); break; case Literal::LitType::BOOL: { if (value == "false") -- 2.47.2