Configuring the toolchain for a specific package in a workspace

I'm wondering if it's possible to tell the compiler to use the nightly toolchain on a specific package in my workspace using configuration files. Currently I'm using a rust-toolchain.toml file in my installer package with these contents:

channel = "nightly"

Very simple right now but I'll add more specifics later. Now when I call cargo check from my installer package the compiler has no issues, but when I call it from the workspace root it gives an error related to my code not being allowed on the stable release channel, so basically it didn't recognize the toolchain file.

you cannot do this. rustc doesn't guarantee a stable ABI, you are not supposed to mix crates built with different compilers, even different versions from the same stable channel. you shall specify the toolchain in the workspace toml file and all crates in the workspace will be built with the same compiler.

unless you use C ABI across the boundary, i.e. build the crate using nightly compiler as an static or shared library, then link the library as if it were a foreign library in your main program.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.