--bless
This commit is contained in:
parent
cc752f5665
commit
d116859ad7
@ -1,7 +1,8 @@
|
||||
#![feature(impl_trait_in_fn_trait_return)]
|
||||
use std::fmt::Debug;
|
||||
|
||||
fn a() -> impl Fn(&u8) -> impl Debug {
|
||||
|x| x //~ ERROR lifetime may not live long enough
|
||||
|x| x //~ ERROR hidden type for `impl Debug` captures lifetime that does not appear in bounds
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,11 +1,11 @@
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/impl-fn-hrtb-bounds-2.rs:4:9
|
||||
error[E0700]: hidden type for `impl Debug` captures lifetime that does not appear in bounds
|
||||
--> $DIR/impl-fn-hrtb-bounds-2.rs:5:9
|
||||
|
|
||||
LL | |x| x
|
||||
| -- ^ returning this value requires that `'1` must outlive `'2`
|
||||
| ||
|
||||
| |return type of closure is &'2 u8
|
||||
| has type `&'1 u8`
|
||||
| --- ^
|
||||
| |
|
||||
| hidden type `&u8` captures the anonymous lifetime #1 defined here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0700`.
|
||||
|
@ -1,3 +1,4 @@
|
||||
#![feature(impl_trait_in_fn_trait_return)]
|
||||
use std::fmt::Debug;
|
||||
|
||||
fn a() -> impl Fn(&u8) -> (impl Debug + '_) {
|
||||
|
@ -1,56 +1,51 @@
|
||||
error: higher kinded lifetime bounds on nested opaque types are not supported yet
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:3:41
|
||||
|
|
||||
LL | fn a() -> impl Fn(&u8) -> (impl Debug + '_) {
|
||||
| ^^
|
||||
|
|
||||
note: lifetime declared here
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:3:19
|
||||
|
|
||||
LL | fn a() -> impl Fn(&u8) -> (impl Debug + '_) {
|
||||
| ^
|
||||
|
||||
error: higher kinded lifetime bounds on nested opaque types are not supported yet
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:8:52
|
||||
|
|
||||
LL | fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) {
|
||||
| ^^
|
||||
|
|
||||
note: lifetime declared here
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:8:20
|
||||
|
|
||||
LL | fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) {
|
||||
| ^^
|
||||
|
||||
error: higher kinded lifetime bounds on nested opaque types are not supported yet
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:13:52
|
||||
|
|
||||
LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
|
||||
| ^^
|
||||
|
|
||||
note: lifetime declared here
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:13:20
|
||||
|
|
||||
LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
|
||||
| ^^
|
||||
|
||||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:18:38
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:19:38
|
||||
|
|
||||
LL | fn d() -> impl Fn() -> (impl Debug + '_) {
|
||||
| ^^ expected named lifetime parameter
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
||||
= note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
|
||||
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
||||
|
|
||||
LL | fn d() -> impl for<'a> Fn() -> (impl Debug + 'a) {
|
||||
| +++++++ ~~
|
||||
help: consider using the `'static` lifetime
|
||||
|
|
||||
LL | fn d() -> impl Fn() -> (impl Debug + 'static) {
|
||||
| ~~~~~~~
|
||||
|
||||
error: higher kinded lifetime bounds on nested opaque types are not supported yet
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:4:41
|
||||
|
|
||||
LL | fn a() -> impl Fn(&u8) -> (impl Debug + '_) {
|
||||
| ^^
|
||||
|
|
||||
note: lifetime declared here
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:4:19
|
||||
|
|
||||
LL | fn a() -> impl Fn(&u8) -> (impl Debug + '_) {
|
||||
| ^
|
||||
|
||||
error: higher kinded lifetime bounds on nested opaque types are not supported yet
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:9:52
|
||||
|
|
||||
LL | fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) {
|
||||
| ^^
|
||||
|
|
||||
note: lifetime declared here
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:9:20
|
||||
|
|
||||
LL | fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) {
|
||||
| ^^
|
||||
|
||||
error: higher kinded lifetime bounds on nested opaque types are not supported yet
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:14:52
|
||||
|
|
||||
LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
|
||||
| ^^
|
||||
|
|
||||
note: lifetime declared here
|
||||
--> $DIR/impl-fn-hrtb-bounds.rs:14:20
|
||||
|
|
||||
LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
|
||||
| ^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0106`.
|
||||
|
@ -1,3 +1,4 @@
|
||||
#![feature(impl_trait_in_fn_trait_return)]
|
||||
use std::fmt::Debug;
|
||||
|
||||
fn a() -> impl Fn(&u8) -> impl Debug + '_ {
|
||||
|
@ -1,23 +1,23 @@
|
||||
error: ambiguous `+` in a type
|
||||
--> $DIR/impl-fn-parsing-ambiguities.rs:3:27
|
||||
--> $DIR/impl-fn-parsing-ambiguities.rs:4:27
|
||||
|
|
||||
LL | fn a() -> impl Fn(&u8) -> impl Debug + '_ {
|
||||
| ^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(impl Debug + '_)`
|
||||
|
||||
error: ambiguous `+` in a type
|
||||
--> $DIR/impl-fn-parsing-ambiguities.rs:9:24
|
||||
--> $DIR/impl-fn-parsing-ambiguities.rs:10:24
|
||||
|
|
||||
LL | fn b() -> impl Fn() -> impl Debug + Send {
|
||||
| ^^^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(impl Debug + Send)`
|
||||
|
||||
error: higher kinded lifetime bounds on nested opaque types are not supported yet
|
||||
--> $DIR/impl-fn-parsing-ambiguities.rs:3:40
|
||||
--> $DIR/impl-fn-parsing-ambiguities.rs:4:40
|
||||
|
|
||||
LL | fn a() -> impl Fn(&u8) -> impl Debug + '_ {
|
||||
| ^^
|
||||
|
|
||||
note: lifetime declared here
|
||||
--> $DIR/impl-fn-parsing-ambiguities.rs:3:19
|
||||
--> $DIR/impl-fn-parsing-ambiguities.rs:4:19
|
||||
|
|
||||
LL | fn a() -> impl Fn(&u8) -> impl Debug + '_ {
|
||||
| ^
|
||||
|
@ -1,7 +1,8 @@
|
||||
// check-pass
|
||||
#![feature(impl_trait_in_fn_trait_return)]
|
||||
use std::fmt::Debug;
|
||||
|
||||
fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
|
||||
//~^ ERROR hidden type for `impl Debug` captures lifetime that does not appear in bounds
|
||||
|x| x
|
||||
}
|
||||
|
||||
|
15
src/test/ui/impl-trait/impl-fn-predefined-lifetimes.stderr
Normal file
15
src/test/ui/impl-trait/impl-fn-predefined-lifetimes.stderr
Normal file
@ -0,0 +1,15 @@
|
||||
error[E0700]: hidden type for `impl Debug` captures lifetime that does not appear in bounds
|
||||
--> $DIR/impl-fn-predefined-lifetimes.rs:4:35
|
||||
|
|
||||
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: hidden type `&'<empty> u8` captures lifetime smaller than the function body
|
||||
--> $DIR/impl-fn-predefined-lifetimes.rs:4:35
|
||||
|
|
||||
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0700`.
|
@ -1,4 +1,5 @@
|
||||
// run-pass
|
||||
#![feature(impl_trait_in_fn_trait_return)]
|
||||
use std::fmt::Debug;
|
||||
|
||||
fn f_debug() -> impl Fn() -> impl Debug {
|
||||
|
@ -1,3 +1,4 @@
|
||||
#![feature(impl_trait_in_fn_trait_return)]
|
||||
use std::fmt::Debug;
|
||||
|
||||
fn fine(x: impl Into<u32>) -> impl Into<u32> { x }
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0666]: nested `impl Trait` is not allowed
|
||||
--> $DIR/nested_impl_trait.rs:5:56
|
||||
--> $DIR/nested_impl_trait.rs:6:56
|
||||
|
|
||||
LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
|
||||
| ----------^^^^^^^^^^-
|
||||
@ -8,7 +8,7 @@ LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
|
||||
| outer `impl Trait`
|
||||
|
||||
error[E0666]: nested `impl Trait` is not allowed
|
||||
--> $DIR/nested_impl_trait.rs:9:42
|
||||
--> $DIR/nested_impl_trait.rs:10:42
|
||||
|
|
||||
LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
|
||||
| ----------^^^^^^^^^^-
|
||||
@ -17,7 +17,7 @@ LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
|
||||
| outer `impl Trait`
|
||||
|
||||
error[E0666]: nested `impl Trait` is not allowed
|
||||
--> $DIR/nested_impl_trait.rs:13:37
|
||||
--> $DIR/nested_impl_trait.rs:14:37
|
||||
|
|
||||
LL | fn bad_in_arg_position(_: impl Into<impl Debug>) { }
|
||||
| ----------^^^^^^^^^^-
|
||||
@ -26,7 +26,7 @@ LL | fn bad_in_arg_position(_: impl Into<impl Debug>) { }
|
||||
| outer `impl Trait`
|
||||
|
||||
error[E0666]: nested `impl Trait` is not allowed
|
||||
--> $DIR/nested_impl_trait.rs:18:44
|
||||
--> $DIR/nested_impl_trait.rs:19:44
|
||||
|
|
||||
LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
|
||||
| ----------^^^^^^^^^^-
|
||||
@ -35,13 +35,13 @@ LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
|
||||
| outer `impl Trait`
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return
|
||||
--> $DIR/nested_impl_trait.rs:9:32
|
||||
--> $DIR/nested_impl_trait.rs:10:32
|
||||
|
|
||||
LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
|
||||
--> $DIR/nested_impl_trait.rs:5:46
|
||||
--> $DIR/nested_impl_trait.rs:6:46
|
||||
|
|
||||
LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
|
||||
@ -50,7 +50,7 @@ LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
|
||||
= note: required for `impl Into<u32>` to implement `Into<impl Debug>`
|
||||
|
||||
error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
|
||||
--> $DIR/nested_impl_trait.rs:18:34
|
||||
--> $DIR/nested_impl_trait.rs:19:34
|
||||
|
|
||||
LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
|
||||
|
@ -1,5 +1,6 @@
|
||||
//! A simple test for testing many permutations of allowedness of
|
||||
//! impl Trait
|
||||
#![feature(impl_trait_in_fn_trait_return)]
|
||||
use std::fmt::Debug;
|
||||
|
||||
// Allowed
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0666]: nested `impl Trait` is not allowed
|
||||
--> $DIR/where-allowed.rs:46:51
|
||||
--> $DIR/where-allowed.rs:47:51
|
||||
|
|
||||
LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
|
||||
| --------^^^^^^^^^^-
|
||||
@ -8,7 +8,7 @@ LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
|
||||
| outer `impl Trait`
|
||||
|
||||
error[E0666]: nested `impl Trait` is not allowed
|
||||
--> $DIR/where-allowed.rs:55:57
|
||||
--> $DIR/where-allowed.rs:56:57
|
||||
|
|
||||
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
|
||||
| --------^^^^^^^^^^-
|
||||
@ -17,7 +17,7 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic
|
||||
| outer `impl Trait`
|
||||
|
||||
error[E0658]: `impl Trait` in type aliases is unstable
|
||||
--> $DIR/where-allowed.rs:117:16
|
||||
--> $DIR/where-allowed.rs:118:16
|
||||
|
|
||||
LL | type Out = impl Debug;
|
||||
| ^^^^^^^^^^
|
||||
@ -26,7 +26,7 @@ LL | type Out = impl Debug;
|
||||
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: `impl Trait` in type aliases is unstable
|
||||
--> $DIR/where-allowed.rs:152:23
|
||||
--> $DIR/where-allowed.rs:153:23
|
||||
|
|
||||
LL | type InTypeAlias<R> = impl Debug;
|
||||
| ^^^^^^^^^^
|
||||
@ -35,7 +35,7 @@ LL | type InTypeAlias<R> = impl Debug;
|
||||
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: `impl Trait` in type aliases is unstable
|
||||
--> $DIR/where-allowed.rs:155:39
|
||||
--> $DIR/where-allowed.rs:156:39
|
||||
|
|
||||
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
|
||||
| ^^^^^^^^^^
|
||||
@ -44,109 +44,109 @@ LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
|
||||
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer param
|
||||
--> $DIR/where-allowed.rs:15:40
|
||||
--> $DIR/where-allowed.rs:16:40
|
||||
|
|
||||
LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return
|
||||
--> $DIR/where-allowed.rs:19:42
|
||||
--> $DIR/where-allowed.rs:20:42
|
||||
|
|
||||
LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer param
|
||||
--> $DIR/where-allowed.rs:23:38
|
||||
--> $DIR/where-allowed.rs:24:38
|
||||
|
|
||||
LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return
|
||||
--> $DIR/where-allowed.rs:27:40
|
||||
--> $DIR/where-allowed.rs:28:40
|
||||
|
|
||||
LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait param
|
||||
--> $DIR/where-allowed.rs:31:49
|
||||
--> $DIR/where-allowed.rs:32:49
|
||||
|
|
||||
LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return
|
||||
--> $DIR/where-allowed.rs:35:51
|
||||
--> $DIR/where-allowed.rs:36:51
|
||||
|
|
||||
LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait param
|
||||
--> $DIR/where-allowed.rs:39:55
|
||||
--> $DIR/where-allowed.rs:40:55
|
||||
|
|
||||
LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait param
|
||||
--> $DIR/where-allowed.rs:46:51
|
||||
--> $DIR/where-allowed.rs:47:51
|
||||
|
|
||||
LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return
|
||||
--> $DIR/where-allowed.rs:51:53
|
||||
--> $DIR/where-allowed.rs:52:53
|
||||
|
|
||||
LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait param
|
||||
--> $DIR/where-allowed.rs:55:57
|
||||
--> $DIR/where-allowed.rs:56:57
|
||||
|
|
||||
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait param
|
||||
--> $DIR/where-allowed.rs:63:38
|
||||
--> $DIR/where-allowed.rs:64:38
|
||||
|
|
||||
LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return
|
||||
--> $DIR/where-allowed.rs:67:40
|
||||
--> $DIR/where-allowed.rs:68:40
|
||||
|
|
||||
LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:80:32
|
||||
--> $DIR/where-allowed.rs:81:32
|
||||
|
|
||||
LL | struct InBraceStructField { x: impl Debug }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in path
|
||||
--> $DIR/where-allowed.rs:84:41
|
||||
--> $DIR/where-allowed.rs:85:41
|
||||
|
|
||||
LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:88:27
|
||||
--> $DIR/where-allowed.rs:89:27
|
||||
|
|
||||
LL | struct InTupleStructField(impl Debug);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:93:25
|
||||
--> $DIR/where-allowed.rs:94:25
|
||||
|
|
||||
LL | InBraceVariant { x: impl Debug },
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:95:20
|
||||
--> $DIR/where-allowed.rs:96:20
|
||||
|
|
||||
LL | InTupleVariant(impl Debug),
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return
|
||||
--> $DIR/where-allowed.rs:106:23
|
||||
--> $DIR/where-allowed.rs:107:23
|
||||
|
|
||||
LL | fn in_return() -> impl Debug;
|
||||
| ^^^^^^^^^^
|
||||
@ -155,7 +155,7 @@ LL | fn in_return() -> impl Debug;
|
||||
= help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return
|
||||
--> $DIR/where-allowed.rs:123:34
|
||||
--> $DIR/where-allowed.rs:124:34
|
||||
|
|
||||
LL | fn in_trait_impl_return() -> impl Debug { () }
|
||||
| ^^^^^^^^^^
|
||||
@ -164,127 +164,127 @@ LL | fn in_trait_impl_return() -> impl Debug { () }
|
||||
= help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `extern fn` param
|
||||
--> $DIR/where-allowed.rs:136:33
|
||||
--> $DIR/where-allowed.rs:137:33
|
||||
|
|
||||
LL | fn in_foreign_parameters(_: impl Debug);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `extern fn` return
|
||||
--> $DIR/where-allowed.rs:139:31
|
||||
--> $DIR/where-allowed.rs:140:31
|
||||
|
|
||||
LL | fn in_foreign_return() -> impl Debug;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return
|
||||
--> $DIR/where-allowed.rs:155:39
|
||||
--> $DIR/where-allowed.rs:156:39
|
||||
|
|
||||
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait
|
||||
--> $DIR/where-allowed.rs:160:16
|
||||
--> $DIR/where-allowed.rs:161:16
|
||||
|
|
||||
LL | impl PartialEq<impl Debug> for () {
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:165:24
|
||||
--> $DIR/where-allowed.rs:166:24
|
||||
|
|
||||
LL | impl PartialEq<()> for impl Debug {
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:170:6
|
||||
--> $DIR/where-allowed.rs:171:6
|
||||
|
|
||||
LL | impl impl Debug {
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:176:24
|
||||
--> $DIR/where-allowed.rs:177:24
|
||||
|
|
||||
LL | impl InInherentImplAdt<impl Debug> {
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:182:11
|
||||
--> $DIR/where-allowed.rs:183:11
|
||||
|
|
||||
LL | where impl Debug: Debug
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:189:15
|
||||
--> $DIR/where-allowed.rs:190:15
|
||||
|
|
||||
LL | where Vec<impl Debug>: Debug
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in bound
|
||||
--> $DIR/where-allowed.rs:196:24
|
||||
--> $DIR/where-allowed.rs:197:24
|
||||
|
|
||||
LL | where T: PartialEq<impl Debug>
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait param
|
||||
--> $DIR/where-allowed.rs:203:17
|
||||
--> $DIR/where-allowed.rs:204:17
|
||||
|
|
||||
LL | where T: Fn(impl Debug)
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return
|
||||
--> $DIR/where-allowed.rs:210:22
|
||||
--> $DIR/where-allowed.rs:211:22
|
||||
|
|
||||
LL | where T: Fn() -> impl Debug
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:216:40
|
||||
--> $DIR/where-allowed.rs:217:40
|
||||
|
|
||||
LL | struct InStructGenericParamDefault<T = impl Debug>(T);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:220:36
|
||||
--> $DIR/where-allowed.rs:221:36
|
||||
|
|
||||
LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:224:38
|
||||
--> $DIR/where-allowed.rs:225:38
|
||||
|
|
||||
LL | trait InTraitGenericParamDefault<T = impl Debug> {}
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:228:41
|
||||
--> $DIR/where-allowed.rs:229:41
|
||||
|
|
||||
LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:232:11
|
||||
--> $DIR/where-allowed.rs:233:11
|
||||
|
|
||||
LL | impl <T = impl Debug> T {}
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in type
|
||||
--> $DIR/where-allowed.rs:239:40
|
||||
--> $DIR/where-allowed.rs:240:40
|
||||
|
|
||||
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in variable binding
|
||||
--> $DIR/where-allowed.rs:245:29
|
||||
--> $DIR/where-allowed.rs:246:29
|
||||
|
|
||||
LL | let _in_local_variable: impl Fn() = || {};
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in closure return
|
||||
--> $DIR/where-allowed.rs:247:46
|
||||
--> $DIR/where-allowed.rs:248:46
|
||||
|
|
||||
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:232:7
|
||||
--> $DIR/where-allowed.rs:233:7
|
||||
|
|
||||
LL | impl <T = impl Debug> T {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
@ -294,7 +294,7 @@ LL | impl <T = impl Debug> T {}
|
||||
= 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:239:36
|
||||
--> $DIR/where-allowed.rs:240:36
|
||||
|
|
||||
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
@ -303,7 +303,7 @@ LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
|
||||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
|
||||
|
||||
error[E0118]: no nominal type found for inherent implementation
|
||||
--> $DIR/where-allowed.rs:232:23
|
||||
--> $DIR/where-allowed.rs:233:23
|
||||
|
|
||||
LL | impl <T = impl Debug> T {}
|
||||
| ^ impl requires a nominal type
|
||||
|
Loading…
x
Reference in New Issue
Block a user