]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
authorMatthias Krüger <matthias.krueger@famsik.de>
Fri, 20 Jan 2023 06:16:09 +0000 (07:16 +0100)
committerGitHub <noreply@github.com>
Fri, 20 Jan 2023 06:16:09 +0000 (07:16 +0100)
commit240cc81768f678bb4a6f8369080ef77515971963
tree3865dd40c55787cd506df103378cbba565cf9a4c
parentdf88f7e02c1e9a1e543e5c4767f0d5212c00182d
parent42f1f54a5e15616f23d22d09cbdd510ee3d5f789
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr

Don't treat closures from other crates as local

fixes #104817

r? `@lcnr`

Specialization can prefer an impl for an opaque type over a blanket impls that also matches. If the blanket impl only applies if an auto-trait applies, we look at the hidden type of the opaque type to see if that implements the auto trait. The hidden type can be a closure or generator, and thus we will end up seeing these types in coherence and have to handle them properly.
compiler/rustc_trait_selection/src/traits/coherence.rs