Fix non-closure rust-call functions and fix a field projection bug

This commit is contained in:
bjorn3 2018-07-27 19:27:20 +02:00
parent d470a61d0b
commit ebaa122d34
4 changed files with 108 additions and 46 deletions

View file

@ -1,4 +1,4 @@
#![feature(no_core)]
#![feature(no_core, unboxed_closures)]
#![no_core]
#![allow(dead_code)]
@ -122,6 +122,24 @@ fn call_closure_2arg() {
})(0u8, 42u16)
}
struct IsNotEmpty;
impl<'a, 'b> FnOnce<(&'a &'b [u16], )> for IsNotEmpty {
type Output = bool;
#[inline]
extern "rust-call" fn call_once(mut self, arg: (&'a &'b [u16], )) -> bool {
self.call_mut(arg)
}
}
impl<'a, 'b> FnMut<(&'a &'b [u16], )> for IsNotEmpty {
#[inline]
extern "rust-call" fn call_mut(&mut self, arg: (&'a &'b [u16], )) -> bool {
true
}
}
fn eq_char(a: char, b: char) -> bool {
a == b
}