aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse
diff options
context:
space:
mode:
authorSimplyTheOther <simplytheother@gmail.com>2020-12-13 18:18:37 +0800
committerSimplyTheOther <simplytheother@gmail.com>2020-12-13 20:19:37 +0800
commit6d9b6db945ec25b51bff8b04e151973788149f3d (patch)
tree3e108b3b8727a01b008191d2eedeab6774b67025 /gcc/rust/parse
parenta697962166a9c72e568814e09658a896fc92fef5 (diff)
downloadgcc-6d9b6db945ec25b51bff8b04e151973788149f3d.zip
gcc-6d9b6db945ec25b51bff8b04e151973788149f3d.tar.gz
gcc-6d9b6db945ec25b51bff8b04e151973788149f3d.tar.bz2
Added location storage for struct expr fields
Fixed typo in an enum expr field class
Diffstat (limited to 'gcc/rust/parse')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 74b6510..02c32b2 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -11509,7 +11509,7 @@ Parser<ManagedTokenSource>::parse_struct_expr_field ()
return std::unique_ptr<AST::StructExprFieldIdentifierValue> (
new AST::StructExprFieldIdentifierValue (std::move (ident),
- std::move (expr)));
+ std::move (expr), t->get_locus ()));
}
else
{
@@ -11518,7 +11518,7 @@ Parser<ManagedTokenSource>::parse_struct_expr_field ()
lexer.skip_token ();
return std::unique_ptr<AST::StructExprFieldIdentifier> (
- new AST::StructExprFieldIdentifier (std::move (ident)));
+ new AST::StructExprFieldIdentifier (std::move (ident), t->get_locus ()));
}
case INT_LITERAL: {
// parse tuple index field
@@ -11542,7 +11542,7 @@ Parser<ManagedTokenSource>::parse_struct_expr_field ()
}
return std::unique_ptr<AST::StructExprFieldIndexValue> (
- new AST::StructExprFieldIndexValue (index, std::move (expr)));
+ new AST::StructExprFieldIndexValue (index, std::move (expr), t->get_locus ()));
}
case DOT_DOT:
/* this is a struct base and can't be parsed here, so just return nothing
@@ -11551,8 +11551,8 @@ Parser<ManagedTokenSource>::parse_struct_expr_field ()
return nullptr;
default:
rust_error_at (t->get_locus (),
- "unrecognised token %qs as first token of struct expr "
- "field - expected identifier or int literal",
+ "unrecognised token %qs as first token of struct expr field - "
+ "expected identifier or int literal",
t->get_token_description ());
return nullptr;
}