Skip to content

C++: Fix build on no-except compilers#1174

Merged
dtolnay merged 1 commit intodtolnay:masterfrom
snailspeed3:master
Aug 8, 2025
Merged

C++: Fix build on no-except compilers#1174
dtolnay merged 1 commit intodtolnay:masterfrom
snailspeed3:master

Conversation

@snailspeed3
Copy link
Copy Markdown
Contributor

@snailspeed3 snailspeed3 commented Feb 11, 2023

This fix was necessary for my project (C++ depending on Rust) to compile. The approach here is conservative, only deferring from the existing behavior when the compiler explicitly does not support exceptions via feature-test macros. There may be other approaches here, like attempting to compile a test file with throw.

@snailspeed3 snailspeed3 changed the title C++: Automatically use RUST_CXX_NO_EXCEPTIONS panic backend if exceptions are unsupported. C++: Fix build on no-except compilers Mar 10, 2023
@dtolnay dtolnay linked an issue Aug 8, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

Disable exceptions without setting additional env flags

2 participants