1- # ` env `
1+ # ` env-set `
22
33The tracking issue for this feature is: [ #118372 ] ( https://github.com/rust-lang/rust/issues/118372 ) .
44
@@ -11,11 +11,11 @@ from the `proc_macro` crate.
1111This information will be stored in the dep-info files. For more information about
1212dep-info files, take a look [ here] ( https://doc.rust-lang.org/cargo/guide/build-cache.html#dep-info-files ) .
1313
14- When retrieving an environment variable value, the one specified by ` --env ` will take
14+ When retrieving an environment variable value, the one specified by ` --env-set ` will take
1515precedence. For example, if you want have ` PATH=a ` in your environment and pass:
1616
1717``` bash
18- rustc --env PATH=env
18+ rustc --env-set PATH=env
1919```
2020
2121Then you will have:
@@ -24,22 +24,22 @@ Then you will have:
2424assert_eq!(env!("PATH"), "env");
2525```
2626
27- It will trigger a new compilation if any of the ` --env ` argument value is different.
27+ It will trigger a new compilation if any of the ` --env-set ` argument value is different.
2828So if you first passed:
2929
3030``` bash
31- --env A=B --env X=12
31+ --env-set A=B --env X=12
3232```
3333
3434and then on next compilation:
3535
3636``` bash
37- --env A=B
37+ --env-set A=B
3838```
3939
4040` X ` value is different (not set) so the code will be re-compiled.
4141
4242Please note that on Windows, environment variables are case insensitive but case
4343preserving whereas ` rustc ` 's environment variables are case sensitive. For example,
4444having ` Path ` in your environment (case insensitive) is different than using
45- ` rustc --env Path=... ` (case sensitive).
45+ ` rustc --env-set Path=... ` (case sensitive).
0 commit comments