From 6be4ce99d513fb6dcda1aff2f1bb9bc6101fb0b8 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Thu, 25 Mar 2021 13:33:53 +0000 Subject: Add missing location info into TypePath This improves errors messages with the source location info for the error. --- gcc/rust/parse/rust-parse-impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index f683770..86b8d94 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -6126,6 +6126,7 @@ AST::TypePath Parser::parse_type_path () { bool has_opening_scope_resolution = false; + Location locus = lexer.peek_token ()->get_locus (); if (lexer.peek_token ()->get_id () == SCOPE_RESOLUTION) { has_opening_scope_resolution = true; @@ -6172,7 +6173,7 @@ Parser::parse_type_path () segments.shrink_to_fit (); - return AST::TypePath (std::move (segments), Linemap::unknown_location (), + return AST::TypePath (std::move (segments), locus, has_opening_scope_resolution); } -- cgit v1.1