Skip to content

Commit 32ee20f

Browse files
committed
inline-asm: emit as many E0669 errors as we can
Signed-off-by: Levente Kurusa <[email protected]>
1 parent 4d7f08b commit 32ee20f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/librustc_codegen_llvm/mir/statement.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,18 @@ impl FunctionCx<'a, 'll, 'tcx> {
8484
}).collect();
8585

8686
let input_vals = inputs.iter()
87-
.try_fold(Vec::with_capacity(inputs.len()), |mut acc, (span, input)| {
87+
.fold(Vec::with_capacity(inputs.len()), |mut acc, (span, input)| {
8888
let op = self.codegen_operand(&bx, input);
8989
if let OperandValue::Immediate(_) = op.val {
9090
acc.push(op.immediate());
91-
Ok(acc)
9291
} else {
93-
Err(span)
92+
span_err!(bx.sess(), span.to_owned(), E0669,
93+
"invalid value for constraint in inline assembly");
9494
}
95+
acc
9596
});
9697

97-
if let Err(span) = input_vals {
98-
span_err!(bx.sess(), span.to_owned(), E0669,
99-
"invalid value for constraint in inline assembly");
100-
} else {
101-
let input_vals = input_vals.unwrap();
98+
if input_vals.len() == inputs.len() {
10299
let res = asm::codegen_inline_asm(&bx, asm, outputs, input_vals);
103100
if !res {
104101
span_err!(bx.sess(), statement.source_info.span, E0668,

0 commit comments

Comments
 (0)