Skip to content

Commit fe72bb3

Browse files
committed
ci skip
1 parent 883b3a1 commit fe72bb3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/nu-protocol/src/engine/engine_state.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,14 @@ impl EngineState {
376376
pub fn cleanup_stack_variables(&self, stack: &mut Stack) {
377377
use std::collections::HashSet;
378378

379-
// Collect all VarIds that are still referenced by overlays using functional style
379+
// Collect all VarIds that are still referenced by overlays
380380
let referenced_vars: HashSet<_> = self
381381
.scope
382382
.overlays
383383
.iter()
384384
.flat_map(|(_, overlay)| overlay.vars.values())
385385
.copied()
386+
// Always preserve critical system variables
386387
.chain([NU_VARIABLE_ID, IN_VARIABLE_ID, ENV_VARIABLE_ID])
387388
.collect();
388389

0 commit comments

Comments
 (0)