-
Notifications
You must be signed in to change notification settings - Fork 698
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
ir: Don't assume wchar is 2 bytes. #1346
Conversation
r? @fitzgen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one question inline below. Thanks @emilio :)
@@ -2978,6 +2978,12 @@ impl TryToRustTy for Type { | |||
IntKind::ULong => Ok(raw_type(ctx, "c_ulong")), | |||
IntKind::LongLong => Ok(raw_type(ctx, "c_longlong")), | |||
IntKind::ULongLong => Ok(raw_type(ctx, "c_ulonglong")), | |||
IntKind::WChar { size } => { | |||
let ty = Layout::known_type_for_size(size) | |||
.expect("Non-representable wchar_t?"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really something we should expect
vs return an Err
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we should always be able to represent it.
If there's no sufficiently large rust type to represent multi-byte characters I want to know why :)
@bors-servo r=fitzgen |
📌 Commit b3e41a2 has been approved by |
ir: Don't assume wchar is 2 bytes. Fixes #1345
☀️ Test successful - status-travis |
Fixes #1345