fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.0 KiB41 linesraw
1error[E0277]: `<impl Foo as Foo>::Bar` cannot be sent between threads safely
2  --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:14:20
3   |
4LL |     assert_is_send(&bar);
5   |     -------------- ^^^^ `<impl Foo as Foo>::Bar` cannot be sent between threads safely
6   |     |
7   |     required by a bound introduced by this call
8   |
9   = help: the trait `Send` is not implemented for `<impl Foo as Foo>::Bar`
10note: required by a bound in `assert_is_send`
11  --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:30:22
12   |
13LL | fn assert_is_send<T: Send>(_: &T) {}
14   |                      ^^^^ required by this bound in `assert_is_send`
15help: introduce a type parameter with a trait bound instead of using `impl Trait`
16   |
17LL | async fn run<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
18   |             ++++++++              ~                         +++++++++++++++++++++++++++
19
20error[E0277]: `<impl Foo as Foo>::Bar` cannot be sent between threads safely
21  --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:24:20
22   |
23LL |     assert_is_send(&bar);
24   |     -------------- ^^^^ `<impl Foo as Foo>::Bar` cannot be sent between threads safely
25   |     |
26   |     required by a bound introduced by this call
27   |
28   = help: the trait `Send` is not implemented for `<impl Foo as Foo>::Bar`
29note: required by a bound in `assert_is_send`
30  --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:30:22
31   |
32LL | fn assert_is_send<T: Send>(_: &T) {}
33   |                      ^^^^ required by this bound in `assert_is_send`
34help: introduce a type parameter with a trait bound instead of using `impl Trait`
35   |
36LL | async fn run2<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
37   |              ~~~~~~~~              ~                         +++++++++++++++++++++++++++
38
39error: aborting due to 2 previous errors
40
41For more information about this error, try `rustc --explain E0277`.