On 13-08-23 11:08 AM, Oren Ben-Kiki wrote:
> Interesting - I see std::intrinsics::unstable::get_tydescr<T> -> *TyDescr...
> 
> Two questions:
> 
> - Can this be used for a quick type equality check (same pointer <=>
> same type)?

No, as I said, it does not support efficient type-equality. We don't
normalize all types. You should be able to count on one-way equality at
the moment (same pointer => same type) but not vice-versa.

> - How can one invoke `get_tydescr<int>()` or `get_tydescr<T>` (when `T`
> is a type parameter of the current function)? I get a syntax error on
> the `int` or `T`. 

get_tydesc::<T>(). This is the foo<> vs foo::<> syntax papercut. Gets
everyone, sorry. It's the price of using <> for type parameters rather
than []. We need a better error message for it.

-Graydon

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to