rust/compiler/rustc_trait_selection/src
Guillaume Gomez 06bb1ff1b5
Rollup merge of #90375 - yanok:master, r=lcnr
Use `is_global` in `candidate_should_be_dropped_in_favor_of`

This manifistated in #90195 with compiler being unable to keep
one candidate for a trait impl, if where is a global impl and more
than one trait bound in the where clause.

Before #87280 `candidate_should_be_dropped_in_favor_of` was using
`TypeFoldable::is_global()` that was enough to discard the two
`ParamCandidate`s. But #87280 changed it to use
`TypeFoldable::is_known_global()` instead, which is pessimistic, so
now the compiler drops the global impl instead (because
`is_known_global` is not sure) and then can't decide between the
two `ParamCandidate`s.

Switching it to use `is_global` again solves the issue.

Fixes #90195.
2021-10-30 20:30:27 +02:00
..
traits Reformat the changed line to make tidy happy 2021-10-28 13:23:49 +00:00
autoderef.rs Improve help for recursion limit errors 2021-09-28 22:17:13 +02:00
infer.rs Move some outlives bounds things from rustc_trait_selection to rustc_typeck 2021-10-15 12:14:19 -04:00
lib.rs Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
opaque_types.rs Move instantiate_opaque_types to rustc_infer. 2021-10-28 14:12:24 +00:00