-
Notifications
You must be signed in to change notification settings - Fork 928
Documentation code is not formatted when format_code_in_doc_comments
is enabled.
#3751
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
Comments
format_code_in_doc_comments
is enabled.format_code_in_doc_comments
is enabled.
Thank you for reporting an issue. Would you mind providing us with some examples? That would be helpful to track down the bug. |
This happens against this repository at this commit. If I intentionally "scramble" the examples, For example, this altered comment (originally from here) is left unchanged after running //! # Examples
//!
//! Indexing data for a cube to create raw buffers and a `MeshBuffer`:
//!
//! ```rust
//! # extern crate decorum;
//! # extern crate nalgebra;
//! # extern crate plexus;
//! #
//! use nalgebra::Point3;
//! use plexus::buffer::MeshBuffer3;
//! use plexus::index::{Flat3, HashIndexer};
//! use plexus::prelude::*;
//! use plexus::primitive::cube::Cube;
//! use plexus::primitive::generate::Position;
//! use decorum::N64;
//!
//! # fn main() {
//! let (indices, positions) = Cube::new().polygons::<Position<Point3<N64>>>()
//!
//! .triangulate()
//! .index_vertices::<Flat3, _>(HashIndexer::default())
//! ;
//! let buffer =
//! MeshBuffer3::<u32, _>::
//! from_raw_buffers(indices, positions).unwrap();
//! # }
//! ```
I noticed this when I wrote some new documentation code. I expected |
Thanks! It looks like rustfmt fails to format the doc comment when it contains a line with //! ```rust
//! #
//! # fn main() {
//! foo ( ) ;
//! # }
//! ```
|
I'm using nightly build
1.4.4-nightly (0462008 2019-08-06)
ofrustfmt
with the followingrustfmt.toml
:When invoked with
cargo +nightly fmt
using this configuration,rustfmt
does not format code in documentation comments. This doesn't seem to agree with the documentation for theformat_code_in_doc_comments
setting. Could this be a bug?The text was updated successfully, but these errors were encountered: