Skip to content

rustfmt wrap_comments breaks doc tests #3193

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
gnzlbg opened this issue Nov 10, 2018 · 3 comments
Closed

rustfmt wrap_comments breaks doc tests #3193

gnzlbg opened this issue Nov 10, 2018 · 3 comments

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 10, 2018

Rustfmt with wrap_comments = true and max_width = 79 reformats this:

/// Foo
///
/// ```rust
/// # #![cfg_attr(not(dox),feature(cfg_target_feature, target_feature, stdsimd))]
/// # #[cfg(not(dox))]
/// # #[macro_use]
/// # extern crate stdsimd;
/// ```
fn foo() {}

to this:

/// Foo
///
/// ```rust
/// # #![cfg_attr(not(dox),feature(cfg_target_feature, target_feature,
/// # stdsimd))] # #[cfg(not(dox))]
/// # #[macro_use]
/// # extern crate stdsimd;
/// ```
fn foo() {}

which breaks rust doc because now there are two hashes # # in the second line.

@scampi
Copy link
Contributor

scampi commented Nov 10, 2018

With the latest from master, that won't happen because wrapping is disabled for doc tests #3183

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 11, 2018

Thanks, I guess we can close this then. Or shall we wait till it hits nightly?

@scampi
Copy link
Contributor

scampi commented Nov 11, 2018

could be good to wait for nightly so people may find it if they get the same problem

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

No branches or pull requests

3 participants