Add some more assertions for type relations not used during coherence
This commit is contained in:
parent
7301cd7844
commit
11adf03790
5 changed files with 13 additions and 8 deletions
|
@ -548,7 +548,7 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
|
|||
}
|
||||
|
||||
fn mark_ambiguous(&mut self) {
|
||||
self.infcx.tcx.sess.delay_span_bug(self.cause.span, "opaque types are handled in `tys`");
|
||||
self.infcx.tcx.sess.delay_span_bug(self.cause.span, "we only generalize opaque types in situations where we already error for them elsewhere in coherence");
|
||||
}
|
||||
|
||||
fn binders<T>(
|
||||
|
@ -818,7 +818,8 @@ impl<'tcx> TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
|
|||
}
|
||||
|
||||
fn intercrate(&self) -> bool {
|
||||
self.infcx.intercrate
|
||||
assert!(!self.infcx.intercrate);
|
||||
false
|
||||
}
|
||||
|
||||
fn param_env(&self) -> ty::ParamEnv<'tcx> {
|
||||
|
|
|
@ -2938,7 +2938,8 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
|
|||
}
|
||||
|
||||
fn intercrate(&self) -> bool {
|
||||
self.0.intercrate
|
||||
assert!(!self.0.intercrate);
|
||||
false
|
||||
}
|
||||
|
||||
fn param_env(&self) -> ty::ParamEnv<'tcx> {
|
||||
|
|
|
@ -31,7 +31,8 @@ impl<'tcx> TypeRelation<'tcx> for Glb<'_, '_, 'tcx> {
|
|||
}
|
||||
|
||||
fn intercrate(&self) -> bool {
|
||||
self.fields.infcx.intercrate
|
||||
assert!(!self.fields.infcx.intercrate);
|
||||
false
|
||||
}
|
||||
|
||||
fn tcx(&self) -> TyCtxt<'tcx> {
|
||||
|
@ -47,7 +48,7 @@ impl<'tcx> TypeRelation<'tcx> for Glb<'_, '_, 'tcx> {
|
|||
}
|
||||
|
||||
fn mark_ambiguous(&mut self) {
|
||||
self.fields.mark_ambiguous();
|
||||
bug!("mark_ambiguous used outside of coherence");
|
||||
}
|
||||
|
||||
fn relate_with_variance<T: Relate<'tcx>>(
|
||||
|
|
|
@ -31,7 +31,8 @@ impl<'tcx> TypeRelation<'tcx> for Lub<'_, '_, 'tcx> {
|
|||
}
|
||||
|
||||
fn intercrate(&self) -> bool {
|
||||
self.fields.infcx.intercrate
|
||||
assert!(!self.fields.infcx.intercrate);
|
||||
false
|
||||
}
|
||||
|
||||
fn tcx(&self) -> TyCtxt<'tcx> {
|
||||
|
@ -47,7 +48,7 @@ impl<'tcx> TypeRelation<'tcx> for Lub<'_, '_, 'tcx> {
|
|||
}
|
||||
|
||||
fn mark_ambiguous(&mut self) {
|
||||
self.fields.mark_ambiguous();
|
||||
bug!("mark_ambiguous used outside of coherence");
|
||||
}
|
||||
|
||||
fn relate_with_variance<T: Relate<'tcx>>(
|
||||
|
|
|
@ -914,7 +914,8 @@ where
|
|||
}
|
||||
|
||||
fn intercrate(&self) -> bool {
|
||||
self.infcx.intercrate
|
||||
assert!(!self.infcx.intercrate);
|
||||
false
|
||||
}
|
||||
|
||||
fn param_env(&self) -> ty::ParamEnv<'tcx> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue