]> git.lizzy.rs Git - rust.git/commit
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)
commite17ebdf344401c265ade3b02bb68df0d0485d71a
tree69ae9abfb6aa69f17d7ed5bc4904c185b41c3f9d
parent66d6c855bda49035cdf825625dbe423a2e1a2a6b
parent196fad0d00bddd11074b5da32af2393abaac9a26
Rollup merge of #47892 - Badel2:const_type_id_of, r=oli-obk

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`.
src/libcore/lib.rs
src/librustc_const_eval/eval.rs