From 4ae93acc28efc12a4f1b94e32fe8beae13d56133 Mon Sep 17 00:00:00 2001 From: Simon Sellar Date: Wed, 21 Jun 2023 14:08:10 +0930 Subject: [PATCH] Updated compile-fail tests to match latest stderr output. --- .../compile-fail/no-leaking-poll-items.stderr | 1 + .../compile-fail/socket-thread-unsafe.stderr | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/compile-fail/no-leaking-poll-items.stderr b/tests/compile-fail/no-leaking-poll-items.stderr index 6a1692a7..b4497507 100644 --- a/tests/compile-fail/no-leaking-poll-items.stderr +++ b/tests/compile-fail/no-leaking-poll-items.stderr @@ -4,6 +4,7 @@ error[E0597]: `socket` does not live long enough 3 | let _poll_item = { | ---------- borrow later stored here 4 | let socket = context.socket(zmq::PAIR).unwrap(); + | ------ binding `socket` declared here 5 | socket.as_poll_item(zmq::POLLIN) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough 6 | }; //~^ ERROR `socket` does not live long enough [E0597] diff --git a/tests/compile-fail/socket-thread-unsafe.stderr b/tests/compile-fail/socket-thread-unsafe.stderr index 9f5982b9..bdf55285 100644 --- a/tests/compile-fail/socket-thread-unsafe.stderr +++ b/tests/compile-fail/socket-thread-unsafe.stderr @@ -1,18 +1,21 @@ error[E0277]: `*mut c_void` cannot be shared between threads safely - --> tests/compile-fail/socket-thread-unsafe.rs:13:13 + --> tests/compile-fail/socket-thread-unsafe.rs:13:27 | -13 | let t = thread::spawn(move || { - | ^^^^^^^^^^^^^ `*mut c_void` cannot be shared between threads safely +13 | let t = thread::spawn(move || { + | _____________-------------_^ + | | | + | | required by a bound introduced by this call +14 | | t!(s.bind("tcp://127.0.0.1:12345")) +15 | | }); + | |_____^ `*mut c_void` cannot be shared between threads safely | = help: within `Socket`, the trait `Sync` is not implemented for `*mut c_void` = note: required because it appears within the type `Socket` - = note: required because of the requirements on the impl of `Send` for `&Socket` + = note: required for `&Socket` to implement `Send` note: required because it's used within this closure --> tests/compile-fail/socket-thread-unsafe.rs:13:27 | -13 | let t = thread::spawn(move || { - | ___________________________^ -14 | | t!(s.bind("tcp://127.0.0.1:12345")) -15 | | }); - | |_____^ +13 | let t = thread::spawn(move || { + | ^^^^^^^ note: required by a bound in `spawn` + --> $RUST/std/src/thread/mod.rs