Skip to content

Commit

Permalink
Merge pull request #672 from Nadrieril/fix-divergence-on-send-bound
Browse files Browse the repository at this point in the history
Skip inner obligations of `ImplSource::Builtin`
  • Loading branch information
W95Psp authored May 15, 2024
2 parents 4d4812a + 4eae5c6 commit ded17ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/exporter/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,14 @@ impl<'tcx> IntoImplExpr<'tcx> for rustc_middle::ty::PolyTraitRef<'tcx> {
ImplSource::Object(data) => {
ImplExprAtom::Dyn.with_args(impl_exprs(s, &data.nested), trait_ref)
}
ImplSource::Builtin(nested) => ImplExprAtom::Builtin {
// We ignore the contained obligations here. For example for `(): Send`, the
// obligations contained would be `[(): Send]`, which leads to an infinite loop. There
// might be important obligation shere inother cases; we'll have to see if that comes
// up.
ImplSource::Builtin(_ignored) => ImplExprAtom::Builtin {
r#trait: self.skip_binder().sinto(s),
}
.with_args(impl_exprs(s, &nested), trait_ref),
.with_args(vec![], trait_ref),
x => ImplExprAtom::Todo(format!(
"ImplExprAtom::Todo(see https://github.com/hacspec/hax/issues/381) {:#?}\n\n{:#?}",
x, self
Expand Down

0 comments on commit ded17ea

Please sign in to comment.