You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
explanation:"rustc reported a backend diagnostic whose generated Rust location could not be mapped back to RSScript source. The compiler should surface the generated Rust reference as secondary internal detail instead of exposing raw rustc output as the primary diagnostic.",
456
457
},
458
+
DiagnosticExplanation{
459
+
code: code::RUNTIME_DIAGNOSTIC,
460
+
title:"runtime diagnostic",
461
+
explanation:"The RSScript runtime reported a managed aliasing or resource conflict with an RSScript source span. Runtime diagnostics should be surfaced as RSScript diagnostics instead of raw Rust panics.",
let stderr = r#"thread 'main' panicked at runtime/src/lib.rs:1:1:
1085
+
RSSCRIPT_RUNTIME_DIAGNOSTIC:{"code":"RS1201","severity":"error","summary":"RSScript runtime error: resource pool has no available resources","file":"pool.rss","line":8,"column":10,"length":24,"label":"resource pool has no available resources","kind":"resource_pool_empty"}
1086
+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace"#;
1087
+
1088
+
let diagnostics = parse_runtime_diagnostics(stderr);
1089
+
1090
+
assert_eq!(diagnostics.len(),1);
1091
+
assert_eq!(diagnostics[0].code,"RS1201");
1092
+
assert_eq!(
1093
+
diagnostics[0].summary,
1094
+
"RSScript runtime error: resource pool has no available resources"
1095
+
);
1096
+
assert_eq!(diagnostics[0].span.file,"pool.rss");
1097
+
assert_eq!(diagnostics[0].span.line,8);
1098
+
assert!(
1099
+
diagnostics[0]
1100
+
.causes
1101
+
.iter()
1102
+
.any(|cause| cause == "runtime error kind: resource_pool_empty")
0 commit comments