Make VTab / VTabCursor unsafe trait as implmenting them on the wrong type is unsound

This commit is contained in:
Thom Chiovoloni
2020-04-14 07:39:41 -07:00
committed by Thom Chiovoloni
parent 3c6b57fe1b
commit c9ef5bd63c
4 changed files with 13 additions and 9 deletions

View File

@@ -71,7 +71,7 @@ struct ArrayTab {
base: ffi::sqlite3_vtab,
}
impl VTab for ArrayTab {
unsafe impl VTab for ArrayTab {
type Aux = ();
type Cursor = ArrayTabCursor;
@@ -149,7 +149,7 @@ impl ArrayTabCursor {
}
}
}
impl VTabCursor for ArrayTabCursor {
unsafe impl VTabCursor for ArrayTabCursor {
fn filter(&mut self, idx_num: c_int, _idx_str: Option<&str>, args: &Values<'_>) -> Result<()> {
if idx_num > 0 {
self.ptr = args.get_array(0)?;