File tree Expand file tree Collapse file tree 6 files changed +272
-52
lines changed
crates/rustc_codegen_spirv Expand file tree Collapse file tree 6 files changed +272
-52
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,18 @@ clippy_no_features examples/shaders/simplest-shader
4848# but basically we're implementing a custom "lint" to ban `std::env` usage,
4949# which could be disastrous because env vars access can't be tracked by
5050# `rustc`, unlike its CLI flags (which are integrated with incremental).
51+ # NOTE(LegNeato)
5152if (
52- egrep -r ' ::\s*env|env\s*::' crates/rustc_codegen_spirv/src/ |
53+ egrep -r ' ::\s*env|env\s*::' crates/rustc_codegen_spirv/src |
5354 # HACK(eddyb) exclude the one place in `rustc_codegen_spirv`
5455 # needing access to an env var (only for codegen args `--help`).
55- egrep -v ' ^crates/rustc_codegen_spirv/src/codegen_cx/mod.rs: let help_flag_comes_from_spirv_builder_env_var = std::env::var\(spirv_builder_env_var\)$'
56+ egrep -v ' ^crates/rustc_codegen_spirv/src/codegen_cx/mod.rs: let help_flag_comes_from_spirv_builder_env_var = std::env::var\(spirv_builder_env_var\)$' |
57+ # HACK(LegNeato) exclude logging. This mirrors `rustc` (`RUSTC_LOG`) and
58+ # `rustdoc` (`RUSTDOC_LOG`).
59+ # There is not a risk of this blowing up as it does not change the build settings.
60+ egrep -v ' ^crates/rustc_codegen_spirv/src/lib.rs:.*(RUSTGPU_LOG|RUSTGPU_LOG_FORMAT|RUSTGPU_LOG_COLOR).*$' |
61+ egrep -v ' ^crates/rustc_codegen_spirv/src/lib.rs: use std::env::{self, VarError};$'
62+
5663); then
5764 echo ' ^^^'
5865 echo ' !!! Found disallowed `std::env` usage in `rustc_codegen_spirv` !!!'
You can’t perform that action at this time.
0 commit comments