MCPcopy Create free account
hub / github.com/argumentcomputer/ix / reset_clears_thread_local_state

Function reset_clears_thread_local_state

crates/kernel/src/tc.rs:1547–1569  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1545 match tc.tick() {
1546 Err(TcError::MaxRecFuel) => {},
1547 other => panic!("expected MaxRecFuel at zero fuel, got {other:?}"),
1548 }
1549 }
1550
1551 // ---- with_infer_only ----
1552
1553 #[test]
1554 fn with_infer_only_scoping() {
1555 let mut tc = new_tc();
1556 assert!(!tc.infer_only);
1557 let r = tc.with_infer_only(|tc| {
1558 assert!(tc.infer_only);
1559 42
1560 });
1561 assert_eq!(r, 42);
1562 assert!(!tc.infer_only);
1563 }
1564
1565 #[test]
1566 fn with_infer_only_nested_restores() {
1567 let mut tc = new_tc();
1568 tc.infer_only = true;
1569 tc.with_infer_only(|tc| {
1570 assert!(tc.infer_only);
1571 });
1572 assert!(tc.infer_only, "outer infer_only=true must be preserved");

Callers

nothing calls this directly

Calls 6

new_tcFunction · 0.85
push_localMethod · 0.80
push_letMethod · 0.80
resetMethod · 0.80
sort0Function · 0.70
sort1Function · 0.70

Tested by

no test coverage detected