Skip to content

Simplify autodiff handling of dependencies (rlib) #149164

@ZuseZ4

Description

@ZuseZ4

We recently landed autodiff support for rlib's.
That means, you can now use #[autodiff...] in a lib.rs file or even a dependency of your crate, use it in your main.rs file, and it still works. While discussing that last PR it was noticed that autodiff is likely a bit more complex than it has to be, so it would be good to delete the extra code.

#149033 has most of the details and introduces two FIXME's.
Especially the thread around this comment lays out how we should simplify it. To quote bjorn3:

You would only need to replace the function item with a function pointer and adjust adjust_activity_to_abi to accept the function pointer type rather than a concrete Instance and then use fn_abi_of_fn_ptr instead of fn_abi_of_instance

Metadata

Metadata

Assignees

Labels

E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.F-autodiff`#![feature(autodiff)]`

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions