You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nuew opened this issue
May 12, 2019
· 0 comments
· Fixed by #61084
Labels
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
The documentation for the unreachable! macro says:
If the determination that the code is unreachable proves incorrect, the program immediately terminates with a panic!. The function unreachable_unchecked, which belongs to the std::hint module, informs the compiler to optimize the code out of the release version entirely.
This is incorrect; while building in release (and thus with optimizations) certainly makes the compiler more likely to exploit unreachable_unchecked, it is still UB to reach it without optimizations enabled, and LLVM is under no obligation to exploit it when compiling in release mode.
I'm not sure what this should be changed to, which is why I'm not just submitting a PR.
The text was updated successfully, but these errors were encountered:
jonas-schievink
added
C-bug
Category: This is a bug.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
labels
May 14, 2019
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
The documentation for the
unreachable!
macro says:This is incorrect; while building in release (and thus with optimizations) certainly makes the compiler more likely to exploit
unreachable_unchecked
, it is still UB to reach it without optimizations enabled, and LLVM is under no obligation to exploit it when compiling in release mode.I'm not sure what this should be changed to, which is why I'm not just submitting a PR.
The text was updated successfully, but these errors were encountered: