rust/compiler/rustc_infer
Matthias Krüger 145e6204bc
Rollup merge of #108947 - compiler-errors:ct-infer-no-shapeshifting, r=BoxyUwU
Don't even try to combine consts with incompatible types

~I left a more detailed explanation for why this fixes this issue in the UI test, but in general, we should not try to unify const infer vars and rigid consts if they have incompatible types. That's because we don't want something like a `ConstArgHasType` predicate to suddenly go from passing to failing, or vice versa, due to a shallow resolve.~

1. Use the `type_of` for a parameter in `try_eval_lit_or_param`, instead of the "expected" type from a `WithOptConstParam` def id.
2. Don't combine consts that have incompatible types.

Fixes #108781
2023-03-10 19:59:20 +01:00
..
locales Auto merge of #108709 - matthiaskrgr:rollup-j2tjbyx, r=matthiaskrgr 2023-03-03 22:45:58 +00:00
src Rollup merge of #108947 - compiler-errors:ct-infer-no-shapeshifting, r=BoxyUwU 2023-03-10 19:59:20 +01:00
Cargo.toml remove unused imports 2023-02-06 17:40:18 +03:00