]> git.lizzy.rs Git - rust.git/commit
Auto merge of #55356 - Aaron1011:fix/rustdoc-negative-auto, r=nikomatsakis
authorbors <bors@rust-lang.org>
Tue, 13 Nov 2018 19:16:18 +0000 (19:16 +0000)
committerbors <bors@rust-lang.org>
Tue, 13 Nov 2018 19:16:18 +0000 (19:16 +0000)
commit9fefb67669f00c25b476e7a80c9c9300a987d517
treeac52853cd239af068c447b627a9c4836d0ca4321
parent5c9f7dcd8307f92931bc7e5534b467063b4ecc76
parent56acb2a00180c1e041e03e48c1c1818c305e13c6
Auto merge of #55356 - Aaron1011:fix/rustdoc-negative-auto, r=nikomatsakis

Check for negative impls when finding auto traits

Fixes #55321

When AutoTraitFinder begins examining a type, it checks for an explicit
negative impl. However, it wasn't checking for negative impls found when
calling 'select' on predicates found from nested obligations.

This commit makes AutoTraitFinder check for negative impls whenever it
makes a call to 'select'. If a negative impl is found, it immediately
bails out.

Normal users of SelectioContext don't need to worry about this, since
they stop as soon as an Unimplemented error is encountered. However, we
add predicates to our ParamEnv when we encounter this error, so we need
to handle negative impls specially (so that we don't try adding them to
our ParamEnv).
src/librustc/traits/auto_trait.rs