fork/rust

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

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

1.42.0
4.2 KiB125 linesraw
1error[E0391]: cycle detected when processing `cycle1::{{opaque}}#0`
2  --> $DIR/auto-trait-leak.rs:12:16
3   |
4LL | fn cycle1() -> impl Clone {
5   |                ^^^^^^^^^^
6   |
7note: ...which requires processing `cycle1`...
8  --> $DIR/auto-trait-leak.rs:12:1
9   |
10LL | fn cycle1() -> impl Clone {
11   | ^^^^^^^^^^^^^^^^^^^^^^^^^
12   = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
13note: ...which requires processing `cycle2::{{opaque}}#0`...
14  --> $DIR/auto-trait-leak.rs:22:16
15   |
16LL | fn cycle2() -> impl Clone {
17   |                ^^^^^^^^^^
18note: ...which requires processing `cycle2`...
19  --> $DIR/auto-trait-leak.rs:22:1
20   |
21LL | 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::{{opaque}}#0`, completing the cycle
25note: cycle used when checking item types in top-level module
26  --> $DIR/auto-trait-leak.rs:1:1
27   |
28LL | / use std::cell::Cell;
29LL | | use std::rc::Rc;
30LL | |
31LL | | fn send<T: Send>(_: T) {}
32...  |
33LL | |     Rc::new(String::from("foo"))
34LL | | }
35   | |_^
36
37error[E0391]: cycle detected when processing `cycle1::{{opaque}}#0`
38  --> $DIR/auto-trait-leak.rs:12:16
39   |
40LL | fn cycle1() -> impl Clone {
41   |                ^^^^^^^^^^
42   |
43note: ...which requires processing `cycle1`...
44  --> $DIR/auto-trait-leak.rs:12:1
45   |
46LL | fn cycle1() -> impl Clone {
47   | ^^^^^^^^^^^^^^^^^^^^^^^^^
48   = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
49note: ...which requires processing `cycle2::{{opaque}}#0`...
50  --> $DIR/auto-trait-leak.rs:22:16
51   |
52LL | fn cycle2() -> impl Clone {
53   |                ^^^^^^^^^^
54note: ...which requires processing `cycle2`...
55  --> $DIR/auto-trait-leak.rs:22:1
56   |
57LL | fn cycle2() -> impl Clone {
58   | ^^^^^^^^^^^^^^^^^^^^^^^^^
59   = note: ...which again requires processing `cycle1::{{opaque}}#0`, completing the cycle
60note: cycle used when checking item types in top-level module
61  --> $DIR/auto-trait-leak.rs:1:1
62   |
63LL | / use std::cell::Cell;
64LL | | use std::rc::Rc;
65LL | |
66LL | | fn send<T: Send>(_: T) {}
67...  |
68LL | |     Rc::new(String::from("foo"))
69LL | | }
70   | |_^
71
72error[E0391]: cycle detected when processing `cycle1::{{opaque}}#0`
73  --> $DIR/auto-trait-leak.rs:12:16
74   |
75LL | fn cycle1() -> impl Clone {
76   |                ^^^^^^^^^^
77   |
78note: ...which requires processing `cycle1`...
79  --> $DIR/auto-trait-leak.rs:12:1
80   |
81LL | fn cycle1() -> impl Clone {
82   | ^^^^^^^^^^^^^^^^^^^^^^^^^
83   = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
84note: ...which requires processing `cycle2::{{opaque}}#0`...
85  --> $DIR/auto-trait-leak.rs:22:16
86   |
87LL | fn cycle2() -> impl Clone {
88   |                ^^^^^^^^^^
89note: ...which requires processing `cycle2`...
90  --> $DIR/auto-trait-leak.rs:22:1
91   |
92LL | fn cycle2() -> impl Clone {
93   | ^^^^^^^^^^^^^^^^^^^^^^^^^
94   = note: ...which again requires processing `cycle1::{{opaque}}#0`, completing the cycle
95note: cycle used when checking item types in top-level module
96  --> $DIR/auto-trait-leak.rs:1:1
97   |
98LL | / use std::cell::Cell;
99LL | | use std::rc::Rc;
100LL | |
101LL | | fn send<T: Send>(_: T) {}
102...  |
103LL | |     Rc::new(String::from("foo"))
104LL | | }
105   | |_^
106
107error[E0277]: `std::rc::Rc<std::string::String>` cannot be sent between threads safely
108  --> $DIR/auto-trait-leak.rs:16:5
109   |
110LL | fn send<T: Send>(_: T) {}
111   |    ----    ---- required by this bound in `send`
112...
113LL |     send(cycle2().clone());
114   |     ^^^^ `std::rc::Rc<std::string::String>` cannot be sent between threads safely
115...
116LL | fn cycle2() -> impl Clone {
117   |                ---------- within this `impl std::clone::Clone`
118   |
119   = help: within `impl std::clone::Clone`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::string::String>`
120   = note: required because it appears within the type `impl std::clone::Clone`
121
122error: aborting due to 4 previous errors
123
124Some errors have detailed explanations: E0277, E0391.
125For more information about an error, try `rustc --explain E0277`.