don't deref in the macros

This commit is contained in:
edef 2014-12-24 06:24:27 +01:00
parent 5a06b04a6a
commit 621bd9c9ab
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ pub fn initialise_call_frame(stack: &mut Stack, init: uintptr_t, args: &[uintptr
.. Registers::new() .. Registers::new()
}; };
match into_fields!(regs { rdi, r13, r14, r15 } <- args.iter()) { match into_fields!(regs { rdi, r13, r14, r15 } <- args.iter().cloned()) {
Some(mut args) => if args.next().is_some() { Some(mut args) => if args.next().is_some() {
panic!("too many arguments") panic!("too many arguments")
}, },

View File

@ -2,7 +2,7 @@ macro_rules! __into_fields {
($x:ident { $field:ident } <- $iter:ident) => { ($x:ident { $field:ident } <- $iter:ident) => {
match $iter.next() { match $iter.next() {
Some(value) => { Some(value) => {
$x.$field = *value; $x.$field = value;
Some($iter) Some($iter)
} }
None => None None => None
@ -11,7 +11,7 @@ macro_rules! __into_fields {
($x:ident { $field:ident, $($fields_rest:ident),* } <- $iter:ident) => { ($x:ident { $field:ident, $($fields_rest:ident),* } <- $iter:ident) => {
match $iter.next() { match $iter.next() {
Some(value) => { Some(value) => {
$x.$field = *value; $x.$field = value;
__into_fields!($x { $($fields_rest),* } <- $iter) __into_fields!($x { $($fields_rest),* } <- $iter)
} }
None => None None => None