env: more precise error

This commit is contained in:
Ralf Jung 2020-03-27 12:35:08 +01:00 committed by GitHub
parent 813d76d948
commit 07f7083409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ impl<'tcx> EnvVars<'tcx> {
let var_ptr = match target_os {
"linux" | "macos" => alloc_env_var_as_c_str(name.as_ref(), value.as_ref(), ecx)?,
"windows" => alloc_env_var_as_wide_str(name.as_ref(), value.as_ref(), ecx)?,
unsupported => throw_unsup_format!("OsString support for target OS `{}` not yet available", unsupported),
unsupported => throw_unsup_format!("environment support for target OS `{}` not yet available", unsupported),
};
ecx.machine.env_vars.map.insert(OsString::from(name), var_ptr);
}