Skip to content

Commit

Permalink
Poison builds that accidentally use both the Upb and Cpp kernel. This…
Browse files Browse the repository at this point in the history
… should only be possible for targets defined within the protobuf codebase.

PiperOrigin-RevId: 642622844
  • Loading branch information
dbenson24 authored and copybara-github committed Jun 12, 2024
1 parent 94d5f12 commit 41315fd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rust/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ mod proxied;
mod repeated;
mod string;

// If the Upb and C++ kernels are both linked into the same binary, this symbol
// will be defined twice and cause a link error.
#[no_mangle]
extern "C" fn __Disallow_Upb_And_Cpp_In_Same_Binary() {}

/// An error that happened during parsing.
#[derive(Debug, Clone)]
pub struct ParseError;
Expand Down

0 comments on commit 41315fd

Please sign in to comment.