Rollup merge of #116530 - aliemjay:ice-on-ambiguity, r=compiler-errors
delay a bug when encountering an ambiguity in MIR typeck We shouldn't have any trait selection ambiguities in MIR typeck. See https://github.com/rust-lang/rust/pull/114586#issuecomment-1751967321 r? `@oli-obk` `@compiler-errors` `@lcnr`
This commit is contained in:
commit
a7042a94a3
3 changed files with 40 additions and 5 deletions
|
@ -157,10 +157,18 @@ where
|
|||
}
|
||||
|
||||
let mut region_constraints = QueryRegionConstraints::default();
|
||||
let (output, error_info, mut obligations, _) =
|
||||
Q::fully_perform_into(self, infcx, &mut region_constraints).map_err(|_| {
|
||||
infcx.tcx.sess.delay_span_bug(span, format!("error performing {self:?}"))
|
||||
})?;
|
||||
let (output, error_info, mut obligations) =
|
||||
Q::fully_perform_into(self, infcx, &mut region_constraints)
|
||||
.map_err(|_| {
|
||||
infcx.tcx.sess.delay_span_bug(span, format!("error performing {self:?}"))
|
||||
})
|
||||
.and_then(|(output, error_info, obligations, certainty)| match certainty {
|
||||
Certainty::Proven => Ok((output, error_info, obligations)),
|
||||
Certainty::Ambiguous => Err(infcx
|
||||
.tcx
|
||||
.sess
|
||||
.delay_span_bug(span, format!("ambiguity performing {self:?}"))),
|
||||
})?;
|
||||
|
||||
// Typically, instantiating NLL query results does not
|
||||
// create obligations. However, in some cases there
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue