Skip to content

Commit 7bf20fe

Browse files
committed
Use unsafe block for setting environment variables in tests and commands
1 parent 4049610 commit 7bf20fe

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎crates/zynml/tests/autovec.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn build(src: &str, dump: &str) -> (f64, usize) {
3131
std::fs::create_dir_all(&dir).unwrap();
3232
// Process-global, and these tests share a process, so each one
3333
// points it at its own directory immediately before compiling.
34-
std::env::set_var("ZYNTAX_DUMP_HIR_DIR", &dir);
34+
unsafe { std::env::set_var("ZYNTAX_DUMP_HIR_DIR", &dir) };
3535

3636
let plugins = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../plugins/target/zrtl");
3737
let cfg = ZynMLConfig {

‎crates/zyntax_cli/src/commands.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ fn eval_input(
10191019
LoweringConfig::default(),
10201020
);
10211021

1022-
std::env::set_var("SKIP_TYPE_CHECK", "1");
1022+
unsafe { std::env::set_var("SKIP_TYPE_CHECK", "1") };
10231023

10241024
let mut hir_module = lowering_ctx
10251025
.lower_program(&mut typed_program)

‎crates/zyntax_cli/src/formats/zyn_grammar.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ fn lower_to_hir(
545545
);
546546

547547
// Skip type checking (parser already produced typed AST)
548-
std::env::set_var("SKIP_TYPE_CHECK", "1");
548+
unsafe { std::env::set_var("SKIP_TYPE_CHECK", "1") };
549549

550550
let mut hir_module = lowering_ctx
551551
.lower_program(&mut program)

0 commit comments

Comments
 (0)