-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for +<toolchain>
rustup feature
#110
Comments
Can you explain more why and where exactly do you need it? Personally I always use nightly rustfmt with stable toolchain. In my own project I use
|
I've use this |
There are some cargo features and tools that can't be used without the |
With I should add support for it to Flakebox ... 🤔 |
I'm happy to see this closed, but glad the conversation was had if not just for posterity. Thanks for the recommendation! |
I'm having issues with
This doesn't appear to be the case, unless I'm doing something wrong. |
@tmillr You can use flake-utils.lib.eachDefaultSystem (
system: let
<SNIP>
rust = (
pkgs.rust-bin.stable."1.76.0".default.override {
extensions = [
"rust-src"
"rust-analyzer"
"clippy"
];
targets = ["x86_64-unknown-linux-gnu"];
}
);
in
with pkgs; {
devShells.default = mkShell {
buildInputs = [
# We use the nightly formatter which is executed when running `cargo fmt`, without `+nightly` flag
# which is a rustup binary wrapper functionality, which we don't use.
(lib.hiPrio rust-bin.nightly."2024-04-01".rustfmt)
rust
];
};
}
); With this you get the nightly version when you invoke it regularly like this: $ cargo fmt --version
rustfmt 1.7.0-nightly (8058136 2024-03-31) The full snippet can be found in |
Adding this for posterity in case someone else finds themselves here.
My particular use case was for nightly formatting like so:
cargo +nightly fmt
in a script that formats all files.I was able to work around this by installing the nightly toolchain and changing the above to
rustup run nightly cargo fmt
, then adding theunstable_features = true
option to therustfmt.toml
.To quote @figsoda on the topic:
The text was updated successfully, but these errors were encountered: