mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
Don't use global caches if opaques can be defined
This commit is contained in:
parent
08a9ca7c18
commit
61b5e11c47
@ -1498,7 +1498,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Avoid using the master cache during coherence and just rely
|
// Avoid using the global cache during coherence and just rely
|
||||||
// on the local cache. This effectively disables caching
|
// on the local cache. This effectively disables caching
|
||||||
// during coherence. It is really just a simplification to
|
// during coherence. It is really just a simplification to
|
||||||
// avoid us having to fear that coherence results "pollute"
|
// avoid us having to fear that coherence results "pollute"
|
||||||
@ -1509,6 +1509,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoid using the global cache when we're defining opaque types
|
||||||
|
// as their hidden type may impact the result of candidate selection.
|
||||||
|
if !self.infcx.defining_opaque_types().is_empty() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Otherwise, we can use the global cache.
|
// Otherwise, we can use the global cache.
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
//@ known-bug: #119272
|
//! used to ICE: #119272
|
||||||
|
|
||||||
|
//@ check-pass
|
||||||
|
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
mod defining_scope {
|
mod defining_scope {
|
||||||
use super::*;
|
use super::*;
|
Loading…
Reference in New Issue
Block a user