I'm trying to use an unstable version of rustfmt for some config options that aren't in stable yet.
When I run via cargo +nightly fmt
things work as expected.
When I run via rustup run nightly -- rustfmt
, I get a different (and incorrect) output.
I'm guessing there is a bug in the version of rustfmt invoked by rustup (I can describe later), but I really just want to figure out how to get VS Code to do the same thing that cargo +nightly fmt
is doing but so far I haven't figured out how to do that. Any tips?
The (maybe) bug is that rustup run nightly -- rustfmt
removes the leading double colon from a use
line when it should not in a way that breaks the code. The use line is like use ::foo::bar
, and there happens to be a submodule named foo
as well, but it doesn't contain bar.
Should I try to report a bug about this? I searched briefly on GitHub and couldn't find anything.
I'm on MacOS:
➜ which cargo
/Users/garymm/.cargo/bin/cargo
➜ which rustup
/opt/homebrew/bin/rustup
➜ cargo +nightly fmt --version
rustfmt 1.8.0-nightly (28fc2ba714 2024-11-24)
➜ rustup run nightly -- rustfmt --version
rustfmt 1.8.0-nightly (28fc2ba714 2024-11-24)