]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #103386 - compiler-errors:no-coerceunsized-to-dynstar, r=eholk
authorMatthias Krüger <matthias.krueger@famsik.de>
Fri, 18 Nov 2022 13:13:35 +0000 (14:13 +0100)
committerGitHub <noreply@github.com>
Fri, 18 Nov 2022 13:13:35 +0000 (14:13 +0100)
Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting)

This makes sure we don't accidentally allow coercions like `Box<T>` -> `Box<dyn* Trait>`, or in the case of this ICE, `&T` to `&dyn* Trait`. These coercions don't make sense, at least not via the `CoerceUnsized` trait.

Fixes #102172
Fixes #102429

1  2 
compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
compiler/rustc_trait_selection/src/traits/select/confirmation.rs