Skip to content

Commit 540a069

Browse files
committed
address review comments
1 parent 0144613 commit 540a069

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/transform/type_check.rs

+4
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,10 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
666666
let span = local_decl.source_info.span;
667667
let ty = local_decl.ty;
668668
if !ty.is_sized(self.tcx().global_tcx(), self.infcx.param_env(), span) {
669+
// in current MIR construction, all non-control-flow rvalue
670+
// expressions evaluate through `as_temp` or `into` a return
671+
// slot or local, so to find all unsized rvalues it is enough
672+
// to check all temps, return slots and locals.
669673
if let None = self.reported_errors.replace((ty, span)) {
670674
span_err!(self.tcx().sess, span, E0161,
671675
"cannot move a value of type {0}: the size of {0} \

0 commit comments

Comments
 (0)