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
@ -157,10 +157,18 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut region_constraints = QueryRegionConstraints::default();
|
let mut region_constraints = QueryRegionConstraints::default();
|
||||||
let (output, error_info, mut obligations, _) =
|
let (output, error_info, mut obligations) =
|
||||||
Q::fully_perform_into(self, infcx, &mut region_constraints).map_err(|_| {
|
Q::fully_perform_into(self, infcx, &mut region_constraints)
|
||||||
infcx.tcx.sess.delay_span_bug(span, format!("error performing {self:?}"))
|
.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
|
// Typically, instantiating NLL query results does not
|
||||||
// create obligations. However, in some cases there
|
// create obligations. However, in some cases there
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
error: internal compiler error: no errors encountered even though `delay_span_bug` issued
|
||||||
|
|
||||||
|
error: internal compiler error: ambiguity performing ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: ProvePredicate { predicate: Binder { value: ProjectionPredicate(AliasTy { args: [FnDef(DefId(get_rpit), []), ()], def_id: DefId(ops::function::FnOnce::Output) }, Term::Ty(Alias(Opaque, AliasTy { args: [], def_id: DefId(Opaque::{opaque#0}) }))), bound_vars: [] } } }
|
||||||
|
--> $DIR/rpit_tait_equality_in_canonical_query.rs:28:5
|
||||||
|
|
|
||||||
|
LL | query(get_rpit);
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
--> $DIR/rpit_tait_equality_in_canonical_query.rs:28:5
|
||||||
|
|
|
||||||
|
LL | query(get_rpit);
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
query stack during panic:
|
||||||
|
end of query stack
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
@ -7,7 +7,14 @@
|
|||||||
|
|
||||||
// revisions: current next
|
// revisions: current next
|
||||||
//[next] compile-flags: -Ztrait-solver=next
|
//[next] compile-flags: -Ztrait-solver=next
|
||||||
// check-pass
|
//[next] check-pass
|
||||||
|
|
||||||
|
//[current] known-bug: #108498
|
||||||
|
//[current] failure-status: 101
|
||||||
|
//[current] normalize-stderr-test: "DefId\(.*?\]::" -> "DefId("
|
||||||
|
//[current] normalize-stderr-test: "(?m)^note: .*\n" -> ""
|
||||||
|
//[current] normalize-stderr-test: "(?m)^ *\d+: .*\n" -> ""
|
||||||
|
//[current] normalize-stderr-test: "(?m)^ *at .*\n" -> ""
|
||||||
|
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user