@@ -13,61 +13,61 @@ fn in_adt_in_parameters(_: Vec<impl Debug>) { panic!() }
1313
1414// Disallowed
1515fn in_fn_parameter_in_parameters ( _: fn ( impl Debug ) ) { panic ! ( ) }
16- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
16+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
1717
1818// Disallowed
1919fn in_fn_return_in_parameters ( _: fn ( ) -> impl Debug ) { panic ! ( ) }
20- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
20+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
2121
2222// Disallowed
2323fn in_fn_parameter_in_return ( ) -> fn ( impl Debug ) { panic ! ( ) }
24- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
24+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
2525
2626// Disallowed
2727fn in_fn_return_in_return ( ) -> fn ( ) -> impl Debug { panic ! ( ) }
28- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
28+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
2929
3030// Disallowed
3131fn in_dyn_Fn_parameter_in_parameters ( _: & dyn Fn ( impl Debug ) ) { panic ! ( ) }
32- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
32+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
3333
3434// Disallowed
3535fn in_dyn_Fn_return_in_parameters ( _: & dyn Fn ( ) -> impl Debug ) { panic ! ( ) }
36- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
36+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
3737
3838// Disallowed
3939fn in_dyn_Fn_parameter_in_return ( ) -> & ' static dyn Fn ( impl Debug ) { panic ! ( ) }
40- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
40+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
4141
4242// Disallowed
4343fn in_dyn_Fn_return_in_return ( ) -> & ' static dyn Fn ( ) -> impl Debug { panic ! ( ) }
44- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
44+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
4545
4646// Disallowed
4747fn in_impl_Fn_parameter_in_parameters ( _: & impl Fn ( impl Debug ) ) { panic ! ( ) }
48- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
48+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
4949//~^^ ERROR nested `impl Trait` is not allowed
5050
5151// Disallowed
5252fn in_impl_Fn_return_in_parameters ( _: & impl Fn ( ) -> impl Debug ) { panic ! ( ) }
53- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
53+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
5454
5555// Disallowed
5656fn in_impl_Fn_parameter_in_return ( ) -> & ' static impl Fn ( impl Debug ) { panic ! ( ) }
57- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
57+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
5858//~| ERROR nested `impl Trait` is not allowed
5959
6060// Disallowed
6161fn in_impl_Fn_return_in_return ( ) -> & ' static impl Fn ( ) -> impl Debug { panic ! ( ) }
62- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
62+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
6363
6464// Disallowed
6565fn in_Fn_parameter_in_generics < F : Fn ( impl Debug ) > ( _: F ) { panic ! ( ) }
66- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
66+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
6767
6868// Disallowed
6969fn in_Fn_return_in_generics < F : Fn ( ) -> impl Debug > ( _: F ) { panic ! ( ) }
70- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
70+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
7171
7272
7373// Allowed
@@ -80,22 +80,22 @@ fn in_impl_Trait_in_return() -> impl IntoIterator<Item = impl IntoIterator> {
8080
8181// Disallowed
8282struct InBraceStructField { x : impl Debug }
83- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
83+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
8484
8585// Disallowed
8686struct InAdtInBraceStructField { x : Vec < impl Debug > }
87- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
87+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
8888
8989// Disallowed
9090struct InTupleStructField ( impl Debug ) ;
91- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
91+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
9292
9393// Disallowed
9494enum InEnum {
9595 InBraceVariant { x : impl Debug } ,
96- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
96+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
9797 InTupleVariant ( impl Debug ) ,
98- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
98+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
9999}
100100
101101// Allowed
@@ -106,7 +106,7 @@ trait InTraitDefnParameters {
106106// Disallowed
107107trait InTraitDefnReturn {
108108 fn in_return ( ) -> impl Debug ;
109- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
109+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
110110}
111111
112112// Allowed and disallowed in trait impls
@@ -123,7 +123,7 @@ impl DummyTrait for () {
123123 // Allowed
124124
125125 fn in_trait_impl_return ( ) -> impl Debug { ( ) }
126- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
126+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
127127}
128128
129129// Allowed
@@ -136,10 +136,10 @@ impl DummyType {
136136// Disallowed
137137extern "C" {
138138 fn in_foreign_parameters ( _: impl Debug ) ;
139- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
139+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
140140
141141 fn in_foreign_return ( ) -> impl Debug ;
142- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
142+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
143143}
144144
145145// Allowed
@@ -155,96 +155,96 @@ type InTypeAlias<R> = impl Debug;
155155//~^ ERROR `impl Trait` in type aliases is unstable
156156
157157type InReturnInTypeAlias < R > = fn ( ) -> impl Debug ;
158- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
158+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
159159//~| ERROR `impl Trait` in type aliases is unstable
160160
161161// Disallowed in impl headers
162162impl PartialEq < impl Debug > for ( ) {
163- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
163+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
164164}
165165
166166// Disallowed in impl headers
167167impl PartialEq < ( ) > for impl Debug {
168- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
168+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
169169}
170170
171171// Disallowed in inherent impls
172172impl impl Debug {
173- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
173+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
174174}
175175
176176// Disallowed in inherent impls
177177struct InInherentImplAdt < T > { t : T }
178178impl InInherentImplAdt < impl Debug > {
179- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
179+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
180180}
181181
182182// Disallowed in where clauses
183183fn in_fn_where_clause ( )
184184 where impl Debug : Debug
185- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
185+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
186186{
187187}
188188
189189// Disallowed in where clauses
190190fn in_adt_in_fn_where_clause ( )
191191 where Vec < impl Debug > : Debug
192- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
192+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
193193{
194194}
195195
196196// Disallowed
197197fn in_trait_parameter_in_fn_where_clause < T > ( )
198198 where T : PartialEq < impl Debug >
199- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
199+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
200200{
201201}
202202
203203// Disallowed
204204fn in_Fn_parameter_in_fn_where_clause < T > ( )
205205 where T : Fn ( impl Debug )
206- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
206+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
207207{
208208}
209209
210210// Disallowed
211211fn in_Fn_return_in_fn_where_clause < T > ( )
212212 where T : Fn ( ) -> impl Debug
213- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
213+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
214214{
215215}
216216
217217// Disallowed
218218struct InStructGenericParamDefault < T = impl Debug > ( T ) ;
219- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
219+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
220220
221221// Disallowed
222222enum InEnumGenericParamDefault < T = impl Debug > { Variant ( T ) }
223- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
223+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
224224
225225// Disallowed
226226trait InTraitGenericParamDefault < T = impl Debug > { }
227- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
227+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
228228
229229// Disallowed
230230type InTypeAliasGenericParamDefault < T = impl Debug > = T ;
231- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
231+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
232232
233233// Disallowed
234234impl < T = impl Debug > T { }
235235//~^ ERROR defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
236236//~| WARNING this was previously accepted by the compiler but is being phased out
237- //~| ERROR `impl Trait` not allowed outside of function and inherent method return types
237+ //~| ERROR `impl Trait` not allowed outside of function and method return types
238238
239239// Disallowed
240240fn in_method_generic_param_default < T = impl Debug > ( _: T ) { }
241241//~^ ERROR defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
242242//~| WARNING this was previously accepted by the compiler but is being phased out
243- //~| ERROR `impl Trait` not allowed outside of function and inherent method return types
243+ //~| ERROR `impl Trait` not allowed outside of function and method return types
244244
245245fn main ( ) {
246246 let _in_local_variable: impl Fn ( ) = || { } ;
247- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
247+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
248248 let _in_return_in_local_variable = || -> impl Fn ( ) { || { } } ;
249- //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
249+ //~^ ERROR `impl Trait` not allowed outside of function and method return types
250250}
0 commit comments