inline-asm: emit as many E0669 errors as we can

Signed-off-by: Levente Kurusa <lkurusa@acm.org>
This commit is contained in:
Levente Kurusa 2018-10-28 23:57:45 +01:00
parent 4d7f08b170
commit 32ee20f455
No known key found for this signature in database
GPG key ID: 28D6B15E6B491269

View file

@ -84,21 +84,18 @@ impl FunctionCx<'a, 'll, 'tcx> {
}).collect();
let input_vals = inputs.iter()
.try_fold(Vec::with_capacity(inputs.len()), |mut acc, (span, input)| {
.fold(Vec::with_capacity(inputs.len()), |mut acc, (span, input)| {
let op = self.codegen_operand(&bx, input);
if let OperandValue::Immediate(_) = op.val {
acc.push(op.immediate());
Ok(acc)
} else {
Err(span)
span_err!(bx.sess(), span.to_owned(), E0669,
"invalid value for constraint in inline assembly");
}
acc
});
if let Err(span) = input_vals {
span_err!(bx.sess(), span.to_owned(), E0669,
"invalid value for constraint in inline assembly");
} else {
let input_vals = input_vals.unwrap();
if input_vals.len() == inputs.len() {
let res = asm::codegen_inline_asm(&bx, asm, outputs, input_vals);
if !res {
span_err!(bx.sess(), statement.source_info.span, E0668,