mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Add L_DOLLAR for TYPE_RECOVERY_SET
This commit is contained in:
parent
d89c189ad1
commit
53d05448c1
2 changed files with 18 additions and 1 deletions
|
@ -1614,6 +1614,23 @@ fn test_issue_2520() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_issue_3861() {
|
||||||
|
let macro_fixture = parse_macro(
|
||||||
|
r#"
|
||||||
|
macro_rules! rgb_color {
|
||||||
|
($p:expr, $t: ty) => {
|
||||||
|
pub fn new() {
|
||||||
|
let _ = 0 as $t << $p;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
|
||||||
|
macro_fixture.expand_items(r#"rgb_color!(8 + 8, u32);"#);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_repeat_bad_var() {
|
fn test_repeat_bad_var() {
|
||||||
// FIXME: the second rule of the macro should be removed and an error about
|
// FIXME: the second rule of the macro should be removed and an error about
|
||||||
|
|
|
@ -7,7 +7,7 @@ pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(token_set![
|
||||||
DYN_KW, L_ANGLE,
|
DYN_KW, L_ANGLE,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const TYPE_RECOVERY_SET: TokenSet = token_set![R_PAREN, COMMA];
|
const TYPE_RECOVERY_SET: TokenSet = token_set![R_PAREN, COMMA, L_DOLLAR];
|
||||||
|
|
||||||
pub(crate) fn type_(p: &mut Parser) {
|
pub(crate) fn type_(p: &mut Parser) {
|
||||||
type_with_bounds_cond(p, true);
|
type_with_bounds_cond(p, true);
|
||||||
|
|
Loading…
Reference in a new issue