Skip to content

Fix a warning in libcore on 16bit targets. #50369

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

Merged
merged 1 commit into from
May 3, 2018
Merged

Conversation

pftbest
Copy link
Contributor

@pftbest pftbest commented May 1, 2018

This code is assuming that usize >= 32bits, but it is not the case on
16bit targets. It is producing a warning that can fail the compilation
on MSP430 if deny(warnings) is enabled.
It is very unlikely that someone would actually use this code on
a microcontroller, but since unicode was merged into libcore we
have to compile it on 16bit targets.

I've tried to make sure that the code stays the same on x86,
here is an assembly comparison: https://godbolt.org/g/wFw7dZ

r? @SimonSapin

This code is assuming that usize >= 32bits, but it is not the case on
16bit targets. It is producing a warning that will fail the compilation
on MSP430 if deny(warnings) is enabled.
It is very unlikely that someone would actually use this code on
a microcontroller, but since unicode was merged into libcore we
have compile it on 16bit targets.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 1, 2018
@SimonSapin
Copy link
Contributor

👍

@bors r+

@bors
Copy link
Collaborator

bors commented May 1, 2018

📌 Commit f29e62a has been approved by SimonSapin

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 1, 2018
@bors
Copy link
Collaborator

bors commented May 3, 2018

⌛ Testing commit f29e62a with merge 9e3cbbb...

bors added a commit that referenced this pull request May 3, 2018
Fix a warning in libcore on 16bit targets.

This code is assuming that usize >= 32bits, but it is not the case on
16bit targets. It is producing a warning that can fail the compilation
on MSP430 if deny(warnings) is enabled.
It is very unlikely that someone would actually use this code on
a microcontroller, but since unicode was merged into libcore we
have to compile it on 16bit targets.

I've tried to make sure that the code stays the same on x86,
here is an assembly comparison: https://godbolt.org/g/wFw7dZ

r? @SimonSapin
@bors
Copy link
Collaborator

bors commented May 3, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: SimonSapin
Pushing 9e3cbbb to master...

@bors bors merged commit f29e62a into rust-lang:master May 3, 2018
@pftbest pftbest deleted the unicode branch July 23, 2019 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants