Skip to content

Conversation

@nothingmuch
Copy link
Contributor

No description provided.

Provides sources of standard library, e.g. for rust-analyzer.
let
rust = super.rust-bin;
toolchain =
if builtins.pathExists ./rust-toolchain.toml then
Copy link
Contributor

@lucperkins lucperkins May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work too?

(if builtins.pathExists ./rust-toolchain.toml then
  rust.fromRustupToolchainFile ./rust-toolchain.toml
else if builtins.pathExists ./rust-toolchain then
  rust.fromRustupToolchainFile ./rust-toolchain
else
  rust.stable.latest.default).override { extensions = [ "rust-src" ]; }

Copy link
Contributor Author

@nothingmuch nothingmuch May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on second thought, if a rust toolchain file is provided then it should be trusted WRT which components to use? (edit to clarify: maybe only rust.stable.latest.default.override { extensions = [ "rust-src" ] } should be used eliminating the need for let or parens, or more complex and seemingly still wrong but less wrong, append "rust-src" to rust-toolchain.toml component list?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants