2020-05-31 10:11:51 -05:00
|
|
|
error[E0391]: cycle detected when computing type of `cycle1::{{opaque}}#0`
|
2019-04-22 11:35:37 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:12:16
|
2018-07-11 09:01:48 -05:00
|
|
|
|
|
|
|
|
LL | fn cycle1() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2019-12-28 09:54:27 -06:00
|
|
|
note: ...which requires borrow-checking `cycle1`...
|
|
|
|
--> $DIR/auto-trait-leak.rs:12:1
|
|
|
|
|
|
|
|
|
LL | fn cycle1() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
note: ...which requires processing `cycle1`...
|
|
|
|
--> $DIR/auto-trait-leak.rs:12:1
|
|
|
|
|
|
|
|
|
LL | fn cycle1() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-31 10:11:51 -05:00
|
|
|
note: ...which requires processing MIR for `cycle1`...
|
2019-04-22 11:35:37 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:12:1
|
2018-01-15 16:26:36 -06:00
|
|
|
|
|
2019-12-28 09:54:27 -06:00
|
|
|
LL | fn cycle1() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
note: ...which requires unsafety-checking `cycle1`...
|
|
|
|
--> $DIR/auto-trait-leak.rs:12:1
|
|
|
|
|
|
|
|
|
LL | fn cycle1() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-31 10:11:51 -05:00
|
|
|
note: ...which requires building MIR for `cycle1`...
|
2019-12-28 09:54:27 -06:00
|
|
|
--> $DIR/auto-trait-leak.rs:12:1
|
|
|
|
|
|
|
|
|
LL | fn cycle1() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
note: ...which requires type-checking `cycle1`...
|
|
|
|
--> $DIR/auto-trait-leak.rs:12:1
|
|
|
|
|
|
2018-05-22 07:31:56 -05:00
|
|
|
LL | fn cycle1() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-11-25 15:05:06 -06:00
|
|
|
= note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
|
2020-05-31 10:11:51 -05:00
|
|
|
note: ...which requires computing type of `cycle2::{{opaque}}#0`...
|
2020-06-04 20:09:31 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:20:16
|
2017-11-26 14:32:30 -06:00
|
|
|
|
|
2018-05-22 07:31:56 -05:00
|
|
|
LL | fn cycle2() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^
|
2019-12-28 09:54:27 -06:00
|
|
|
note: ...which requires borrow-checking `cycle2`...
|
2020-06-04 20:09:31 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:20:1
|
2019-12-28 09:54:27 -06:00
|
|
|
|
|
|
|
|
LL | fn cycle2() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-05-22 07:31:56 -05:00
|
|
|
note: ...which requires processing `cycle2`...
|
2020-06-04 20:09:31 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:20:1
|
2018-01-15 16:26:36 -06:00
|
|
|
|
|
2019-12-28 09:54:27 -06:00
|
|
|
LL | fn cycle2() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-31 10:11:51 -05:00
|
|
|
note: ...which requires processing MIR for `cycle2`...
|
2020-06-04 20:09:31 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:20:1
|
2019-12-28 09:54:27 -06:00
|
|
|
|
|
|
|
|
LL | fn cycle2() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
note: ...which requires unsafety-checking `cycle2`...
|
2020-06-04 20:09:31 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:20:1
|
2019-12-28 09:54:27 -06:00
|
|
|
|
|
|
|
|
LL | fn cycle2() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-31 10:11:51 -05:00
|
|
|
note: ...which requires building MIR for `cycle2`...
|
2020-06-04 20:09:31 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:20:1
|
2019-12-28 09:54:27 -06:00
|
|
|
|
|
|
|
|
LL | fn cycle2() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
note: ...which requires type-checking `cycle2`...
|
2020-06-04 20:09:31 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:20:1
|
2019-12-28 09:54:27 -06:00
|
|
|
|
|
2018-05-22 07:31:56 -05:00
|
|
|
LL | fn cycle2() -> impl Clone {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-11-25 15:05:06 -06:00
|
|
|
= note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
|
2020-05-31 10:11:51 -05:00
|
|
|
= note: ...which again requires computing type of `cycle1::{{opaque}}#0`, completing the cycle
|
2019-01-01 12:08:25 -06:00
|
|
|
note: cycle used when checking item types in top-level module
|
2019-04-22 11:35:37 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:1:1
|
2019-01-01 12:08:25 -06:00
|
|
|
|
|
|
|
|
LL | / use std::cell::Cell;
|
|
|
|
LL | | use std::rc::Rc;
|
|
|
|
LL | |
|
|
|
|
LL | | fn send<T: Send>(_: T) {}
|
|
|
|
... |
|
|
|
|
LL | | Rc::new(String::from("foo"))
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2018-07-11 09:01:48 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0277]: `Rc<String>` cannot be sent between threads safely
|
2020-06-04 20:09:31 -05:00
|
|
|
--> $DIR/auto-trait-leak.rs:14:5
|
2018-07-11 09:01:48 -05:00
|
|
|
|
|
2019-08-24 16:44:43 -05:00
|
|
|
LL | fn send<T: Send>(_: T) {}
|
2020-04-06 00:15:06 -05:00
|
|
|
| ---- required by this bound in `send`
|
2019-08-24 16:44:43 -05:00
|
|
|
...
|
2018-07-11 09:01:48 -05:00
|
|
|
LL | send(cycle2().clone());
|
2020-09-02 02:40:56 -05:00
|
|
|
| ^^^^ `Rc<String>` cannot be sent between threads safely
|
2019-12-16 00:20:30 -06:00
|
|
|
...
|
|
|
|
LL | fn cycle2() -> impl Clone {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---------- within this `impl Clone`
|
2018-07-11 09:01:48 -05:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= help: within `impl Clone`, the trait `Send` is not implemented for `Rc<String>`
|
|
|
|
= note: required because it appears within the type `impl Clone`
|
2017-11-26 14:32:30 -06:00
|
|
|
|
2020-06-04 20:09:31 -05:00
|
|
|
error: aborting due to 2 previous errors
|
2017-11-26 14:32:30 -06:00
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0277, E0391.
|
2018-07-11 09:01:48 -05:00
|
|
|
For more information about an error, try `rustc --explain E0277`.
|