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

Work around a libclang bug / limitation. #1531

Merged
merged 1 commit into from
Mar 6, 2019
Merged

Conversation

emilio
Copy link
Contributor

@emilio emilio commented Mar 6, 2019

For references, libclang returns the size and align of the pointee.

This actually matches how C++'s sizeof() and alignof() works, for some reason,
though in this case we really want to know the pointer's layout.

Anyhow, we know the target pointer size, so manually handle this case.

Filed https://bugs.llvm.org/show_bug.cgi?id=40975 for this.

@highfive
Copy link

highfive commented Mar 6, 2019

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

For references, libclang returns the size and align of the pointee.

This actually matches how C++'s sizeof() and alignof() works, for some reason,
though in this case we really want to know the pointer's layout.

Anyhow, we know the target pointer size, so manually handle this case.

Filed https://bugs.llvm.org/show_bug.cgi?id=40975 for this.
@emilio emilio changed the title Work around a libclang bug. Work around a libclang bug / limitation. Mar 6, 2019
@emilio emilio merged commit 185a5f3 into rust-lang:master Mar 6, 2019
@emilio emilio deleted the ref-layout branch March 6, 2019 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants