Skip to content

rustc stuck forever in expand_bang_invoc when $($p:vis)* does not match #42755

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
kennytm opened this issue Jun 19, 2017 · 0 comments
Closed
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

Comments

@kennytm
Copy link
Member

kennytm commented Jun 19, 2017

Test case:

#![feature(macro_vis_matcher)]
macro_rules! foo {
    ($($p:vis)*) => {}
}
foo!(a);

Compiling this stuck forever in the "expansion" pass.

$ rustc -Ztime-passes b.rs
time: 0.000	parsing
time: 0.000	recursion limit
time: 0.000	crate injection
time: 0.000	plugin loading
time: 0.000	plugin registration
^C

cc #41022 (:vis tracking issue).

Since :vis can match "nothing", the macro should error with "repetition matches empty token tree".


$ rustc -vV
rustc 1.19.0-nightly (fe7227f6c 2017-06-16)
binary: rustc
commit-hash: fe7227f6c8704f0186091085a14fd1027920e4bb
commit-date: 2017-06-16
host: x86_64-apple-darwin
release: 1.19.0-nightly
LLVM version: 4.0
@Mark-Simulacrum Mark-Simulacrum added the A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) label Jun 22, 2017
bors added a commit that referenced this issue Jul 6, 2017
@bors bors closed this as completed in 06e1fc0 Jul 6, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Projects
None yet
Development

No branches or pull requests

2 participants