Skip to content

Translate default pointers in globals#63

Merged
nunoplopes merged 3 commits into
Cpp2Rust:masterfrom
lucic71:null-static
May 10, 2026
Merged

Translate default pointers in globals#63
nunoplopes merged 3 commits into
Cpp2Rust:masterfrom
lucic71:null-static

Conversation

@lucic71
Copy link
Copy Markdown
Contributor

@lucic71 lucic71 commented May 9, 2026

Previously, we used Default::default() for initializing pointers to null. This is not compatible with initializing global variables because they are declared in static context. In static context, only const functions can be used. Default::default() is not const, std::ptr::null()/null_mut() are const.

@nunoplopes nunoplopes merged commit 999aabf into Cpp2Rust:master May 10, 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