Skip to content

Fn params are commented out with doc comments. #4936

Closed
@HyeonuPark

Description

@HyeonuPark
$ git rev-parse HEAD
3d8cd57c2f166cb92204e95a5f4c73ab20fed4f2

$ cat example.rs
#[discard_params_doc]
trait Trait {
    fn foo(
        &self,
        /// some docs
        bar: String,
        /// another docs
        baz: i32,
    );
}

$ cargo run --bin rustfmt -- --edition=2018 < example.rs 2> /dev/null
#[discard_params_doc]
trait Trait {
    fn foo(&self, /// some docs bar: String, /// another docs baz: i32
    );
}

Normally doc comments on fn params triggers compile error. But it's ok if attribute macro discards it anyway... unless I run rustfmt on it.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions