Fix bad caching of ~const Drop
bounds
This commit is contained in:
parent
99b0799608
commit
aaaad5b46b
3 changed files with 41 additions and 3 deletions
|
@ -730,7 +730,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
let mut param_env = obligation.param_env;
|
||||
|
||||
fresh_trait_pred = fresh_trait_pred.map_bound(|mut pred| {
|
||||
param_env = param_env.with_constness(pred.constness.and(param_env.constness()));
|
||||
pred.remap_constness(self.tcx(), &mut param_env);
|
||||
pred
|
||||
});
|
||||
|
||||
|
@ -1269,7 +1269,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
}
|
||||
let tcx = self.tcx();
|
||||
let mut pred = cache_fresh_trait_pred.skip_binder();
|
||||
param_env = param_env.with_constness(pred.constness.and(param_env.constness()));
|
||||
pred.remap_constness(tcx, &mut param_env);
|
||||
|
||||
if self.can_use_global_caches(param_env) {
|
||||
if let Some(res) = tcx.selection_cache.get(¶m_env.and(pred), tcx) {
|
||||
|
@ -1322,7 +1322,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
let tcx = self.tcx();
|
||||
let mut pred = cache_fresh_trait_pred.skip_binder();
|
||||
|
||||
param_env = param_env.with_constness(pred.constness.and(param_env.constness()));
|
||||
pred.remap_constness(tcx, &mut param_env);
|
||||
|
||||
if !self.can_cache_candidate(&candidate) {
|
||||
debug!(?pred, ?candidate, "insert_candidate_cache - candidate is not cacheable");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue