Skip to content

Commit 89b43dc

Browse files
calixtemanmaxbrunsfeld
authored andcommitted
Where clause can contain ptr type #48
1 parent efe3263 commit 89b43dc

File tree

5 files changed

+44332
-44220
lines changed

5 files changed

+44332
-44220
lines changed

corpus/declarations.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,9 +1022,9 @@ pub trait A<B> where B: C,
10221022
{
10231023
}
10241024

1025-
fn foo<A>() where A: B + As<f64>, f64: As<A>
1026-
{
1027-
}
1025+
fn foo<A>() where A: B + As<f64>, f64: As<A> {}
1026+
1027+
impl<A> Default for B<A> where *mut A: C + D {}
10281028

10291029
---
10301030

@@ -1141,6 +1141,7 @@ fn foo<A>() where A: B + As<f64>, f64: As<A>
11411141
left: (type_identifier)
11421142
bounds: (trait_bounds (type_identifier))))
11431143
body: (declaration_list))
1144+
11441145
(function_item
11451146
name: (identifier)
11461147
type_parameters: (type_parameters (type_identifier))
@@ -1158,7 +1159,19 @@ fn foo<A>() where A: B + As<f64>, f64: As<A>
11581159
bounds: (trait_bounds (generic_type
11591160
type: (type_identifier)
11601161
type_arguments: (type_arguments (type_identifier))))))
1161-
body: (block)))
1162+
body: (block))
1163+
1164+
(impl_item
1165+
type_parameters: (type_parameters (type_identifier))
1166+
trait: (type_identifier)
1167+
type: (generic_type
1168+
type: (type_identifier)
1169+
type_arguments: (type_arguments (type_identifier)))
1170+
(where_clause
1171+
(where_predicate
1172+
left: (pointer_type (mutable_specifier) type: (type_identifier))
1173+
bounds: (trait_bounds (type_identifier) (type_identifier))))
1174+
body: (declaration_list)))
11621175

11631176
===================================
11641177
External Modules

grammar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ module.exports = grammar({
440440
$.scoped_type_identifier,
441441
$.generic_type,
442442
$.reference_type,
443+
$.pointer_type,
443444
$.tuple_type,
444445
$.higher_ranked_trait_bound,
445446
alias(choice(...primitive_types), $.primitive_type)

src/grammar.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,6 +2381,10 @@
23812381
"type": "SYMBOL",
23822382
"name": "reference_type"
23832383
},
2384+
{
2385+
"type": "SYMBOL",
2386+
"name": "pointer_type"
2387+
},
23842388
{
23852389
"type": "SYMBOL",
23862390
"name": "tuple_type"

src/node-types.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4367,6 +4367,10 @@
43674367
"type": "lifetime",
43684368
"named": true
43694369
},
4370+
{
4371+
"type": "pointer_type",
4372+
"named": true
4373+
},
43704374
{
43714375
"type": "primitive_type",
43724376
"named": true

0 commit comments

Comments
 (0)