Fix non-closure rust-call functions and fix a field projection bug
This commit is contained in:
parent
d470a61d0b
commit
ebaa122d34
4 changed files with 108 additions and 46 deletions
20
example.rs
20
example.rs
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue