[bindings] Use == null() instead of is_null() to avoid ambiguity
authorMatt Corallo <git@bluematt.me>
Wed, 23 Sep 2020 01:46:26 +0000 (21:46 -0400)
committerMatt Corallo <git@bluematt.me>
Mon, 12 Oct 2020 16:17:26 +0000 (12:17 -0400)
commita1d0dde507db0336d336adf2771d74b023a74547
tree31222906a12737e9851e37edd860836c0f5d82d2
parentfe279c403474aa69e9257b9cb40feaf61ed17f8a
[bindings] Use == null() instead of is_null() to avoid ambiguity

When we have a `Trait` wrapped as an `Option<Trait>`, we called
`<*const Trait>.is_null()` which resulted in rustc trying to take
the most braindead option of dereferencing the whole thing and
hitting a recursive dereference since we
`impl Deref<Target=Trait> for Trait` for all our traits.

Instead, we can be explicit and just compare the pointer directly
with `std::ptr::null()` which avoids this.
c-bindings-gen/src/types.rs