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 @@ -896,14 +896,15 @@ module.exports = grammar({
896
896
abstract_type : $ => seq (
897
897
'impl' ,
898
898
optional ( seq ( 'for' , $ . type_parameters ) ) ,
899
- field ( 'trait' , choice (
899
+ field ( 'trait' , prec ( 1 , choice (
900
900
$ . _type_identifier ,
901
901
$ . scoped_type_identifier ,
902
902
$ . removed_trait_bound ,
903
903
$ . generic_type ,
904
904
$ . function_type ,
905
905
$ . tuple_type ,
906
- ) ) ,
906
+ $ . bounded_type ,
907
+ ) ) ) ,
907
908
) ,
908
909
909
910
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