diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-02-20 13:10:54 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-03-03 12:10:57 +0100 |
| commit | faf3bcd72c85774805ae0e84d0458aa3e67b20e4 (patch) | |
| tree | bee7a1833b37e74c58b9183012c3a286c15db8fd /src/libsyntax | |
| parent | f0404c39f272868c1dedc7cda7b0b6dffcb5713d (diff) | |
| download | rust-faf3bcd72c85774805ae0e84d0458aa3e67b20e4.tar.gz rust-faf3bcd72c85774805ae0e84d0458aa3e67b20e4.zip | |
Accommodate simple cases of arith-overflow in `rustc` related crates.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/deriving/encodable.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs index 94b7d1b4d8c..17687534d75 100644 --- a/src/libsyntax/ext/deriving/encodable.rs +++ b/src/libsyntax/ext/deriving/encodable.rs @@ -181,7 +181,6 @@ fn encodable_substructure(cx: &mut ExtCtxt, trait_span: Span, Struct(ref fields) => { let emit_struct_field = cx.ident_of("emit_struct_field"); let mut stmts = Vec::new(); - let last = fields.len() - 1; for (i, &FieldInfo { name, ref self_, @@ -204,6 +203,7 @@ fn encodable_substructure(cx: &mut ExtCtxt, trait_span: Span, lambda)); // last call doesn't need a try! + let last = fields.len() - 1; let call = if i != last { cx.expr_try(span, call) } else { |
