Open
Description
Just noticed some weird behaviour, not sure if it's been reported already, I tried searching but I'm not sure how to classify it
this:
pub/* (crate) */ trait MyTrait {}
gets reformatted as:
pub trait MyTrait /* (crate) */ trait MyTrait {}
Test:
$ rustfmt <<< 'pub/* (crate) */ trait MyTrait {}'
pub trait MyTrait /* (crate) */ trait MyTrait {}
Worth noting, I didn't observe this behavior with struct
s, enum
s, union
s and expanding the comment's scope to include the pub
, it behaves correctly with this:
/* pub (crate) */ trait MyTrait {}
getting reformatted to:
/* pub (crate) */
trait MyTrait {}