Is there any way to get unstable features on the compiler versions in stable or beta?

…衆ロ難τιáo~ 提交于 2021-02-04 19:34:05

问题


I'm in a bit of a bind right now. My personal code relies on rand, which is currently not compiling on Nightly 1.7, but does work on Beta 1.6 and stable.

However, my work also uses unstable features such as box syntax/patterns/raw and convert in a way that can't (easily) be refactored out. Is there any way, including by compiling from source, to get Rust 1.6 "as if" it were a nightly? I'm on Windows (10)/MSYS 2 if that complicates things any, such as building the source.


回答1:


You cannot (trivially) compile any stable version of Rust to use unstable features. Nor can you download the stable version as if it were unstable. However, Rust's downloads has a set of archives.

By checking when the most recent release happened:

I could figure out what day the current Beta was technically a Nightly. Now, presuming there wasn't a major bugfix between the previous Nightly and Beta releases of 1.6, I went to the folder (in this case, December 9, 2015) and downloaded the corresponding Nightly installer from the list.

There are folders going back to 2014-11-07, so if you need a specific version of Rust from the past to compile your code, you can likely find it there.



来源:https://stackoverflow.com/questions/34430429/is-there-any-way-to-get-unstable-features-on-the-compiler-versions-in-stable-or

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!