Open Lokathor opened 4 years ago
@Lokathor Thank you for filing an issue! Is it possible to provide a link to the repository with which you have a problem?
Yes, the repo in question was https://github.com/Lokathor/vanadium
@Lokathor Thank you for sharing the problematic repository. It looks like the crate is using pick!
macro, which rustfmt does not support yet:
pick! {
if #[cfg(windows)] {
mod windows;
use windows as sys;
type SysTerm = sys::WindowsTerminal;
} else if #[cfg(unix)] {
mod unix;
use unix as sys;
type SysTerm = sys::UnixTerminal;
} else {
compile_error!("This crate doesn't support this system.");
}
}
Currently, rustfmt is only able to resolve modules that are declared inside macros.
rustfmt 1.4.11-nightly (18382352 2019-12-03)
Recently all of my files that are behind config flags stopped formatting with
cargo fmt
, even if the code would be configured into a current build (eg: acfg(windows)
module on a windows machine).