Gotchas and warts in Rust Lang (IMHO).
impl Fn(&Foo) type.
impl Trait bindings could help but are currently dis-implemented'static) vs return position (can default to input lifetime)<'_>, RFC 2115)dyn Trait lifetime elision
'static'_ wildcard elisionSelf or associated typesimpl Traitimpl Trait (APIT)
impl Trait "leaks" auto-traits
async issuedyn Trait's lifetime intersection is desired but has not yet materialized. Rust teams unwilling to stabilize a work-around in the meanwhile.dyn TraitUnsize a dynamically sized type, so you can't make a dyn Trait out of a [T], str, etc.
Box<str>, &String, ...) is sometimes an option insteadUnsafeCellwhere Self: Sized as a coarse approximation for where Self: !Dyn
dyn ThisTrait, but dyn AnyTrait, str, [T], ...dyn Trait "is" the trait vs. the reality: dyn Trait is a distinct, concrete type?
dyn Trait that doesn't implement Trait
ControlFlow parameter order
Try/? operatorResult_ does not bind
let _ = ... is different from let _name = ...stdlib types utilizing RFC 1327 (#[may_dangle])#[may_dangle] stabilization would help someTrait<Assoc = Type> form (the Assoc can only be an identifier)
dyn Trait<Assoc=X, Assoc=Y> cannot compilei32 but fallback float is f64
Fn(u32) and the likefn(u32)/fn(x: u32) and the likefn foo(x: u32) and the like
default for default impl because this is "less confusing" than calling them partial impldefault implicit on the implementations withinbstr crate for [u8]OsStringdyn Trait generally&mut -> & function semantics
. operator works
Gotchas and warts in Rust Lang (IMHO).
impl Fn(&Foo) type.
impl Trait bindings could help but are currently dis-implemented'static) vs return position (can default to input lifetime)<'_>, RFC 2115)dyn Trait lifetime elision
'static'_ wildcard elisionSelf or associated typesimpl Traitimpl Trait (APIT)
impl Trait "leaks" auto-traits
async issuedyn Trait's lifetime intersection is desired but has not yet materialized. Rust teams unwilling to stabilize a work-around in the meanwhile.dyn TraitUnsize a dynamically sized type, so you can't make a dyn Trait out of a [T], str, etc.
Box<str>, &String, ...) is sometimes an option insteadUnsafeCellwhere Self: Sized as a coarse approximation for where Self: !Dyn
dyn ThisTrait, but dyn AnyTrait, str, [T], ...dyn Trait "is" the trait vs. the reality: dyn Trait is a distinct, concrete type?
dyn Trait that doesn't implement Trait
ControlFlow parameter order
Try/? operatorResult_ does not bind
let _ = ... is different from let _name = ...stdlib types utilizing RFC 1327 (#[may_dangle])#[may_dangle] stabilization would help someTrait<Assoc = Type> form (the Assoc can only be an identifier)
dyn Trait<Assoc=X, Assoc=Y> cannot compilei32 but fallback float is f64
Fn(u32) and the likefn(u32)/fn(x: u32) and the likefn foo(x: u32) and the like
default for default impl because this is "less confusing" than calling them partial impldefault implicit on the implementations withinbstr crate for [u8]OsStringdyn Trait generally&mut -> & function semantics
. operator works