Skip to content

Commit 8592488

Browse files
committed
fix: resolve final syntax errors in wrt-error crate
- Fix missing closing parentheses in test functions in recovery.rs - Fix compile_error! macro calls missing proper delimiters in macros.rs - Fix core::hint::spin_loop() calls missing parentheses - wrt-error crate now compiles successfully without syntax errors This completes the syntax error fixes that were blocking CI builds.
1 parent 079b93a commit 8592488

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

wrt-error/src/macros.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,31 @@
3030
macro_rules! asil_error {
3131
($category:expr, $code:expr, $message:expr,"asil-d") => {{
3232
#[cfg(not(feature = "asil-d"))]
33-
compile_error!("This error requires ASIL-D safety level";
33+
compile_error!("This error requires ASIL-D safety level");
3434

3535
#[cfg(feature = "asil-d")]
3636
{
37-
let error = $crate::Error::new($category, $code, $message;
37+
let error = $crate::Error::new($category, $code, $message);
3838
// Validate at runtime for ASIL-D
3939
if !error.validate_integrity() {
4040
// ASIL-D: Enter safe state instead of panic
4141
loop {
42-
core::hint::spin_loop);
42+
core::hint::spin_loop();
4343
}
4444
}
4545
error
4646
}
4747
}};
4848
($category:expr, $code:expr, $message:expr,"asil-c") => {{
4949
#[cfg(not(any(feature = "asil-c", feature = "asil-d")))]
50-
compile_error!("This error requires ASIL-C safety level or higher";
50+
compile_error!("This error requires ASIL-C safety level or higher");
5151

5252
#[cfg(any(feature = "asil-c", feature = "asil-d"))]
5353
$crate::Error::new($category, $code, $message)
5454
}};
5555
($category:expr, $code:expr, $message:expr,"asil-b") => {{
5656
#[cfg(not(any(feature = "asil-b", feature = "asil-c", feature = "asil-d")))]
57-
compile_error!("This error requires ASIL-B safety level or higher";
57+
compile_error!("This error requires ASIL-B safety level or higher");
5858

5959
#[cfg(any(feature = "asil-b", feature = "asil-c", feature = "asil-d"))]
6060
$crate::Error::new($category, $code, $message)
@@ -79,7 +79,7 @@ macro_rules! asil_error {
7979
#[macro_export]
8080
macro_rules! monitor_error {
8181
($monitor:expr, $error:expr) => {{
82-
$monitor.record_error(&$error;
82+
$monitor.record_error(&$error);
8383

8484
// ASIL-D: Check if immediate safe state is required
8585
#[cfg(feature = "asil-d")]
@@ -126,7 +126,7 @@ macro_rules! asil_assert {
126126
if !$condition {
127127
// ASIL-D: Enter safe state instead of panic
128128
loop {
129-
core::hint::spin_loop);
129+
core::hint::spin_loop();
130130
}
131131
}
132132
Ok(())
@@ -137,7 +137,7 @@ macro_rules! asil_assert {
137137
if !$condition {
138138
// ASIL-C: Enter safe state for critical assertions
139139
loop {
140-
core::hint::spin_loop);
140+
core::hint::spin_loop();
141141
}
142142
}
143143
Ok(())
@@ -182,7 +182,7 @@ macro_rules! asil_assert {
182182
macro_rules! safety_error {
183183
($code:expr, $message:expr) => {{
184184
#[cfg(not(any(feature = "asil-c", feature = "asil-d")))]
185-
compile_error!("Safety errors require ASIL-C or higher";
185+
compile_error!("Safety errors require ASIL-C or higher");
186186

187187
#[cfg(any(feature = "asil-c", feature = "asil-d"))]
188188
$crate::Error::new($crate::ErrorCategory::Safety, $code, $message)

wrt-error/src/recovery.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -411,31 +411,31 @@ mod tests {
411411
let mut manager = ErrorRecoveryManager::new();
412412

413413
// Test setting and getting strategies
414-
manager.set_strategy(ErrorCategory::Parse, RecoveryStrategy::Skip;
414+
manager.set_strategy(ErrorCategory::Parse, RecoveryStrategy::Skip);
415415
assert_eq!(
416416
manager.get_strategy(&ErrorCategory::Parse),
417417
RecoveryStrategy::Skip
418-
;
418+
);
419419

420420
// Test error recording
421-
let error = Error::new(ErrorCategory::Parse, codes::PARSE_ERROR, "Test error";
422-
let context = ErrorContext::new("test_location";
423-
manager.record_error(error, context;
421+
let error = Error::new(ErrorCategory::Parse, codes::PARSE_ERROR, "Test error");
422+
let context = ErrorContext::new("test_location");
423+
manager.record_error(error, context);
424424

425-
assert_eq!(manager.error_history.len(), 1;
425+
assert_eq!(manager.error_history.len(), 1);
426426
}
427427

428428
#[test]
429429
fn test_error_context() {
430430
let context = ErrorContext::new("test_function")
431431
.with_context("param", "value")
432432
.with_stack_frame("frame1")
433-
.with_recovery(RecoveryStrategy::Skip;
433+
.with_recovery(RecoveryStrategy::Skip);
434434

435-
assert_eq!(context.location, "test_function";
436-
assert_eq!(context.context.get("param"), Some(&"value".to_string();
437-
assert_eq!(context.stack_trace.len(), 1;
438-
assert_eq!(context.recovery_strategy, RecoveryStrategy::Skip;
435+
assert_eq!(context.location, "test_function");
436+
assert_eq!(context.context.get("param"), Some(&"value".to_string()));
437+
assert_eq!(context.stack_trace.len(), 1);
438+
assert_eq!(context.recovery_strategy, RecoveryStrategy::Skip);
439439
}
440440

441441
#[test]
@@ -444,16 +444,16 @@ mod tests {
444444

445445
// Add multiple errors
446446
for i in 0..5 {
447-
let error = Error::new(ErrorCategory::Parse, codes::PARSE_ERROR, "Test error";
448-
let context = ErrorContext::new(format!("location_{}", i % 2;
449-
manager.record_error(error, context;
447+
let error = Error::new(ErrorCategory::Parse, codes::PARSE_ERROR, "Test error");
448+
let context = ErrorContext::new(format!("location_{}", i % 2));
449+
manager.record_error(error, context);
450450
}
451451

452-
let analysis = manager.analyze_patterns);
453-
assert_eq!(analysis.total_errors, 5;
452+
let analysis = manager.analyze_patterns();
453+
assert_eq!(analysis.total_errors, 5);
454454
assert_eq!(
455455
analysis.category_counts.get(&ErrorCategory::Parse),
456456
Some(&5)
457-
;
457+
);
458458
}
459459
}

0 commit comments

Comments
 (0)