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

Handle incomplete external array constants #2301

Merged

Conversation

pvdrz
Copy link
Contributor

@pvdrz pvdrz commented Oct 7, 2022

This adds a new special case for constants like:

extern const char some_static_string[];

so bindgen emits a static instead of a static mut for them.

Fixes: #2290

This adds a new special case for constants like:
```c
extern const char some_static_string[];
```
so `bindgen` emits a `static` instead of a `static mut` for them.
@pvdrz pvdrz requested a review from emilio October 7, 2022 17:11
Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@emilio emilio merged commit 17dd093 into rust-lang:master Oct 16, 2022
@pvdrz pvdrz deleted the handle-external-incomplete-arrays branch October 18, 2022 15:48
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.

const T some_array[]; is compiled as static mut some_array: [T; 0usize];, which seems wrong.
2 participants