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

Accept RUST_CXX_NO_EXCEPTIONS to disable throwing #101

Merged
merged 1 commit into from
Apr 11, 2020
Merged

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Apr 11, 2020

Partially addresses #92 (it remains to figure out how to nicely expose constructing a rust::String from a std::string when exceptions are off).

@dtolnay
Copy link
Owner Author

dtolnay commented Apr 11, 2020

Tested by adding .flag("-fno-exceptions") in build.rs, confirming that it fails to compile, then adding .define("RUST_CXX_NO_EXCEPTIONS", None) and confirming that it then compiles.

@dtolnay dtolnay merged commit bbbce5a into master Apr 11, 2020
@dtolnay dtolnay deleted the no-exceptions branch April 11, 2020 21:10
@bruxisma
Copy link

@dtolnay might be a better choice to use std::terminate over abort, as someone can then replace the terminate handler, and possibly get a stack trace via libunwind or some other means before abort is immediately called.

@dtolnay
Copy link
Owner Author

dtolnay commented Apr 12, 2020

Fixed in #112 to use std::terminate. Good call!

Repository owner locked and limited conversation to collaborators Feb 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants