gcc/rust/ChangeLog:
* parse/rust-parse-impl.h
(Parser::parse_vis_item):
Call parse_function instead of parse_async_item when finding
UNSAFE or EXTERN_KW during lookahead.
gcc/testsuite/ChangeLog:
* rust/compile/func-const-unsafe.rs: New test.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
case IDENTIFIER:
case UNDERSCORE:
return parse_const_item (std::move (vis), std::move (outer_attrs));
- case UNSAFE:
- case EXTERN_KW:
case ASYNC:
return parse_async_item (std::move (vis), std::move (outer_attrs));
+ case UNSAFE:
+ case EXTERN_KW:
case FN_KW:
return parse_function (std::move (vis), std::move (outer_attrs));
default:
--- /dev/null
+pub const unsafe fn foo() {}