diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2017-11-20 11:09:45 -0300 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2017-12-13 06:03:26 -0500 |
| commit | c9159262d161cd64d828f7821dca5e07926e34f2 (patch) | |
| tree | 7bffc26f7aaef3bdb4607577dcaefcd7b7538fd7 | |
| parent | 7f20b9142d278c0ce68e7ce48e3ef92201c61ab4 (diff) | |
| download | rust-c9159262d161cd64d828f7821dca5e07926e34f2.tar.gz rust-c9159262d161cd64d828f7821dca5e07926e34f2.zip | |
Check NullaryOp Rvalue
| -rw-r--r-- | src/librustc_mir/transform/type_check.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/librustc_mir/transform/type_check.rs b/src/librustc_mir/transform/type_check.rs index 3599a3174f7..6c6ae3d02da 100644 --- a/src/librustc_mir/transform/type_check.rs +++ b/src/librustc_mir/transform/type_check.rs @@ -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(..) => {} } } |
