This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -220,16 +220,17 @@ fn compile_time_sysroot() -> Option<String> {
220
220
let toolchain = option_env ! ( "RUSTUP_TOOLCHAIN" ) . or ( option_env ! ( "MULTIRUST_TOOLCHAIN" ) ) ;
221
221
Some ( match ( home, toolchain) {
222
222
( Some ( home) , Some ( toolchain) ) => {
223
- // Check that at runtime, we are still in this toolchain.
224
- let toolchain_runtime =
225
- env:: var_os ( "RUSTUP_TOOLCHAIN" ) . or_else ( || env:: var_os ( "MULTIRUST_TOOLCHAIN" ) ) ;
226
- if !matches ! ( toolchain_runtime, Some ( r) if r == toolchain) {
227
- show_error ( format ! (
228
- "This Miri got built with local toolchain `{toolchain}`, but now is being run under a different toolchain. \n \
223
+ // Check that at runtime, we are still in this toolchain (if there is any toolchain).
224
+ if let Some ( toolchain_runtime) =
225
+ env:: var_os ( "RUSTUP_TOOLCHAIN" ) . or_else ( || env:: var_os ( "MULTIRUST_TOOLCHAIN" ) )
226
+ {
227
+ if toolchain_runtime != toolchain {
228
+ show_error ( format ! (
229
+ "This Miri got built with local toolchain `{toolchain}`, but now is being run under a different toolchain. \n \
229
230
Make sure to run Miri in the toolchain it got built with, e.g. via `cargo +{toolchain} miri`."
230
- ) ) ;
231
+ ) ) ;
232
+ }
231
233
}
232
-
233
234
format ! ( "{}/toolchains/{}" , home, toolchain)
234
235
}
235
236
_ => option_env ! ( "RUST_SYSROOT" )
You can’t perform that action at this time.
0 commit comments