Skip to content

Commit 5dd462a

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix unreachable-fallthrough issue in rust-api.cpp
Summary: Previously the code just did silent implicit fallthrough in prod mode. I added `[[fallthrough]]` to make this explicit. However, the code's behaviour still differs between dev and prod in a way that might compromise correctness. This diff follows the suggestion of tmikov on D79836435. Reviewed By: tmikov Differential Revision: D79966036 fbshipit-source-id: 319b5d89682608360fda23ff5ecb611f17852450
1 parent 2969e2b commit 5dd462a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Parser/rust-api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ DiagKind toDiagKind(llvh::SourceMgr::DiagKind k) {
446446
switch (k) {
447447
default:
448448
assert(false && "Invalid DiagKind");
449-
[[fallthrough]];
449+
abort();
450450
case llvh::SourceMgr::DK_Error:
451451
return DiagKind::Error;
452452
case llvh::SourceMgr::DK_Warning:

0 commit comments

Comments
 (0)