Super Trait Ultra Associated Item @WaffleLapkin @BoxyUwU

trait Super {
    fn assoc() -> Self;
}

trait Sub: Super {}

fn f<T: Sub>() -> T {
    Sub::assoc()
}

fn main() {}
Solution
error[E0782]: expected a type, found a trait
 --> examples/misc_5.rs:8:5
  |
8 |     Sub::assoc()
  |     ^^^
  |
help: you can add the `dyn` keyword if you want a trait object
  |
8 |     <dyn Sub>::assoc()
  |     ++++    +

For more information about this error, try `rustc --explain E0782`.
error: could not compile `code` (example "misc_5") due to 1 previous error

This diagnostic is fairly confusing. The diagnostic assumes that you meant to use Sub as a type, not a trait, which requires the dyn keyword. Though, in this specific case this assumption doesn't make sense as Sub is not dyn compatible.

The compilation error is caused by being unable to refer to items from super traits through sub traits. Even though Sub has a super trait Super, you can't use Sub::assoc().

You can use Super::assoc() though, for example this compiles just fine:

trait Super {
    fn assoc() -> Self;
}

trait Sub: Super {}

fn f<T: Sub>() -> T {
    Super::assoc()
}

Trait::assoc is a shorter version of <_ as Trait>::assoc (aka fully qualified path).