简体   繁体   English

如何使用其他版本的Rust编译器建立依赖关系?

[英]How to build a dependency with a different version of the Rust compiler?

I've got a Rust project I build with the 1.33 tool chain. 我有一个使用1.33工具链构建的Rust项目。 I need to add a dependency on a crate that can only be built with Rust nightly, how can I specify in the dependencies it should be built with nightly? 我需要在只能通过Rust每晚构建的板条箱上添加依赖关系,如何在依赖关系中指定应该每晚构建的板条箱?

You cannot. 你不能。 Rust does not have a stable ABI and it is not possible to mix crates built with different versions of the compiler within the same project. Rust没有稳定的ABI,并且不可能在同一项目中混合使用不同版本的编译器构建的板条箱。 As of 2019, there is no plan to stabilize the ABI. 截至2019年,没有计划稳定ABI。

You must compile the entire project using a nightly compiler which you can do using rustup . 您必须使用每晚编译器编译整个项目,而您可以使用rustup进行编译

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何 select 用于 Rust 货物依赖模块的 C/C++ 编译器 - How to select a C/C++ compiler for a Rust Cargo dependency module 如何构建Rust编译器以使用LLVM的自定义派生? - How to build the Rust compiler to use a custom fork of LLVM? 如何在 Rust 的 cargo build 中指定 GLIBC 版本? - How can I specify the GLIBC version in cargo build for Rust? 为 MSVC 工具链的 Rust 构建提供编译器标志 - Providing compiler flags to Rust build for the MSVC toolchain 在构建期间将符号值传递给 Rust 编译器 - Passing symbol values to the Rust compiler during build 如何在Rust中动态构建具有不同数量参数的函数调用? - How to dynamically build function calls with different numbers of arguments in Rust? Polkadot 如何在具有特定 Substrate 版本的平行链项目中使用/修改 Frontier - Rust 依赖管理 - Polkadot how to use/modify Frontier in a parachain project with certain Substrate version - Rust Dependency management 有没有办法从 Rust 程序中检测编译器版本? - Is there a way to detect the compiler version from within a Rust program? 代码和功能取决于 Rust 版本或特定编译器功能 - Code and feature conditional on Rust version or specific compiler feature "'nightly' vs 'stable' Rust 或编译器版本的条件编译" - Conditional compilation for 'nightly' vs 'stable' Rust or compiler version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM