Skip to content

Commit a4d72e5

Browse files
committed
feat(Location): Add null ptr creator
1 parent 08e404d commit a4d72e5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/location.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ impl<'ctx> fmt::Debug for Location<'ctx> {
2626
}
2727
}
2828

29+
impl<'ctx> Location<'ctx> {
30+
pub fn null<'a>() -> Self {
31+
Location {
32+
marker: std::marker::PhantomData,
33+
ptr: unsafe { core::ptr::null_mut() },
34+
}
35+
}
36+
}
37+
2938
pub unsafe fn from_ptr<'ctx>(ptr: *mut gccjit_sys::gcc_jit_location) -> Location<'ctx> {
3039
Location {
3140
marker: PhantomData,

0 commit comments

Comments
 (0)