From 540a069761c1184ee2998f23a24b76c97c274043 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Wed, 12 Apr 2017 00:44:17 +0300 Subject: [PATCH] address review comments --- src/librustc_mir/transform/type_check.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc_mir/transform/type_check.rs b/src/librustc_mir/transform/type_check.rs index f209b93cee1..bfb08de56d8 100644 --- a/src/librustc_mir/transform/type_check.rs +++ b/src/librustc_mir/transform/type_check.rs @@ -666,6 +666,10 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { let span = local_decl.source_info.span; let ty = local_decl.ty; if !ty.is_sized(self.tcx().global_tcx(), self.infcx.param_env(), span) { + // in current MIR construction, all non-control-flow rvalue + // expressions evaluate through `as_temp` or `into` a return + // slot or local, so to find all unsized rvalues it is enough + // to check all temps, return slots and locals. if let None = self.reported_errors.replace((ty, span)) { span_err!(self.tcx().sess, span, E0161, "cannot move a value of type {0}: the size of {0} \