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

ir: Don't assume wchar is 2 bytes. #1346

Merged
merged 1 commit into from
Jul 6, 2018
Merged

Conversation

emilio
Copy link
Contributor

@emilio emilio commented Jul 5, 2018

Fixes #1345

@emilio
Copy link
Contributor Author

emilio commented Jul 5, 2018

r? @fitzgen

Copy link
Member

@fitzgen fitzgen left a 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?");
Copy link
Member

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?

Copy link
Contributor Author

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 :)

@emilio
Copy link
Contributor Author

emilio commented Jul 6, 2018

@bors-servo r=fitzgen

@bors-servo
Copy link

📌 Commit b3e41a2 has been approved by fitzgen

@bors-servo
Copy link

⌛ Testing commit b3e41a2 with merge 6a480ff...

bors-servo pushed a commit that referenced this pull request Jul 6, 2018
ir: Don't assume wchar is 2 bytes.

Fixes #1345
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: fitzgen
Pushing 6a480ff to master...

@bors-servo bors-servo merged commit b3e41a2 into rust-lang:master Jul 6, 2018
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.

4 participants