lalbuild / lal

A strict, language-agnostic build system and dependency manager
MIT License
4 stars 1 forks source link

Use `dyn Trait` syntax, remove `?Sized` #49

Closed bencord0 closed 4 years ago

bencord0 commented 4 years ago

As per RFC2113 &dyn Trait syntax is now the preferred idiom for many of the use-cases we have for passing the Backends around.

https://github.com/rust-lang/rfcs/blob/master/text/2113-dyn-trait-syntax.md#the-current-syntax-is-often-ambiguous-and-confusing


For us, this means that patterns such as

fn func<T: CachedBackend + ?Sized>(backend: &T)

becomes

fn func(backend: &dyn CachedBackend)

The ?Sized trait bound can also be removed. In most areas of the code, we use Boxed trait objects, which are Sized.