summaryrefslogtreecommitdiffstats
path: root/tests/rust/const_generics_char.rs
blob: 85bff32fb93b21149379a303fd7444cfc97b5ce1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std::marker::PhantomData;

#[repr(C)]
struct TakeUntil<'a, const V: char>
{
    marker: PhantomData<&'a str>,
    start: *const u8,
    len: usize,
    point: usize,
}

#[no_mangle]
pub unsafe extern "C" fn until_nul(start: *const u8, len: usize) -> TakeUntil<'a, '\0'> {
    TakeUntil {
        marker: PhantomData,
        start,
        len,
        point: 0,
    }
}