mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 04:08:40 +00:00
Merge #7887
7887: Fix fail to parse :: for meta in mbe r=edwin0cheng a=edwin0cheng fixes #7886 bors r+ Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
This commit is contained in:
commit
750d3cb846
@ -954,7 +954,8 @@ fn test_meta() {
|
|||||||
.assert_expand_items(
|
.assert_expand_items(
|
||||||
r#"foo! { cfg(target_os = "windows") }"#,
|
r#"foo! { cfg(target_os = "windows") }"#,
|
||||||
r#"# [cfg (target_os = "windows")] fn bar () {}"#,
|
r#"# [cfg (target_os = "windows")] fn bar () {}"#,
|
||||||
);
|
)
|
||||||
|
.assert_expand_items(r#"foo! { hello::world }"#, r#"# [hello :: world] fn bar () {}"#);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -95,7 +95,7 @@ pub(crate) mod fragments {
|
|||||||
// https://doc.rust-lang.org/reference/paths.html#simple-paths
|
// https://doc.rust-lang.org/reference/paths.html#simple-paths
|
||||||
// The start of an meta must be a simple path
|
// The start of an meta must be a simple path
|
||||||
match p.current() {
|
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![=] => {
|
T![=] => {
|
||||||
p.bump_any();
|
p.bump_any();
|
||||||
match p.current() {
|
match p.current() {
|
||||||
@ -105,6 +105,7 @@ pub(crate) mod fragments {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
_ if p.at(T![::]) => p.bump(T![::]),
|
||||||
_ => break,
|
_ => break,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user