Skip to content

Remove duplicated lamda/function pointer rules - #373

Merged
nunoplopes merged 9 commits into
Cpp2Rust:masterfrom
lucic71:fnptr
Sep 16, 2026
Merged

nunoplopes merged 9 commits into
Cpp2Rust:masterfrom
lucic71:fnptr

Conversation

@lucic71

@lucic71 lucic71 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

stable_sort rules had 2 version of rules: one that takes a lambda and one that takes a function pointer. This PR removes the duplication by adding a new trait in libcc2rs: Callable.

Callable is implemented by Fn (closures, safe function items, safe function pointers) and unsafe fn pointers. Unsafe functoin items reach the Callable trait to an explicit cast to unsafe fn pointers because they don't implement Fn.

@nunoplopes
nunoplopes merged commit 0f65864 into Cpp2Rust:master Sep 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants