1 error[E0391]: cycle detected when computing type of `cycle1::{opaque#0}`
2 --> $DIR/auto-trait-leak.rs:12:16
4 LL | fn cycle1() -> impl Clone {
7 note: ...which requires borrow-checking `cycle1`...
8 --> $DIR/auto-trait-leak.rs:12:1
10 LL | fn cycle1() -> impl Clone {
11 | ^^^^^^^^^^^^^^^^^^^^^^^^^
12 note: ...which requires processing MIR for `cycle1`...
13 --> $DIR/auto-trait-leak.rs:12:1
15 LL | fn cycle1() -> impl Clone {
16 | ^^^^^^^^^^^^^^^^^^^^^^^^^
17 note: ...which requires preparing `cycle1` for borrow checking...
18 --> $DIR/auto-trait-leak.rs:12:1
20 LL | fn cycle1() -> impl Clone {
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^
22 note: ...which requires unsafety-checking `cycle1`...
23 --> $DIR/auto-trait-leak.rs:12:1
25 LL | fn cycle1() -> impl Clone {
26 | ^^^^^^^^^^^^^^^^^^^^^^^^^
27 note: ...which requires building MIR for `cycle1`...
28 --> $DIR/auto-trait-leak.rs:12:1
30 LL | fn cycle1() -> impl Clone {
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^
32 note: ...which requires building THIR for `cycle1`...
33 --> $DIR/auto-trait-leak.rs:12:1
35 LL | fn cycle1() -> impl Clone {
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^
37 note: ...which requires type-checking `cycle1`...
38 --> $DIR/auto-trait-leak.rs:14:5
40 LL | send(cycle2().clone());
42 = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`...
43 note: ...which requires computing type of `cycle2::{opaque#0}`...
44 --> $DIR/auto-trait-leak.rs:19:16
46 LL | fn cycle2() -> impl Clone {
48 note: ...which requires borrow-checking `cycle2`...
49 --> $DIR/auto-trait-leak.rs:19:1
51 LL | fn cycle2() -> impl Clone {
52 | ^^^^^^^^^^^^^^^^^^^^^^^^^
53 note: ...which requires processing MIR for `cycle2`...
54 --> $DIR/auto-trait-leak.rs:19:1
56 LL | fn cycle2() -> impl Clone {
57 | ^^^^^^^^^^^^^^^^^^^^^^^^^
58 note: ...which requires preparing `cycle2` for borrow checking...
59 --> $DIR/auto-trait-leak.rs:19:1
61 LL | fn cycle2() -> impl Clone {
62 | ^^^^^^^^^^^^^^^^^^^^^^^^^
63 note: ...which requires unsafety-checking `cycle2`...
64 --> $DIR/auto-trait-leak.rs:19:1
66 LL | fn cycle2() -> impl Clone {
67 | ^^^^^^^^^^^^^^^^^^^^^^^^^
68 note: ...which requires building MIR for `cycle2`...
69 --> $DIR/auto-trait-leak.rs:19:1
71 LL | fn cycle2() -> impl Clone {
72 | ^^^^^^^^^^^^^^^^^^^^^^^^^
73 note: ...which requires building THIR for `cycle2`...
74 --> $DIR/auto-trait-leak.rs:19:1
76 LL | fn cycle2() -> impl Clone {
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^
78 note: ...which requires type-checking `cycle2`...
79 --> $DIR/auto-trait-leak.rs:20:5
81 LL | send(cycle1().clone());
83 = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`...
84 = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle
85 note: cycle used when checking item types in top-level module
86 --> $DIR/auto-trait-leak.rs:1:1
88 LL | / use std::cell::Cell;
89 LL | | use std::rc::Rc;
91 LL | | fn send<T: Send>(_: T) {}
93 LL | | Rc::new(String::from("foo"))
97 error: aborting due to previous error
99 For more information about this error, try `rustc --explain E0391`.