diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-03-25 13:33:53 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-03-25 17:37:14 +0000 |
commit | 6be4ce99d513fb6dcda1aff2f1bb9bc6101fb0b8 (patch) | |
tree | 4e462320e7803956a5197b3c053e54014fb9d28d /gcc | |
parent | 08b49a3e526b7991802323c54eca5e810abb500a (diff) | |
download | gcc-6be4ce99d513fb6dcda1aff2f1bb9bc6101fb0b8.zip gcc-6be4ce99d513fb6dcda1aff2f1bb9bc6101fb0b8.tar.gz gcc-6be4ce99d513fb6dcda1aff2f1bb9bc6101fb0b8.tar.bz2 |
Add missing location info into TypePath
This improves errors messages with the source location info for the error.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 3 |
1 files changed, 2 insertions, 1 deletions
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<ManagedTokenSource>::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<ManagedTokenSource>::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); } |