]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #47892 - Badel2:const_type_id_of, r=oli-obk
authorkennytm <kennytm@gmail.com>
Sun, 4 Feb 2018 17:27:36 +0000 (01:27 +0800)
committerkennytm <kennytm@gmail.com>
Sun, 4 Feb 2018 17:27:36 +0000 (01:27 +0800)
Turn `type_id` into a constant intrinsic

https://github.com/rust-lang/rust/issues/27745

The method `get_type_id` in `Any` is intended to support reflection. It's currently unstable in favor of using an associated constant instead. This PR makes the `type_id` intrinsic a constant intrinsic, the same as `size_of` and `align_of`, allowing `TypeId::of` to be a `const fn`, which will allow using an associated constant in `Any`.

1  2 
src/libcore/lib.rs
src/librustc_const_eval/eval.rs

Simple merge
Simple merge