]> git.lizzy.rs Git - rust.git/commit - src/tools/clippy
Auto merge of #68057 - Aaron1011:fix/marker-trait-selection, r=matthewjasper
authorbors <bors@rust-lang.org>
Mon, 20 Jan 2020 00:10:48 +0000 (00:10 +0000)
committerbors <bors@rust-lang.org>
Mon, 20 Jan 2020 00:10:48 +0000 (00:10 +0000)
commit29b854fb741809c29764e33fc17c32ba9c6523ba
treedbb4a241356f69d26e238a65462724596b6cff8a
parent7da653f669dcb97d40ca29b2937518bb8a12b775
parent4840cd8117010e057109e0233f403e526d309d9f
Auto merge of #68057 - Aaron1011:fix/marker-trait-selection, r=matthewjasper

Don't discard marker trait impls when inference variables are present

Fixes #61651

Previously, we would unconditionally discard impl candidates for marker
traits during trait selection. However, if the predicate had inference
variables, this could have the effect of constrainting inference
variables (due to a successful trait selection) when we would have
otherwise failed due to mutliple applicable impls,

This commit prevents marker trait impls from being discarded while the
obligation predicate has any inference variables, ensuring that
discarding impls will never cause us to incorrectly constraint inference
variables.
src/librustc/traits/select.rs
src/librustc/ty/mod.rs