]> git.lizzy.rs Git - rust.git/commit
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)
commit741f3cf38331d4644b89d52f54c2683c17f54670
tree80abe20c55ac268dbbbffd53391bf7c4f87f078e
parent3e5965722ca46b82cc68cb1acdddf7e187a6ee02
parent4f978dbaf91e7029792dd1f7e14a851ee040aabb
Rollup merge of #103386 - compiler-errors:no-coerceunsized-to-dynstar, r=eholk

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
compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
compiler/rustc_trait_selection/src/traits/select/confirmation.rs