File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1756,10 +1756,14 @@ impl TableCollection {
17561756 }
17571757
17581758 // convert sys version of tables to non-sys version of tables
1759- let new_edges = EdgeTable :: new_from_table ( new_edges. as_mut ( ) ) ?;
1760- let new_migrations = MigrationTable :: new_from_table ( new_migrations. as_mut ( ) ) ?;
1761- let new_mutations = MutationTable :: new_from_table ( new_mutations. as_mut ( ) ) ?;
1762- let new_sites = SiteTable :: new_from_table ( new_sites. as_mut ( ) ) ?;
1759+ // SAFETY: all the casts to *mut Foo are coming in via an implicit
1760+ // cast from &mut Foo, which means that the ptr cannot be NULL.
1761+ // Further, all input tables are initialized.
1762+ // Finally, none of these variables will be every be pub.
1763+ let new_edges = unsafe { EdgeTable :: new_from_table ( new_edges. as_mut ( ) ) ? } ;
1764+ let new_migrations = unsafe { MigrationTable :: new_from_table ( new_migrations. as_mut ( ) ) ? } ;
1765+ let new_mutations = unsafe { MutationTable :: new_from_table ( new_mutations. as_mut ( ) ) ? } ;
1766+ let new_sites = unsafe { SiteTable :: new_from_table ( new_sites. as_mut ( ) ) ? } ;
17631767
17641768 // replace old tables with new tables
17651769 tables. set_edges ( & new_edges) . map ( |_| ( ) ) ?;
You can’t perform that action at this time.
0 commit comments