Open
Description
Consider the following code:
trait Memory {
type Provenance;
}
struct BasicMemory;
impl Memory for BasicMemory {
type Provenance = ();
}
fn some_fn() {
let x: BasicMemory::Provenance; // this fails
}
fn some_generic_fn<T: Memory>() {
let x: T::Provenance; // this works
}
Using Type::Provenance
works when Type
is a generic parameter that implements the appropriate trait, but strangely fails when Type
is a concrete type that implements the appropriate trait. That seems like a bug? Or at least it is an odd limitation that it'd be nice to lift. :)
Thanks to @memoryleak47 for pointing this out!