Closed
Description
rustfmt
un-indents the attribute in this small example. Interestingly, if either the doc comment or the inline comment are removed, rustfmt
lets the attribute stay indented, which I believe to be the intuitive behavior.
Input
pub struct Struct {}
impl Struct {
/// Documentation for `foo`
#[rustfmt::skip] // comment on why use a skip here
pub fn foo(&self) -> usize {
0
}
}
Output
pub struct Struct {}
impl Struct {
/// Documentation for `foo`
#[rustfmt::skip] // comment on why use a skip here
pub fn foo(&self) -> usize {
0
}
}
Expected output
(no change)
Meta
- rustfmt version: Observed this behavior on both 1.4.17-stable (2020-07-20) and 1.4.20-nightly (2020-08-09)
- From where did you install rustfmt?: rustup