Skip to content

Commit 527d5d2

Browse files
Assert obligations are empty where they aren't generated yet
1 parent 57e5ae2 commit 527d5d2

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/librustc/middle/traits/select.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11651165
origin,
11661166
trait_bound.clone(),
11671167
ty::Binder(skol_trait_ref.clone())) {
1168-
Ok(InferOk { .. }) => { }
1168+
Ok(InferOk { obligations, .. }) => {
1169+
// FIXME Once obligations start getting generated, they ought to be propagated.
1170+
assert!(obligations.is_empty());
1171+
}
11691172
Err(_) => { return false; }
11701173
}
11711174

@@ -2454,7 +2457,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
24542457
origin,
24552458
expected_trait_ref.clone(),
24562459
obligation_trait_ref.clone()) {
2457-
Ok(InferOk { .. }) => Ok(()),
2460+
Ok(InferOk { obligations, .. }) => {
2461+
// FIXME Once obligations start getting generated, they ought tobe propagated.
2462+
assert!(obligations.is_empty());
2463+
Ok(())
2464+
},
24582465
Err(e) => Err(OutputTypeParameterMismatch(expected_trait_ref, obligation_trait_ref, e))
24592466
}
24602467
}
@@ -2771,7 +2778,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
27712778
origin,
27722779
poly_trait_ref,
27732780
obligation.predicate.to_poly_trait_ref()) {
2774-
Ok(InferOk { .. }) => Ok(()),
2781+
Ok(InferOk { obligations, .. }) => {
2782+
// FIXME Once obligations start getting generated, they ought to be propagated.
2783+
assert!(obligations.is_empty());
2784+
Ok(())
2785+
},
27752786
Err(_) => Err(()),
27762787
}
27772788
}

0 commit comments

Comments
 (0)