Check NullaryOp Rvalue

This commit is contained in:
Santiago Pastorino 2017-11-20 11:09:45 -03:00 committed by Niko Matsakis
parent 7f20b9142d
commit c9159262d1

View file

@ -1137,6 +1137,15 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
}
}
Rvalue::NullaryOp(_, ty) => {
let trait_ref = ty::TraitRef {
def_id: tcx.lang_items().sized_trait().unwrap(),
substs: tcx.mk_substs_trait(ty, &[]),
};
self.prove_trait_ref(trait_ref, location);
}
// FIXME: These other cases have to be implemented in future PRs
Rvalue::Use(..) |
Rvalue::Ref(..) |
@ -1145,8 +1154,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
Rvalue::BinaryOp(..) |
Rvalue::CheckedBinaryOp(..) |
Rvalue::UnaryOp(..) |
Rvalue::Discriminant(..) |
Rvalue::NullaryOp(..) => {}
Rvalue::Discriminant(..) => {}
}
}