rust/src/test/ui/impl-trait/where-allowed.stderr

405 lines
15 KiB
Plaintext
Raw Normal View History

2018-08-08 12:28:26 +00:00
error[E0666]: nested `impl Trait` is not allowed
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:47:51
2018-08-08 12:28:26 +00:00
|
LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
| --------^^^^^^^^^^-
| | |
| | nested `impl Trait` here
| outer `impl Trait`
error[E0666]: nested `impl Trait` is not allowed
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:56:57
2018-08-08 12:28:26 +00:00
|
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
| --------^^^^^^^^^^-
| | |
| | nested `impl Trait` here
| outer `impl Trait`
2019-07-31 23:41:54 +00:00
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/where-allowed.rs:119:16
2019-07-29 23:11:58 +00:00
|
LL | type Out = impl Debug;
2019-11-07 19:12:34 +00:00
| ^^^^^^^^^^
2019-07-29 23:11:58 +00:00
|
2020-02-07 12:07:02 +00:00
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
2019-07-29 23:11:58 +00:00
2019-07-31 23:41:54 +00:00
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/where-allowed.rs:154:23
2019-07-29 23:11:58 +00:00
|
LL | type InTypeAlias<R> = impl Debug;
2019-11-07 19:12:34 +00:00
| ^^^^^^^^^^
|
2020-02-07 12:07:02 +00:00
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
2019-11-07 19:12:34 +00:00
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/where-allowed.rs:157:39
2019-11-07 19:12:34 +00:00
|
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
| ^^^^^^^^^^
2019-07-29 23:11:58 +00:00
|
2020-02-07 12:07:02 +00:00
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
2019-07-29 23:11:58 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:15:40
2018-08-08 12:28:26 +00:00
|
LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `fn` pointer param
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:19:42
2018-08-08 12:28:26 +00:00
|
LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `fn` pointer return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:23:38
2018-08-08 12:28:26 +00:00
|
LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `fn` pointer param
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:27:40
2018-08-08 12:28:26 +00:00
|
LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `fn` pointer return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:31:49
2018-08-08 12:28:26 +00:00
|
LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait param
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:35:51
2018-08-08 12:28:26 +00:00
|
LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:39:55
2018-08-08 12:28:26 +00:00
|
LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait param
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:43:57
2018-08-08 12:28:26 +00:00
|
LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:47:51
2018-08-08 12:28:26 +00:00
|
LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait param
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:52:53
2018-08-08 12:28:26 +00:00
|
LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
2019-11-15 21:50:57 +00:00
--> $DIR/where-allowed.rs:56:57
2018-08-08 12:28:26 +00:00
|
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait param
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:61:59
2018-08-08 12:28:26 +00:00
|
LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:65:38
2018-08-08 12:28:26 +00:00
|
LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait param
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:69:40
2018-08-08 12:28:26 +00:00
|
LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:82:32
2018-08-08 12:28:26 +00:00
|
LL | struct InBraceStructField { x: impl Debug }
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:86:41
2018-08-08 12:28:26 +00:00
|
LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
| ^^^^^^^^^^
|
= note: found `impl Trait` in path
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:90:27
2018-08-08 12:28:26 +00:00
|
LL | struct InTupleStructField(impl Debug);
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:95:25
2018-08-08 12:28:26 +00:00
|
LL | InBraceVariant { x: impl Debug },
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:97:20
2018-08-08 12:28:26 +00:00
|
LL | InTupleVariant(impl Debug),
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:108:23
2018-08-08 12:28:26 +00:00
|
LL | fn in_return() -> impl Debug;
| ^^^^^^^^^^
|
= note: found `impl Trait` in trait method return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:125:34
2018-08-08 12:28:26 +00:00
|
LL | fn in_trait_impl_return() -> impl Debug { () }
| ^^^^^^^^^^
|
= note: found `impl Trait` in `impl` method return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:138:33
2018-08-08 12:28:26 +00:00
|
LL | fn in_foreign_parameters(_: impl Debug);
| ^^^^^^^^^^
|
= note: found `impl Trait` in `extern fn` param
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:141:31
2018-08-08 12:28:26 +00:00
|
LL | fn in_foreign_return() -> impl Debug;
| ^^^^^^^^^^
|
= note: found `impl Trait` in `extern fn` return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:157:39
2018-08-08 12:28:26 +00:00
|
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
| ^^^^^^^^^^
|
= note: found `impl Trait` in `fn` pointer return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:162:16
2018-08-08 12:28:26 +00:00
|
LL | impl PartialEq<impl Debug> for () {
| ^^^^^^^^^^
|
= note: found `impl Trait` in trait
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:167:24
2018-08-08 12:28:26 +00:00
|
LL | impl PartialEq<()> for impl Debug {
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:172:6
2018-08-08 12:28:26 +00:00
|
LL | impl impl Debug {
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:178:24
2018-08-08 12:28:26 +00:00
|
LL | impl InInherentImplAdt<impl Debug> {
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:184:11
2018-08-08 12:28:26 +00:00
|
LL | where impl Debug: Debug
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:191:15
2018-08-08 12:28:26 +00:00
|
LL | where Vec<impl Debug>: Debug
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:198:24
2018-08-08 12:28:26 +00:00
|
LL | where T: PartialEq<impl Debug>
| ^^^^^^^^^^
|
= note: found `impl Trait` in bound
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:205:17
2018-08-08 12:28:26 +00:00
|
LL | where T: Fn(impl Debug)
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait param
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:212:22
2018-08-08 12:28:26 +00:00
|
LL | where T: Fn() -> impl Debug
| ^^^^^^^^^^
|
= note: found `impl Trait` in `Fn` trait return
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:218:40
|
LL | struct InStructGenericParamDefault<T = impl Debug>(T);
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:222:36
|
LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:226:38
|
LL | trait InTraitGenericParamDefault<T = impl Debug> {}
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:230:41
|
LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:234:11
|
LL | impl <T = impl Debug> T {}
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:241:40
|
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
| ^^^^^^^^^^
|
= note: found `impl Trait` in type
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:247:29
2018-08-08 12:28:26 +00:00
|
LL | let _in_local_variable: impl Fn() = || {};
| ^^^^^^^^^
|
= note: found `impl Trait` in variable
2018-08-08 12:28:26 +00:00
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/where-allowed.rs:249:46
2018-08-08 12:28:26 +00:00
|
LL | let _in_return_in_local_variable = || -> impl Fn() { || {} };
| ^^^^^^^^^
|
= note: found `impl Trait` in closure return
2018-08-08 12:28:26 +00:00
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/where-allowed.rs:234:7
|
LL | impl <T = impl Debug> T {}
| ^
|
= note: `#[deny(invalid_type_param_default)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/where-allowed.rs:241:36
2019-07-29 23:11:58 +00:00
|
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
| ^
2019-07-29 23:11:58 +00:00
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
2019-07-29 23:11:58 +00:00
error[E0118]: no nominal type found for inherent implementation
--> $DIR/where-allowed.rs:234:23
|
LL | impl <T = impl Debug> T {}
| ^ impl requires a nominal type
|
= note: either implement a trait on it or create a newtype to wrap it instead
error: aborting due to 49 previous errors
2018-08-08 12:28:26 +00:00
Some errors have detailed explanations: E0118, E0562, E0658, E0666.
For more information about an error, try `rustc --explain E0118`.