-
Notifications
You must be signed in to change notification settings - Fork 13.4k
avoid duplicating the RUSTC_LOG env var name #107839
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Hm, this breaks a doctest rust/compiler/rustc_log/src/lib.rs Lines 8 to 24 in 569c2fe
But real tools call |
Cc @dtolnay who added this doctest about a year ago. |
yea, we should just change that doctest. |
To do what? Not importing rustc_driver is the entire point of that test. We could also just have a constant in rustc_log with the env var name, and avoid the duplication that way. |
just calling |
This comment has been minimized.
This comment has been minimized.
All right, done. (The use of set_var is concerning given the plans to make that function unsafe. IMO we should have a function that you give the value of the env var, i.e. the log filter description. Then we could also remove some |
@bors r+ rollup |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#107789 (Avoid exposing type parameters and implementation details sourced from macro expansions) - rust-lang#107836 (Handle properly when there is no crate attrs) - rust-lang#107839 (avoid duplicating the RUSTC_LOG env var name) - rust-lang#107866 (Allow wasi-libc to initialize its environment variables lazily.) - rust-lang#107876 (create symlink only for non-windows operating systems) - rust-lang#107882 (Cleanup typos in en_US/borrowck.ftl) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
We also have the env var name here:
rust/compiler/rustc_driver_impl/src/lib.rs
Lines 1247 to 1251 in c40919b
Redundantly having this name twice doesn't seem great. Looks like
rustc_log::init_rustc_env_logger
is dead code anyway.r? @oli-obk