diff --git a/Cargo.toml b/Cargo.toml index 23a36e14d..478b2c9cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -233,6 +233,8 @@ unused_trait_names = "warn" # In the future, they might change to flag other methods of printing. print_stdout = "deny" print_stderr = "deny" +# usage in tests is fine since it avoids interacting with TopicMonitor +# and is configured in clippy.toml with `allow-print-in-tests` [lints] workspace = true diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 000000000..40b1dda5b --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +allow-print-in-tests = true diff --git a/src/threads/threads.rs b/src/threads/threads.rs index 897d0004b..095958556 100644 --- a/src/threads/threads.rs +++ b/src/threads/threads.rs @@ -458,7 +458,7 @@ struct Context { let made = spawn(move || { ctx2.val.fetch_add(2, Ordering::Release); ctx2.condvar.notify_one(); - printf!("condvar signalled\n"); + println!("condvar signalled"); }); assert!(made); @@ -466,9 +466,9 @@ struct Context { let (_lock, timeout) = ctx .condvar .wait_timeout_while(lock, Duration::from_secs(5), |()| { - printf!("looping with lock held\n"); + println!("looping with lock held"); if ctx.val.load(Ordering::Acquire) != 5 { - printf!("test_pthread: value did not yet reach goal\n"); + println!("test_pthread: value did not yet reach goal"); return true; } false