Allow restricted trait impls under #[allow_internal_unstable(min_specialization)] by Zalathar · Pull Request #120870 · rust-lang/rust (original) (raw)

This is a follow-up to #119963 and a companion to #120866, though it can land independently from the latter.


We have several compiler crates that only enable #[feature(min_specialization)] because it is required by their expansions of newtype_index!, in order to implement traits marked with #[rustc_specialization_trait].

This PR allows those traits to be implemented internally by macros with #[allow_internal_unstable(min_specialization)], without needing specialization to be enabled in the enclosing crate.