Skip to content

Avoid extremely long names in overloaded methods - #431

Merged
nunoplopes merged 5 commits into
Cpp2Rust:masterfrom
lucic71:overload-refcount
Sep 29, 2026
Merged

nunoplopes merged 5 commits into
Cpp2Rust:masterfrom
lucic71:overload-refcount

Conversation

@lucic71

@lucic71 lucic71 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
-   pub unsafe fn apply_Optionunsafefnpmuti32_i32__i32_const(
-        &self,
-        mut f: Option<unsafe fn(*mut i32, i32)>,
-        mut x: i32,
-    ) -> i32 {
+    pub unsafe fn apply_11(&self, mut f: Option<unsafe fn(*mut i32, i32)>, mut x: i32) -> i32 {

This generates more readable names and avoid special-casing characters in the mangled name.
Also it fixes a problem in the codegen where a template is visited before the type it's instantiated with.

@nunoplopes

Copy link
Copy Markdown
Contributor

It would be great if the index could be skipped for non-overloaded methods.

@lucic71

lucic71 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

It would be great if the index could be skipped for non-overloaded methods.

It is, only overloaded get the index: https://github.com/Cpp2Rust/cpp2rust/pull/431/changes#diff-f772e2354c6403a95f445fd46043801b7f8128c9953f2fcf8b4860565d8c75e0R94

@nunoplopes
nunoplopes merged commit 4c824c3 into Cpp2Rust:master Sep 29, 2026
4 of 8 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