os-rust/tests/ui/impl-trait/where-allowed.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

317 lines
14 KiB
Text
Raw Normal View History

2018-08-08 14:28:26 +02:00
error[E0666]: nested `impl Trait` is not allowed
--> $DIR/where-allowed.rs:49:51
2018-08-08 14:28:26 +02: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
--> $DIR/where-allowed.rs:58:57
2018-08-08 14:28:26 +02:00
|
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
| --------^^^^^^^^^^-
| | |
| | nested `impl Trait` here
| outer `impl Trait`
error[E0658]: `impl Trait` in associated types is unstable
--> $DIR/where-allowed.rs:120:16
2019-07-30 00:11:58 +01:00
|
LL | type Out = impl Debug;
2019-11-07 20:12:34 +01:00
| ^^^^^^^^^^
2019-07-30 00:11:58 +01:00
|
2020-02-07 13:07:02 +01:00
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
= help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
2019-07-30 00:11:58 +01:00
2019-08-01 00:41:54 +01:00
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/where-allowed.rs:155:23
2019-07-30 00:11:58 +01:00
|
LL | type InTypeAlias<R> = impl Debug;
2019-11-07 20:12:34 +01:00
| ^^^^^^^^^^
|
2020-02-07 13:07:02 +01: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 20:12:34 +01:00
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/where-allowed.rs:158:39
2019-11-07 20:12:34 +01:00
|
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
| ^^^^^^^^^^
2019-07-30 00:11:58 +01:00
|
2020-02-07 13:07:02 +01: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-30 00:11:58 +01:00
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer params
--> $DIR/where-allowed.rs:18:40
2018-08-08 14:28:26 +02:00
|
LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return types
--> $DIR/where-allowed.rs:22:42
2018-08-08 14:28:26 +02:00
|
LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer params
--> $DIR/where-allowed.rs:26:38
2018-08-08 14:28:26 +02:00
|
LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return types
--> $DIR/where-allowed.rs:30:40
2018-08-08 14:28:26 +02:00
|
LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
--> $DIR/where-allowed.rs:34:49
2018-08-08 14:28:26 +02:00
|
LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return types
--> $DIR/where-allowed.rs:38:51
2018-08-08 14:28:26 +02:00
|
LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
--> $DIR/where-allowed.rs:42:55
2018-08-08 14:28:26 +02:00
|
LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
--> $DIR/where-allowed.rs:49:51
2018-08-08 14:28:26 +02:00
|
LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return types
--> $DIR/where-allowed.rs:54:53
2018-08-08 14:28:26 +02:00
|
LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
--> $DIR/where-allowed.rs:58:57
2018-08-08 14:28:26 +02:00
|
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
--> $DIR/where-allowed.rs:66:38
2018-08-08 14:28:26 +02:00
|
LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return types
--> $DIR/where-allowed.rs:70:40
2018-08-08 14:28:26 +02:00
|
LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
--> $DIR/where-allowed.rs:83:32
2018-08-08 14:28:26 +02:00
|
LL | struct InBraceStructField { x: impl Debug }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
--> $DIR/where-allowed.rs:87:41
2018-08-08 14:28:26 +02:00
|
LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
--> $DIR/where-allowed.rs:91:27
2018-08-08 14:28:26 +02:00
|
LL | struct InTupleStructField(impl Debug);
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
--> $DIR/where-allowed.rs:96:25
2018-08-08 14:28:26 +02:00
|
LL | InBraceVariant { x: impl Debug },
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in field types
--> $DIR/where-allowed.rs:98:20
2018-08-08 14:28:26 +02:00
|
LL | InTupleVariant(impl Debug),
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return types
--> $DIR/where-allowed.rs:109:23
2018-08-08 14:28:26 +02:00
|
LL | fn in_return() -> impl Debug;
| ^^^^^^^^^^
2022-09-06 17:16:08 +00:00
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
= help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable
2018-08-08 14:28:26 +02:00
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types
--> $DIR/where-allowed.rs:126:34
2018-08-08 14:28:26 +02:00
|
LL | fn in_trait_impl_return() -> impl Debug { () }
| ^^^^^^^^^^
2022-09-06 17:16:08 +00:00
|
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
= help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable
2018-08-08 14:28:26 +02:00
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `extern fn` params
--> $DIR/where-allowed.rs:139:33
2018-08-08 14:28:26 +02:00
|
LL | fn in_foreign_parameters(_: impl Debug);
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `extern fn` return types
--> $DIR/where-allowed.rs:142:31
2018-08-08 14:28:26 +02:00
|
LL | fn in_foreign_return() -> impl Debug;
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return types
--> $DIR/where-allowed.rs:158:39
2018-08-08 14:28:26 +02:00
|
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in traits
--> $DIR/where-allowed.rs:163:16
2018-08-08 14:28:26 +02:00
|
LL | impl PartialEq<impl Debug> for () {
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in impl headers
--> $DIR/where-allowed.rs:168:24
2018-08-08 14:28:26 +02:00
|
LL | impl PartialEq<()> for impl Debug {
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in impl headers
--> $DIR/where-allowed.rs:173:6
2018-08-08 14:28:26 +02:00
|
LL | impl impl Debug {
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in impl headers
--> $DIR/where-allowed.rs:179:24
2018-08-08 14:28:26 +02:00
|
LL | impl InInherentImplAdt<impl Debug> {
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in bounds
--> $DIR/where-allowed.rs:185:11
2018-08-08 14:28:26 +02:00
|
LL | where impl Debug: Debug
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in bounds
--> $DIR/where-allowed.rs:192:15
2018-08-08 14:28:26 +02:00
|
LL | where Vec<impl Debug>: Debug
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in bounds
--> $DIR/where-allowed.rs:199:24
2018-08-08 14:28:26 +02:00
|
LL | where T: PartialEq<impl Debug>
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait params
--> $DIR/where-allowed.rs:206:17
2018-08-08 14:28:26 +02:00
|
LL | where T: Fn(impl Debug)
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return types
--> $DIR/where-allowed.rs:213:22
2018-08-08 14:28:26 +02:00
|
LL | where T: Fn() -> impl Debug
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
--> $DIR/where-allowed.rs:219:40
|
LL | struct InStructGenericParamDefault<T = impl Debug>(T);
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
--> $DIR/where-allowed.rs:223:36
|
LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
--> $DIR/where-allowed.rs:227:38
|
LL | trait InTraitGenericParamDefault<T = impl Debug> {}
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
--> $DIR/where-allowed.rs:231:41
|
LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
--> $DIR/where-allowed.rs:235:11
|
LL | impl <T = impl Debug> T {}
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic parameter defaults
--> $DIR/where-allowed.rs:242:40
|
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
| ^^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in variable bindings
--> $DIR/where-allowed.rs:248:29
2018-08-08 14:28:26 +02:00
|
LL | let _in_local_variable: impl Fn() = || {};
| ^^^^^^^^^
2023-02-22 01:10:52 +00:00
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in closure return types
--> $DIR/where-allowed.rs:250:46
2018-08-08 14:28:26 +02:00
|
LL | let _in_return_in_local_variable = || -> impl Fn() { || {} };
| ^^^^^^^^^
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/where-allowed.rs:235:7
|
LL | impl <T = impl Debug> T {}
| ^^^^^^^^^^^^^^
|
= 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>
2022-09-18 19:55:36 +04:00
= note: `#[deny(invalid_type_param_default)]` on by default
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/where-allowed.rs:242:36
2019-07-30 00:11:58 +01:00
|
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
| ^^^^^^^^^^^^^^
2019-07-30 00:11:58 +01: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-30 00:11:58 +01:00
error[E0118]: no nominal type found for inherent implementation
--> $DIR/where-allowed.rs:235:1
|
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 47 previous errors
2018-08-08 14:28:26 +02:00
Some errors have detailed explanations: E0118, E0562, E0658, E0666.
For more information about an error, try `rustc --explain E0118`.