1
Fork 0
rust/compiler/rustc_builtin_macros/src
bors d86d65bbc1 Auto merge of #118368 - GuillaumeGomez:env-flag, r=Nilstrieb
Implement `--env` compiler flag (without `tracked_env` support)

Part of https://github.com/rust-lang/rust/issues/80792.
Implementation of https://github.com/rust-lang/compiler-team/issues/653.
Not an implementation of https://github.com/rust-lang/rfcs/pull/2794.

It adds the `--env` compiler flag option which allows to set environment values used by `env!` and `option_env!`.

Important to note: When trying to retrieve an environment variable value, it will first look into the ones defined with `--env`, and if there isn't one, then only it will look into the environment variables. So if you use `--env PATH=a`, then `env!("PATH")` will return `"a"` and not the actual `PATH` value.

As mentioned in the title, `tracked_env` support is not added here. I'll do it in a follow-up PR.

r? rust-lang/compiler
2023-12-10 21:48:53 +00:00
..
assert Add gen blocks to ast and do some broken ast lowering 2023-10-27 13:05:48 +00:00
deriving Parse a pattern with no arm 2023-12-03 12:25:46 +01:00
format_foreign Use as_deref in compiler (but only where it makes sense) 2022-11-16 21:58:58 +00:00
alloc_error_handler.rs Use Session::diagnostic in more places. 2023-12-02 09:01:35 +11:00
asm.rs inline format!() args up to and including rustc_middle 2023-07-30 13:18:33 +02:00
assert.rs Don't escape_debug the condition of assert!. 2023-10-10 09:08:11 +11:00
cfg.rs rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
cfg_accessible.rs Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
cfg_eval.rs Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
cmdline_attrs.rs Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
compile_error.rs Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
concat.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
concat_bytes.rs Auto merge of #117472 - jmillikin:stable-c-str-literals, r=Nilstrieb 2023-12-01 13:33:55 +00:00
concat_idents.rs refactor: use by-ref TokenTree iterator to avoid a few clones 2023-05-11 21:59:38 -05:00
derive.rs Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
edition_panic.rs Remove MacDelimiter. 2023-08-03 09:03:30 +10:00
env.rs Implement --env compiler flag 2023-12-10 14:25:57 +01:00
errors.rs De-genericize some IntoDiagnostic impls. 2023-12-04 18:57:42 +11:00
format.rs unwrap return Option value, as it always returns Some for some fns 2023-11-28 14:52:21 +03:00
format_foreign.rs unwrap return Option value, as it always returns Some for some fns 2023-11-28 14:52:21 +03:00
global_allocator.rs Use Session::diagnostic in more places. 2023-12-02 09:01:35 +11:00
lib.rs Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
log_syntax.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
proc_macro_harness.rs rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
source_util.rs remove redundant imports 2023-12-10 10:56:22 +08:00
standard_library_imports.rs rustc: Move features from Session to GlobalCtxt 2023-08-11 16:51:50 +08:00
test.rs Rename some more coro_kind -> coroutine_kind 2023-12-08 21:46:40 +00:00
test_harness.rs remove redundant imports 2023-12-10 10:56:22 +08:00
trace_macros.rs Migrate some rustc_builtin_macros to SessionDiagnostic 2023-06-25 01:32:30 +08:00
type_ascribe.rs Add unstable type_ascribe macro 2022-11-19 22:16:42 +01:00
util.rs Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00