rust/src/test/ui/impl-trait/auto-trait-leak.stderr

106 lines
3.4 KiB
Plaintext
Raw Normal View History

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
|
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 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= 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`...
--> $DIR/auto-trait-leak.rs:20:16
|
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`...
--> $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`...
--> $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 processing MIR for `cycle2`...
--> $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`...
--> $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`...
--> $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`...
--> $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 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= 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
error[E0277]: `Rc<String>` cannot be sent between threads safely
--> $DIR/auto-trait-leak.rs:14:5
2018-07-11 09:01:48 -05:00
|
LL | fn send<T: Send>(_: T) {}
2020-04-06 00:15:06 -05:00
| ---- required by this bound in `send`
...
2018-07-11 09:01:48 -05:00
LL | send(cycle2().clone());
| ^^^^ `Rc<String>` cannot be sent between threads safely
...
LL | fn cycle2() -> impl Clone {
| ---------- within this `impl Clone`
2018-07-11 09:01:48 -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`
error: aborting due to 2 previous errors
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`.