]> git.lizzy.rs Git - rust.git/commitdiff
Merge #3263
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Sat, 22 Feb 2020 12:31:30 +0000 (12:31 +0000)
committerGitHub <noreply@github.com>
Sat, 22 Feb 2020 12:31:30 +0000 (12:31 +0000)
3263: Implement unsizing coercions using Chalk r=matklad a=flodiebold

These are coercions like `&[T; n] -> &[T]`, which are handled by the `Unsize` and `CoerceUnsized` traits. The impls for `Unsize` are all built in to the compiler and require special handling, so we need to provide them to Chalk.

This adds the following `Unsize` impls:
 - `Unsize<[T]> for [T; _]`
 - `Unsize<dyn Trait> for T where T: Trait`
 - `Unsize<dyn SuperTrait> for dyn SubTrait`

Hence we are still missing the 'unsizing the last field of a generic struct' case.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Co-authored-by: Florian Diebold <flodiebold@gmail.com>

Trivial merge