gccrs: diagnostics: Add underline for tokens in diagnostics.
Currently, the diagnostics only point to the corresponding token's
start position by carets, and lack of underlines for full token. This
commit add support for such underlines in diagnostics by encoding range
information in location_t.
gcc/rust/ChangeLog:
* lex/rust-lex.cc (Lexer::build_token): Make location enclose entire token.
(Lexer::parse_byte_char): Likewise.
(Lexer::parse_byte_string): Likewise.
(Lexer::parse_raw_byte_string): Likewise.
(Lexer::parse_raw_identifier): Likewise.
(Lexer::parse_string): Likewise.
(Lexer::parse_identifier_or_keyword): Likewise.
(Lexer::parse_raw_string): Likewise.
(Lexer::parse_non_decimal_int_literal): Likewise.
(Lexer::parse_decimal_int_or_float): Likewise.
(Lexer::parse_char_or_lifetime): Likewise.
gcc/testsuite/ChangeLog:
* rust/compile/diagnostic_underline.rs: New test.
Signed-off-by: Xiao Ma <mxlol233@outlook.com>