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

Fails to format doc comments on statements #71

Closed
dtolnay opened this issue Dec 25, 2019 · 0 comments · Fixed by #72
Closed

Fails to format doc comments on statements #71

dtolnay opened this issue Dec 25, 2019 · 0 comments · Fixed by #72

Comments

@dtolnay
Copy link
Owner

dtolnay commented Dec 25, 2019

Input:

fn main() {
    /// wat
    let _ = ();
}

cargo expand produces:

#![feature(prelude_import)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
fn main() {
    # [ doc = " wat" ] let _ = ( ) ;
}

It seems rustfmt's normalize_doc_attributes config fails on statements (rust-lang/rustfmt#3981). For now we should just throw away doc attributes on statements before invoking rustfmt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant