Stream: t-compiler

Topic: Unstable type parameters on stable types

gnzlbg (May 06 2019 at 14:38, on Zulip):

WG-Allocators would like to have unstable type parameters on stable types, e.g., Box<T, A = alloc::Global> where A is unstable to use. See

I think it would already be very helpful for us to know whether this is something that would be feasible for a sufficiently motivated party to implement in the compiler in the near future, or whether right now, given the current implementation, trying to do this would just hit to many issues, be really really hard, etc.

gnzlbg (May 06 2019 at 14:40, on Zulip):

Maybe the compiler team could discuss how feasible this would be in their next meeting, and give us a heads up on how feasible they think this would be?

eddyb (May 06 2019 at 16:19, on Zulip):

cc @varkor (I think it should be easy as long as it's only allowed on struct/enum/union parameters)

varkor (May 06 2019 at 18:34, on Zulip):

I agree, I think this should be relatively straightforward to support

John Ericson (May 07 2019 at 14:12, on Zulip):

Great!! Unless I'm missing something, it's fine to use an "unstable unstable annotation" (not wait for a stabilization cycle), so this shouldn't add too much latency.

gnzlbg (May 07 2019 at 17:34, on Zulip):

@eddyb the intent is to use this in the alloc crate collections and related types (e.g. Box). I think all of them are structs.

centril (May 07 2019 at 18:10, on Zulip):

please make sure that you have tests for unstable type params and that you take various places a path can be mentioned into account

centril (May 07 2019 at 18:10, on Zulip):

possibly also accounting for inference

Last update: May 24 2020 at 22:50UTC