Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/items.rs')
-rw-r--r--crates/parser/src/grammar/items.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs
index c609f9383e..c0acdde2a7 100644
--- a/crates/parser/src/grammar/items.rs
+++ b/crates/parser/src/grammar/items.rs
@@ -422,7 +422,12 @@ fn fn_(p: &mut Parser<'_>, m: Marker) {
// test function_ret_type
// fn foo() {}
// fn bar() -> () {}
- opt_ret_type(p);
+ if !opt_ret_type(p) {
+ // test_err function_ret_type_missing_arrow
+ // fn foo() usize {}
+ // fn bar() super::Foo {}
+ opt_no_arrow_ret_type(p);
+ }
// test_err fn_ret_recovery
// fn foo() -> A>]) { let x = 1; }