rust/src/test/ui/impl-trait/nested_impl_trait.stderr

75 lines
3.3 KiB
Text
Raw Normal View History

2018-02-08 15:40:27 -08:00
error[E0666]: nested `impl Trait` is not allowed
2018-12-25 08:56:47 -07:00
--> $DIR/nested_impl_trait.rs:5:56
2018-02-08 15:40:27 -08:00
|
2018-02-25 02:59:34 +03:00
LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
2018-02-08 15:40:27 -08:00
| ----------^^^^^^^^^^-
| | |
2018-02-13 17:46:33 -08:00
| | nested `impl Trait` here
2018-02-08 15:40:27 -08:00
| outer `impl Trait`
error[E0666]: nested `impl Trait` is not allowed
--> $DIR/nested_impl_trait.rs:9:42
2018-02-08 15:40:27 -08:00
|
2018-02-25 02:59:34 +03:00
LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
2018-02-08 15:40:27 -08:00
| ----------^^^^^^^^^^-
| | |
2018-02-13 17:46:33 -08:00
| | nested `impl Trait` here
2018-02-08 15:40:27 -08:00
| outer `impl Trait`
error[E0666]: nested `impl Trait` is not allowed
--> $DIR/nested_impl_trait.rs:13:37
2018-02-08 15:40:27 -08:00
|
2018-02-25 02:59:34 +03:00
LL | fn bad_in_arg_position(_: impl Into<impl Debug>) { }
2018-02-08 15:40:27 -08:00
| ----------^^^^^^^^^^-
| | |
2018-02-13 17:46:33 -08:00
| | nested `impl Trait` here
2018-02-08 15:40:27 -08:00
| outer `impl Trait`
error[E0666]: nested `impl Trait` is not allowed
--> $DIR/nested_impl_trait.rs:18:44
2018-02-08 15:40:27 -08:00
|
2018-02-25 02:59:34 +03:00
LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
2018-02-08 15:40:27 -08:00
| ----------^^^^^^^^^^-
| | |
2018-02-13 17:46:33 -08:00
| | nested `impl Trait` here
2018-02-08 15:40:27 -08:00
| outer `impl Trait`
error[E0562]: `impl Trait` not allowed outside of function and method return types
--> $DIR/nested_impl_trait.rs:9:32
2018-02-08 15:40:27 -08:00
|
2018-02-25 02:59:34 +03:00
LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
2018-02-08 15:40:27 -08:00
| ^^^^^^^^^^^^^^^^^^^^^
error[E0562]: `impl Trait` not allowed outside of function and method return types
--> $DIR/nested_impl_trait.rs:27:42
2018-02-08 15:40:27 -08:00
|
2018-02-25 02:59:34 +03:00
LL | fn allowed_in_ret_type() -> impl Fn() -> impl Into<u32> {
2018-02-08 15:40:27 -08:00
| ^^^^^^^^^^^^^^
error[E0277]: `impl Into<u32>` doesn't implement `Debug`
--> $DIR/nested_impl_trait.rs:5:70
|
LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
| ^ `impl Into<u32>` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
help: consider further restricting this bound
|
LL | fn bad_in_ret_position(x: impl Into<u32> + std::fmt::Debug) -> impl Into<impl Debug> { x }
| +++++++++++++++++
error[E0277]: `impl Into<u32>` doesn't implement `Debug`
--> $DIR/nested_impl_trait.rs:18:58
|
LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
| ^ `impl Into<u32>` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
help: consider further restricting this bound
|
LL | fn bad(x: impl Into<u32> + std::fmt::Debug) -> impl Into<impl Debug> { x }
| +++++++++++++++++
error: aborting due to 8 previous errors
2018-02-08 15:40:27 -08:00
Some errors have detailed explanations: E0277, E0562, E0666.
For more information about an error, try `rustc --explain E0277`.