mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Parse try
as a keyword only in edition 2018 and up
This commit is contained in:
parent
713c47f25b
commit
d235d09bf9
8 changed files with 24 additions and 42 deletions
|
@ -559,11 +559,17 @@ mod ok {
|
|||
fn try_expr() { run_and_expect_no_errors("test_data/parser/inline/ok/try_expr.rs"); }
|
||||
#[test]
|
||||
fn try_macro_fallback() {
|
||||
run_and_expect_no_errors("test_data/parser/inline/ok/try_macro_fallback.rs");
|
||||
run_and_expect_no_errors_with_edition(
|
||||
"test_data/parser/inline/ok/try_macro_fallback.rs",
|
||||
crate::Edition::Edition2015,
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn try_macro_rules() {
|
||||
run_and_expect_no_errors("test_data/parser/inline/ok/try_macro_rules.rs");
|
||||
run_and_expect_no_errors_with_edition(
|
||||
"test_data/parser/inline/ok/try_macro_rules.rs",
|
||||
crate::Edition::Edition2015,
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn tuple_attrs() { run_and_expect_no_errors("test_data/parser/inline/ok/tuple_attrs.rs"); }
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
SOURCE_FILE
|
||||
FN
|
||||
COMMENT "// 2015"
|
||||
WHITESPACE "\n"
|
||||
FN_KW "fn"
|
||||
WHITESPACE " "
|
||||
NAME
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
// 2015
|
||||
fn foo() { try!(Ok(())); }
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
SOURCE_FILE
|
||||
MACRO_RULES
|
||||
COMMENT "// 2015"
|
||||
WHITESPACE "\n"
|
||||
MACRO_RULES_KW "macro_rules"
|
||||
BANG "!"
|
||||
WHITESPACE " "
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
// 2015
|
||||
macro_rules! try { () => {} }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue