Skip to content
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

Add way to dump the AST #10485

Closed
emberian opened this issue Nov 14, 2013 · 2 comments
Closed

Add way to dump the AST #10485

emberian opened this issue Nov 14, 2013 · 2 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@emberian
Copy link
Member

We have the ability to serialize the AST, we should use it! Probably --emit-ast would dump JSON after phase 2.

@Arnavion
Copy link

Arnavion commented May 3, 2016

For anyone who googles rust dump ast and lands here (and doesn't look at the commit that closed this), it's rustc -Z ast-json foo.rs

@V0ldek
Copy link
Contributor

V0ldek commented Feb 8, 2023

This doesn't work.

rustc +nightly -Z ast-json                                                                                
error: unknown unstable option: `ast-json`

I can see an unpretty=ast-tree option, but that dumps the AST in a non-json format.

How do you get a JSON dump?

flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 7, 2023
new lint: suspicious_doc_comments

Fixes rust-lang#10485.

This PR adds a new lint (`suspicious_doc_comments`) that triggers when the user writes `///!` or `/**!`.
This is almost certainly a mistake and the user probably meant to write an inner doc comment (`//!`, `/*!`) to document the module or crate that this comment is contained in.

changelog: [`suspicious_doc_comments`]: new lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants