File tree 2 files changed +28
-2
lines changed
2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -893,14 +893,15 @@ module.exports = grammar({
893
893
abstract_type : $ => seq (
894
894
'impl' ,
895
895
optional ( seq ( 'for' , $ . type_parameters ) ) ,
896
- field ( 'trait' , choice (
896
+ field ( 'trait' , prec ( 1 , choice (
897
897
$ . _type_identifier ,
898
898
$ . scoped_type_identifier ,
899
899
$ . removed_trait_bound ,
900
900
$ . generic_type ,
901
901
$ . function_type ,
902
902
$ . tuple_type ,
903
- ) ) ,
903
+ $ . bounded_type ,
904
+ ) ) ) ,
904
905
) ,
905
906
906
907
dynamic_type : $ => seq (
Original file line number Diff line number Diff line change @@ -266,6 +266,31 @@ fn triples(a: impl B) -> impl Iterator<Item=(usize)> {
266
266
(primitive_type))))))
267
267
(block)))
268
268
269
+ ================================================================================
270
+ Impl with lifetimes first
271
+ ================================================================================
272
+
273
+ fn foo<'a>(x: impl 'a + Clone) {}
274
+
275
+ --------------------------------------------------------------------------------
276
+
277
+ (source_file
278
+ (function_item
279
+ (identifier)
280
+ (type_parameters
281
+ (lifetime_parameter
282
+ (lifetime
283
+ (identifier))))
284
+ (parameters
285
+ (parameter
286
+ (identifier)
287
+ (abstract_type
288
+ (bounded_type
289
+ (lifetime
290
+ (identifier))
291
+ (type_identifier)))))
292
+ (block)))
293
+
269
294
================================================================================
270
295
Functions with precise capture syntax
271
296
================================================================================
You can’t perform that action at this time.
0 commit comments