File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed
testsuite/rust/compile/macros/mbe Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -978,16 +978,7 @@ Parser<ManagedTokenSource>::parse_delim_token_tree ()
978978 std::unique_ptr<AST::TokenTree> tok_tree = parse_token_tree ();
979979
980980 if (tok_tree == nullptr )
981- {
982- // TODO: is this error handling appropriate?
983- Error error (
984- t->get_locus (),
985- " failed to parse token tree in delimited token tree - found %qs" ,
986- t->get_token_description ());
987- add_error (std::move (error));
988-
989- return AST::DelimTokenTree::create_empty ();
990- }
981+ return AST::DelimTokenTree::create_empty ();
991982
992983 token_trees_in_tree.push_back (std::move (tok_tree));
993984
@@ -1075,11 +1066,12 @@ Parser<ManagedTokenSource>::parse_token_tree ()
10751066 case RIGHT_SQUARE:
10761067 case RIGHT_CURLY:
10771068 // error - should not be called when this a token
1078- add_error (
1079- Error (t->get_locus (),
1080- " unexpected closing delimiter %qs - token tree requires "
1081- " either paired delimiters or non-delimiter tokens" ,
1082- t->get_token_description ()));
1069+ add_error (Error (t->get_locus (), " unexpected closing delimiter %qs" ,
1070+ t->get_token_description ()));
1071+
1072+ add_error (Error (Error::Kind::Hint, t->get_locus (),
1073+ " token tree requires either paired delimiters or "
1074+ " non-delimiter tokens" ));
10831075
10841076 lexer.skip_token ();
10851077 return nullptr ;
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ struct Baz {
55impl Bar for
66
77
8- fn main( ) { ) // { dg-error "unexpected closing delimiter .\\ ). - token tree requires either paired delimiters or non-delimiter tokens" }
9- // { dg-error "failed to parse token tree in delimited token tree - found .\\)." "" { target *-*-* } .-1 }
8+ fn main( ) { ) // { dg-error "unexpected closing delimiter .\\ )." }
109 // { dg-error "unexpected token .end of file. - expecting closing delimiter .\}. .for a delimited token tree." "" { target *-*-* } .+2 }
1110 // { dg-error "unexpected token .end of file. - expecting closing delimiter .\\). .for a macro invocation semi." "" { target *-*-* } .+1 }
You can’t perform that action at this time.
0 commit comments