-error[E0277]: the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied in `impl std::ops::Fn<(i32,)>`
- --> $DIR/auto-trait-leak.rs:25:5
+error[E0391]: cycle detected when computing type of `cycle1::{opaque#0}`
+ --> $DIR/auto-trait-leak.rs:12:16
|
-LL | send(before());
- | ^^^^ `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
- |
- = help: within `impl std::ops::Fn<(i32,)>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::Cell<i32>>`
- = note: required because it appears within the type `[closure@$DIR/auto-trait-leak.rs:19:5: 19:22 p:std::rc::Rc<std::cell::Cell<i32>>]`
- = note: required because it appears within the type `impl std::ops::Fn<(i32,)>`
-note: required by `send`
- --> $DIR/auto-trait-leak.rs:22:1
- |
-LL | fn send<T: Send>(_: T) {}
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied in `impl std::ops::Fn<(i32,)>`
- --> $DIR/auto-trait-leak.rs:28:5
+LL | fn cycle1() -> impl Clone {
+ | ^^^^^^^^^^
|
-LL | send(after());
- | ^^^^ `std::rc::Rc<std::cell::Cell<i32>>` cannot be sent between threads safely
+note: ...which requires borrow-checking `cycle1`...
+ --> $DIR/auto-trait-leak.rs:12:1
|
- = help: within `impl std::ops::Fn<(i32,)>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::Cell<i32>>`
- = note: required because it appears within the type `[closure@$DIR/auto-trait-leak.rs:36:5: 36:22 p:std::rc::Rc<std::cell::Cell<i32>>]`
- = note: required because it appears within the type `impl std::ops::Fn<(i32,)>`
-note: required by `send`
- --> $DIR/auto-trait-leak.rs:22:1
+LL | fn cycle1() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing `cycle1`...
+ --> $DIR/auto-trait-leak.rs:12:1
|
-LL | fn send<T: Send>(_: T) {}
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0391]: cyclic dependency detected
- --> $DIR/auto-trait-leak.rs:42:1
+LL | fn cycle1() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing MIR for `cycle1`...
+ --> $DIR/auto-trait-leak.rs:12:1
|
LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic reference
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires unsafety-checking `cycle1`...
+ --> $DIR/auto-trait-leak.rs:12:1
|
-note: the cycle begins when processing `cycle1`...
- --> $DIR/auto-trait-leak.rs:42:1
+LL | fn cycle1() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires building MIR for `cycle1`...
+ --> $DIR/auto-trait-leak.rs:12:1
|
LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which then requires processing `cycle2::{{impl-Trait}}`...
- --> $DIR/auto-trait-leak.rs:50:16
+note: ...which requires type-checking `cycle1`...
+ --> $DIR/auto-trait-leak.rs:14:5
+ |
+LL | send(cycle2().clone());
+ | ^^^^
+ = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`...
+note: ...which requires computing type of `cycle2::{opaque#0}`...
+ --> $DIR/auto-trait-leak.rs:19:16
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^
-note: ...which then requires processing `cycle2`...
- --> $DIR/auto-trait-leak.rs:50:1
+note: ...which requires borrow-checking `cycle2`...
+ --> $DIR/auto-trait-leak.rs:19:1
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which then requires processing `cycle1::{{impl-Trait}}`...
- --> $DIR/auto-trait-leak.rs:42:16
+note: ...which requires processing `cycle2`...
+ --> $DIR/auto-trait-leak.rs:19:1
|
-LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^
- = note: ...which then again requires processing `cycle1`, completing the cycle.
+LL | fn cycle2() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing MIR for `cycle2`...
+ --> $DIR/auto-trait-leak.rs:19:1
+ |
+LL | fn cycle2() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires unsafety-checking `cycle2`...
+ --> $DIR/auto-trait-leak.rs:19:1
+ |
+LL | fn cycle2() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires building MIR for `cycle2`...
+ --> $DIR/auto-trait-leak.rs:19:1
+ |
+LL | fn cycle2() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires type-checking `cycle2`...
+ --> $DIR/auto-trait-leak.rs:20:5
+ |
+LL | send(cycle1().clone());
+ | ^^^^
+ = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`...
+ = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in top-level module
+ --> $DIR/auto-trait-leak.rs:1:1
+ |
+LL | / use std::cell::Cell;
+LL | | use std::rc::Rc;
+LL | |
+LL | | fn send<T: Send>(_: T) {}
+... |
+LL | | Rc::new(String::from("foo"))
+LL | | }
+ | |_^
-error: aborting due to 3 previous errors
+error: aborting due to previous error
-Some errors occurred: E0277, E0391.
-For more information about an error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0391`.