[bindings] Handle generic-ized impl blocks by concretizing them
authorMatt Corallo <git@bluematt.me>
Thu, 11 Feb 2021 16:47:51 +0000 (11:47 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 18 Feb 2021 17:28:25 +0000 (12:28 -0500)
commita387badfe87b6fa1c2f8f0ea488723c1fd5aa3e0
tree739b17f37d7b0f3b93a7168e0e39b9d8963d5d48
parent842d2f6ce7da27ddc439501cf4025c9daaf6b0e8
[bindings] Handle generic-ized impl blocks by concretizing them

This handles, for example, the `impl<X: Y> for Features<X>` blocks
which are generic across a number of different contexts. We do so
by walking the set of structs which alias Features and then walking
their generic arguments to check that they meet the bounds
specified in the impl block. For each alias which does, we create
a dummy, explicit, `impl XFeatures` block with the same content as
the original and recurse.
c-bindings-gen/src/main.rs
c-bindings-gen/src/types.rs