fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.7 KiB37 linesraw
1error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely
2  --> $DIR/kindck-send-object1.rs:10:5
3   |
4LL | fn assert_send<T:Send+'static>() { }
5   |    -----------   ---- required by this bound in `assert_send`
6...
7LL |     assert_send::<&'a dyn Dummy>();
8   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely
9   |
10   = help: the trait `std::marker::Sync` is not implemented for `(dyn Dummy + 'a)`
11   = note: required because of the requirements on the impl of `std::marker::Send` for `&'a (dyn Dummy + 'a)`
12
13error[E0477]: the type `&'a (dyn Dummy + std::marker::Sync + 'a)` does not fulfill the required lifetime
14  --> $DIR/kindck-send-object1.rs:14:5
15   |
16LL |     assert_send::<&'a (dyn Dummy + Sync)>();
17   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18   |
19   = note: type must satisfy the static lifetime
20
21error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely
22  --> $DIR/kindck-send-object1.rs:29:5
23   |
24LL | fn assert_send<T:Send+'static>() { }
25   |    -----------   ---- required by this bound in `assert_send`
26...
27LL |     assert_send::<Box<dyn Dummy + 'a>>();
28   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely
29   |
30   = help: the trait `std::marker::Send` is not implemented for `(dyn Dummy + 'a)`
31   = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<(dyn Dummy + 'a)>`
32   = note: required because it appears within the type `std::boxed::Box<(dyn Dummy + 'a)>`
33
34error: aborting due to 3 previous errors
35
36Some errors have detailed explanations: E0277, E0477.
37For more information about an error, try `rustc --explain E0277`.