Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create function fo recursive type convertion #22

Open
totikom opened this issue Feb 11, 2021 · 0 comments
Open

Create function fo recursive type convertion #22

totikom opened this issue Feb 11, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@totikom
Copy link
Collaborator

totikom commented Feb 11, 2021

Today's implementation is able to handle only bare types (such as MyType) or references to bare types (&MyType and &mut MyType). I want to implement a function, which will recursively go through syn::Type instance and convert all references to Boxes.
In addition, function for recursively borrowing struct fields must be implemented.

Example:

// For function:
fn foo(a:u32, b: &MyType, (c,d):(&AnotherType, &mut i64)) {}

// This struct and function will be generated
struct __fuzz_struct_foo {
a: u32,
b: Box<MyType>,
c: Box<AnotherType>,
d: Box<i64>,
}

pub fn __fuzz_foo(mut input: __fuzz_struct_foo) {
    foo(input.a, & *input.b, (& *input.c, &mut *input.d);
}
@totikom totikom added the enhancement New feature or request label Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant