We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Sized
program_clauses
1 parent dfcad82 commit e5992e7Copy full SHA for e5992e7
src/librustc_traits/chalk_context/program_clauses.rs
@@ -280,7 +280,10 @@ fn wf_clause_for_tuple<'tcx>(
280
Some(def_id) => def_id,
281
None => return ty::List::empty(),
282
};
283
- let sized_implemented = type_list[0..arity - 1].iter()
+
284
+ // If `arity == 0` (i.e. the unit type) or `arity == 1`, this list of
285
+ // hypotheses is actually empty.
286
+ let sized_implemented = type_list[0 .. std::cmp::max(arity, 1) - 1].iter()
287
.map(|ty| ty::TraitRef {
288
def_id: sized_trait,
289
substs: tcx.mk_substs_trait(*ty, ty::List::empty()),
0 commit comments