Closed
Description
A crate using specialization I've been working on seems to have broken sometime between nightly-2019-11-19
and nightly-2019-11-20
. After a bit of debugging, it seems the issue is that specialization doesn't always work correctly in const contexts.
This code, for example, returns the following:
const_bool::<TypeA>: in default impl
const_bool::<TypeB>: in default impl
const_str::<TypeA>: in specialized impl
const_str::<TypeB>: in default impl
run_method::<TypeA>: in specialized impl
run_method::<TypeB>: in default impl
On earlier versions, this would have returned the following:
const_bool::<TypeA>: in specialized impl
const_bool::<TypeB>: in default impl
const_str::<TypeA>: in specialized impl
const_str::<TypeB>: in default impl
run_method::<TypeA>: in specialized impl
run_method::<TypeB>: in default impl
This bug does not happen when the -Z mir-opt-level=0
flag is set, and it behaves the same as prior versions.