Skip to content

feature external_doc not traversed by rustfmt #60997

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
kentfredric opened this issue May 21, 2019 · 1 comment
Closed

feature external_doc not traversed by rustfmt #60997

kentfredric opened this issue May 21, 2019 · 1 comment
Labels
C-bug Category: This is a bug. F-external_doc `#![feature(external_doc)]` T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@kentfredric
Copy link

When using the nightly external doc feature #44732 , rustfmt ceases to be able to tidy code blocks in the documentation.

As a test, I put a documentation code block that was previously in a .rs file into an include='d .md file, intentionally made it a mess, and observed that rustfmt no longer made it look readable:

```no_run
use grease::repository::CategoryFileIterator;let iterator = CategoryFileIterator::for_file( "/usr/portage",  "/usr/portage/profiles/categories",);for item_result in iterator.unwrap() {  println!("{}", item_result.unwrap().name());}
```

And rustfmt did not indicate any attempts to format this file:

rustfmt --edition 2018 /home/kent/rust/grease/src/lib.rs --verbose
Using rustfmt config file /home/kent/rust/grease/rustfmt.toml for /home/kent/rust/grease/src/lib.rs
Formatting /home/kent/rust/grease/src/lib.rs
Formatting /home/kent/rust/grease/src/repository/category.rs
Formatting /home/kent/rust/grease/src/repository/ebuild.rs
Formatting /home/kent/rust/grease/src/repository/package.rs
Formatting /home/kent/rust/grease/src/repository.rs
Spent 0.002 secs in the parsing phase, and 0.009 secs in the formatting phase

I imagine being able to format these external files would be something that should work prior to this feature being stabilized, or at very least, rustfmt should gain options so that it can do this.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels May 21, 2019
@jyn514 jyn514 added the F-external_doc `#![feature(external_doc)]` label Dec 16, 2020
@jyn514
Copy link
Member

jyn514 commented Jun 26, 2021

doc(include) has been removed. #85457

@jyn514 jyn514 closed this as completed Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-external_doc `#![feature(external_doc)]` T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants