Allow wrapping builtin#offset_of fields argument in parentheses

This is necessary to correctly handle nested fields (`foo.bar`), see the comments in the code for explanation.
This commit is contained in:
Chayim Refael Friedman 2025-04-21 03:43:15 +03:00
parent 2f2cff19f8
commit db6db2aacc
4 changed files with 61 additions and 0 deletions

View file

@ -416,6 +416,10 @@ mod ok {
run_and_expect_no_errors("test_data/parser/inline/ok/nocontentexpr_after_item.rs");
}
#[test]
fn offset_of_parens() {
run_and_expect_no_errors("test_data/parser/inline/ok/offset_of_parens.rs");
}
#[test]
fn or_pattern() { run_and_expect_no_errors("test_data/parser/inline/ok/or_pattern.rs"); }
#[test]
fn param_list() { run_and_expect_no_errors("test_data/parser/inline/ok/param_list.rs"); }