You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a case where rustfmt, as part of reordering imports, literally moves a comment from one import to another, entirely destroying its meaning:
mod realstd {struct__FastLocalKeyInner;}mod local {mod fast {structKey;}}#[cfg(test)]// comment associated with realstd importpubuse realstd::thread::__FastLocalKeyInner;#[cfg(test)]pubuseself::local::fast::Keyas __FastLocalKeyInnerUnused;// comment associated with fast importfnmain(){}
After formatting, the imports look like
#[cfg(test)]pubuseself::local::fast::Keyas __FastLocalKeyInnerUnused;#[cfg(test)]// comment associated with realstd importpubuse realstd::thread::__FastLocalKeyInner;// comment associated with fast import
Not that the comment that explained the use self::local::fast::Key as, got moved to the other use!
This is with rustfmt 1.5.1-nightly (2022-08-05 affe0d3).
The text was updated successfully, but these errors were encountered:
Here is a case where rustfmt, as part of reordering imports, literally moves a comment from one import to another, entirely destroying its meaning:
After formatting, the imports look like
Not that the comment that explained the
use self::local::fast::Key as
, got moved to the otheruse
!This is with rustfmt 1.5.1-nightly (2022-08-05 affe0d3).
The text was updated successfully, but these errors were encountered: