Skip to content

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

Closed
@kennytm

Description

@kennytm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions