File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -285,8 +285,9 @@ environment variable. We first document the most relevant and most commonly used
285285 harness](https://github.com/rust-lang/miri/issues/1702). This has no effect unless
286286 ` -Zmiri-disable-isolation` is also set.
287287* `-Zmiri-env-forward=<var>` forwards the `var` environment variable to the interpreted program. Can
288- be used multiple times to forward several variables. This has no effect if
289- ` -Zmiri-disable-isolation` is set.
288+ be used multiple times to forward several variables. This takes precedence over
289+ `-Zmiri-env-exclude` : if a variable is both forwarded and exluced, it *will* get forwarded. This
290+ means in particular `-Zmiri-env-forward=TERM` overwrites the default exclusion of `TERM`.
290291* `-Zmiri-ignore-leaks` disables the memory leak checker, and also allows some
291292 remaining threads to exist when the main thread exits.
292293* `-Zmiri-permissive-provenance` disables the warning for integer-to-pointer casts and
Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ impl<'tcx> EnvVars<'tcx> {
5050 // Skip the loop entirely if we don't want to forward anything.
5151 if ecx. machine . communicate ( ) || !config. forwarded_env_vars . is_empty ( ) {
5252 for ( name, value) in env:: vars_os ( ) {
53- let forward = match ecx . machine . communicate ( ) {
54- true => !excluded_env_vars . iter ( ) . any ( |v| * * v == name) ,
55- false => config . forwarded_env_vars . iter ( ) . any ( |v| * * v == name ) ,
56- } ;
53+ // Always forward what is in `forwarded_env_vars`; that list can take precedence over excluded_env_vars.
54+ let forward = config . forwarded_env_vars . iter ( ) . any ( |v| * * v == name)
55+ || ( ecx . machine . communicate ( )
56+ && !excluded_env_vars . iter ( ) . any ( |v| * * v == name ) ) ;
5757 if forward {
5858 let var_ptr = match target_os {
5959 target if target_os_is_unix ( target) =>
You can’t perform that action at this time.
0 commit comments