Fix fail to parse :: for meta in mbe
This commit is contained in:
parent
3d662e320b
commit
20eda09712
@ -954,7 +954,8 @@ fn bar() {}
|
||||
.assert_expand_items(
|
||||
r#"foo! { cfg(target_os = "windows") }"#,
|
||||
r#"# [cfg (target_os = "windows")] fn bar () {}"#,
|
||||
);
|
||||
)
|
||||
.assert_expand_items(r#"foo! { hello::world }"#, r#"# [hello :: world] fn bar () {}"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -95,7 +95,7 @@ fn is_delimiter(p: &mut Parser) -> bool {
|
||||
// https://doc.rust-lang.org/reference/paths.html#simple-paths
|
||||
// The start of an meta must be a simple path
|
||||
match p.current() {
|
||||
IDENT | T![::] | T![super] | T![self] | T![crate] => p.bump_any(),
|
||||
IDENT | T![super] | T![self] | T![crate] => p.bump_any(),
|
||||
T![=] => {
|
||||
p.bump_any();
|
||||
match p.current() {
|
||||
@ -105,6 +105,7 @@ fn is_delimiter(p: &mut Parser) -> bool {
|
||||
}
|
||||
break;
|
||||
}
|
||||
_ if p.at(T![::]) => p.bump(T![::]),
|
||||
_ => break,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user