Skip to content

remove all uses of lang_items unstable feature#1950

Merged
bors[bot] merged 1 commit into
tock:masterfrom
hudson-ayers:no-lang-items
Jun 17, 2020
Merged

remove all uses of lang_items unstable feature#1950
bors[bot] merged 1 commit into
tock:masterfrom
hudson-ayers:no-lang-items

Conversation

@hudson-ayers

@hudson-ayers hudson-ayers commented Jun 17, 2020

Copy link
Copy Markdown
Contributor

Pull Request Overview

This pull request removes all uses of the lang_items unstable feature, to get us closer to building Tock on stable rust.

Originally, lang_items was required to declare the global panic handler, but that was changed by rust-lang/rust#51366 . After that, we seem to have just kept it around for declaring a dummy eh_personality() implementation, which I understand is not needed if you build with panic=abort (which we do for both release and debug builds). see: https://os.phil-opp.com/freestanding-rust-binary/

Testing Strategy

This pull request was tested by compiling, running a normal app on Imix, and by panicing intentionally and observing the output looks normal.

TODO or Help Wanted

Confirmation that I am correct in my understanding that we do not need eh_personality because we always use panic=abort.

Documentation Updated

  • No updates are required.

Formatting

  • Ran make prepush.

@mcy mcy mentioned this pull request Jun 17, 2020
30 tasks

@ppannuto ppannuto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

bors r+

This is great. If I understand correctly, if folks try to use a different panic mechanism, they'll get a missing symbol error for eh_personality now, which frankly is probably a good thing, as there are likely other expectations not met by our old empty function.

@bors

bors Bot commented Jun 17, 2020

Copy link
Copy Markdown
Contributor

@bors
bors Bot merged commit 9fb0384 into tock:master Jun 17, 2020
sirchnik pushed a commit to sirchnik/tock that referenced this pull request May 12, 2026
1950: remove all uses of lang_items unstable feature r=ppannuto a=hudson-ayers

### Pull Request Overview

This pull request removes all uses of the lang_items unstable feature, to get us closer to building Tock on stable rust.

Originally, lang_items was required to declare the global panic handler, but that was changed by rust-lang/rust#51366 . After that, we seem to have just kept it around for declaring a dummy `eh_personality()` implementation, which I understand is not needed if you build with panic=abort (which we do for both release and debug builds). see: https://os.phil-opp.com/freestanding-rust-binary/


### Testing Strategy

This pull request was tested by compiling, running a normal app on Imix, and by panicing intentionally and observing the output looks normal.


### TODO or Help Wanted

Confirmation that I am correct in my understanding that we do not need eh_personality because we always use panic=abort.


### Documentation Updated

- [x] No updates are required.

### Formatting

- [x] Ran `make prepush`.


Co-authored-by: Hudson Ayers <hayers@stanford.edu>
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.

3 participants