diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2023-02-24 12:02:42 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-24 12:02:42 +0530 |
| commit | 251293ef5e563b11fc7d46b6e1a31ef740f26455 (patch) | |
| tree | d6e5944a73ecf5a78c5d3d9f0d64564af46a70dc /compiler/rustc_query_impl/src | |
| parent | 440113ddf68522a3cecac66dc3cd0bdf88718013 (diff) | |
| parent | eb1f9babecbe51b7580e71ed8e558ff40eeee96c (diff) | |
| download | rust-251293ef5e563b11fc7d46b6e1a31ef740f26455.tar.gz rust-251293ef5e563b11fc7d46b6e1a31ef740f26455.zip | |
Rollup merge of #108287 - compiler-errors:new-solver-bad-cast, r=spastorino
Add test for bad cast with deferred projection equality 1. Unification during coercion (`Coerce::unify`) needs to consider deferred projection obligations (at least pass over them with `predicate_may_hold` or something, to disqualify any totally wrong unifications) -- otherwise, we'll shallowly consider `<u8 as Add>::Output` and `char` as coercible during `FnCtxt::try_coerce`, which will fail later when the nested obligations are registered and processed. 2. Cast checking needs to be able to structurally normalize types so it sees `u8` instead of `<u8 as Add>::Output`. Otherwise it'll always consider the latter as part of a non-primitive cast. Currently `FnCtxt::normalize` doesn't do anything useful here, interestingly. I tried looking into both of these and it's not immediately clear where to refactor existing typeck code to fix this (at least the latter), but I'm gonna commit a test for it at least so we don't forget. This is one of the issues that's keeping us from building larger projects.
Diffstat (limited to 'compiler/rustc_query_impl/src')
0 files changed, 0 insertions, 0 deletions
