One generic parameter vs multiple parameters

I don't have a good answer, but below are a couple more examples I came up with while playing.

You don't have to do it for every trait, just every trait but the last :wink: :

    // `OptionsAB<Box<dyn TraitA>, Box<dyn TraitB>>`
    // as desired
    let dynamic_opt_ab: OptionsAB = OptionsAB::new()
         .set_a(Box::new(AAA) as Box<dyn TraitA>)
         .set_b(Box::new(BBB));
    // So is this one
    let dynamic_opt_ab: OptionsAB = OptionsAB::new()
         .set_b(Box::new(BBB) as Box<dyn TraitB>)
         .set_a(Box::new(AAA));

Honestly, it does seem like quite a mess. A default type will sort of over-ride inference, but for one generic type only. And you can take away that precedence from the default type too:

    // Now this is `OptionsAB<Box<AAA>, Box<dyn TraitB>>`
    // (no `dyn TraitA`)
    let dynamic_opt_ab: OptionsAB<_> = OptionsAB::new()
         //                      ^^^ new
         .set_b(Box::new(BBB) as Box<dyn TraitB>)
         .set_a(Box::new(AAA));

I guess this is expected, but I failed to find any reference on how inferences and defaults play together (or don't play together).

Issue 27336 may be related, not entirely sure. More crumb trails here. Hopefully someone else has more insight.