]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/auto-trait-leak.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / impl-trait / auto-trait-leak.stderr
1 error[E0391]: cycle detected when processing `cycle1::{{impl-Trait}}`
2   --> $DIR/auto-trait-leak.rs:14:16
3    |
4 LL | fn cycle1() -> impl Clone {
5    |                ^^^^^^^^^^
6    |
7 note: ...which requires processing `cycle1`...
8   --> $DIR/auto-trait-leak.rs:14:1
9    |
10 LL | fn cycle1() -> impl Clone {
11    | ^^^^^^^^^^^^^^^^^^^^^^^^^
12 note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
13 note: ...which requires processing `cycle2::{{impl-Trait}}`...
14   --> $DIR/auto-trait-leak.rs:23:16
15    |
16 LL | fn cycle2() -> impl Clone {
17    |                ^^^^^^^^^^
18 note: ...which requires processing `cycle2`...
19   --> $DIR/auto-trait-leak.rs:23:1
20    |
21 LL | fn cycle2() -> impl Clone {
22    | ^^^^^^^^^^^^^^^^^^^^^^^^^
23 note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
24    = note: ...which again requires processing `cycle1::{{impl-Trait}}`, completing the cycle
25 note: cycle used when checking item types in top-level module
26   --> $DIR/auto-trait-leak.rs:3:1
27    |
28 LL | / use std::cell::Cell;
29 LL | | use std::rc::Rc;
30 LL | |
31 LL | | fn send<T: Send>(_: T) {}
32 ...  |
33 LL | |     Rc::new(String::from("foo"))
34 LL | | }
35    | |_^
36
37 error[E0391]: cycle detected when processing `cycle1::{{impl-Trait}}`
38   --> $DIR/auto-trait-leak.rs:14:16
39    |
40 LL | fn cycle1() -> impl Clone {
41    |                ^^^^^^^^^^
42    |
43 note: ...which requires processing `cycle1`...
44   --> $DIR/auto-trait-leak.rs:14:1
45    |
46 LL | fn cycle1() -> impl Clone {
47    | ^^^^^^^^^^^^^^^^^^^^^^^^^
48 note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
49 note: ...which requires processing `cycle2::{{impl-Trait}}`...
50   --> $DIR/auto-trait-leak.rs:23:16
51    |
52 LL | fn cycle2() -> impl Clone {
53    |                ^^^^^^^^^^
54 note: ...which requires processing `cycle2`...
55   --> $DIR/auto-trait-leak.rs:23:1
56    |
57 LL | fn cycle2() -> impl Clone {
58    | ^^^^^^^^^^^^^^^^^^^^^^^^^
59    = note: ...which again requires processing `cycle1::{{impl-Trait}}`, completing the cycle
60 note: cycle used when checking item types in top-level module
61   --> $DIR/auto-trait-leak.rs:3:1
62    |
63 LL | / use std::cell::Cell;
64 LL | | use std::rc::Rc;
65 LL | |
66 LL | | fn send<T: Send>(_: T) {}
67 ...  |
68 LL | |     Rc::new(String::from("foo"))
69 LL | | }
70    | |_^
71
72 error[E0277]: `std::rc::Rc<std::string::String>` cannot be sent between threads safely
73   --> $DIR/auto-trait-leak.rs:17:5
74    |
75 LL |     send(cycle2().clone());
76    |     ^^^^ `std::rc::Rc<std::string::String>` cannot be sent between threads safely
77    |
78    = help: within `impl std::clone::Clone`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::string::String>`
79    = note: required because it appears within the type `impl std::clone::Clone`
80 note: required by `send`
81   --> $DIR/auto-trait-leak.rs:6:1
82    |
83 LL | fn send<T: Send>(_: T) {}
84    | ^^^^^^^^^^^^^^^^^^^^^^
85
86 error: aborting due to 3 previous errors
87
88 Some errors occurred: E0277, E0391.
89 For more information about an error, try `rustc --explain E0277`.