Skip to content

Make driver::driver::parse_cfgspecs parse any variety of meta_item #2399

New issue

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

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

Already on GitHub? Sign in to your account

Closed
catamorphism opened this issue May 17, 2012 · 2 comments
Closed
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler A-parser Area: The lexing & parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@catamorphism
Copy link
Contributor

A FIXME in parse_cfgspecs says:

    // FIXME: It would be nice to use the parser to parse all varieties of
    // meta_item here. At the moment we just support the meta_word variant.
@lucab
Copy link
Contributor

lucab commented Oct 30, 2012

While looking into it, I got the impression that a Parser would need a full-blown Session, which we don't have yet as we are just building its options...

@brson
Copy link
Contributor

brson commented Oct 30, 2012

Parsers do not require a Session, only a parse_sess. The best way to create a parser here is probably with new_parser_from_source_str: https://github.com/mozilla/rust/blob/incoming/src/libsyntax/parse.rs#L183

bors added a commit that referenced this issue Mar 19, 2013
All current meta items types (word, name-value, list) are now
properly parsed by rustc --cfg command line. Fixes #2399
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
no need for an exhaustive enum of subcommands
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
tshepang pushed a commit to tshepang/rust that referenced this issue Jun 2, 2025
Fix misdirected link for `TypingEnv`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler A-parser Area: The lexing & parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants