Skip to content

Commit

Permalink
Make everything unsafe (and less public) (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
maplant authored Dec 4, 2024
1 parent e67eae9 commit 8645a60
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 117 deletions.
6 changes: 3 additions & 3 deletions proc-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn derive_trace_struct(
_ => {
return quote! {
unsafe impl ::scheme_rs::gc::Trace for #name {
unsafe fn visit_children(&self, visitor: fn(::scheme_rs::gc::OpaqueGcPtr)) {}
unsafe fn visit_children(&self, visitor: unsafe fn(::scheme_rs::gc::OpaqueGcPtr)) {}
}
}
}
Expand Down Expand Up @@ -197,7 +197,7 @@ fn derive_trace_struct(
unsafe impl<#params> ::scheme_rs::gc::Trace for #name <#unbound_params>
#where_clause
{
unsafe fn visit_children(&self, visitor: fn(::scheme_rs::gc::OpaqueGcPtr)) {
unsafe fn visit_children(&self, visitor: unsafe fn(::scheme_rs::gc::OpaqueGcPtr)) {
#(
#field_visits
)*
Expand Down Expand Up @@ -289,7 +289,7 @@ fn derive_trace_enum(name: Ident, data_enum: DataEnum) -> proc_macro2::TokenStre
.unzip();
quote! {
unsafe impl ::scheme_rs::gc::Trace for #name {
unsafe fn visit_children(&self, visitor: fn(::scheme_rs::gc::OpaqueGcPtr)) {
unsafe fn visit_children(&self, visitor: unsafe fn(::scheme_rs::gc::OpaqueGcPtr)) {
match self {
#( #visit_match_clauses )*,
_ => (),
Expand Down
Loading

0 comments on commit 8645a60

Please sign in to comment.