Skip to content

Commit

Permalink
fix(build): fix non_local_definitions warning in Rust 1.83
Browse files Browse the repository at this point in the history
Incidentally, this seems to also fix a warning from RustRover about
unimplemented traits (that were implemented inside `const {}` blocks).
  • Loading branch information
gnosek committed Dec 5, 2024
1 parent 75809dc commit 5072475
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions falco_plugin/src/plugin/base/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ macro_rules! wrap_ffi {
#[macro_export]
macro_rules! plugin {
(unsafe { $maj:expr; $min:expr; $patch:expr } => #[no_capabilities] $ty:ty) => {
unsafe impl $crate::internals::base::wrappers::BasePluginExported for $ty {}

$crate::base_plugin_ffi_wrappers!($maj; $min; $patch => #[no_mangle] $ty);
};
(unsafe { $maj:expr; $min:expr; $patch:expr } => $ty:ty) => {
Expand Down Expand Up @@ -449,6 +451,7 @@ macro_rules! static_plugin {
};

// a static plugin automatically exports all capabilities
unsafe impl $crate::internals::base::wrappers::BasePluginExported for $ty {}
unsafe impl $crate::internals::async_event::wrappers::AsyncPluginExported for $ty {}
unsafe impl $crate::internals::extract::wrappers::ExtractPluginExported for $ty {}
unsafe impl $crate::internals::listen::wrappers::CaptureListenPluginExported for $ty {}
Expand Down Expand Up @@ -496,8 +499,6 @@ macro_rules! ensure_plugin_capabilities {
#[macro_export]
macro_rules! base_plugin_ffi_wrappers {
($maj:expr; $min:expr; $patch:expr => #[$attr:meta] $ty:ty) => {
unsafe impl $crate::internals::base::wrappers::BasePluginExported for $ty {}

#[$attr]
pub extern "C-unwind" fn plugin_get_required_api_version() -> *const std::ffi::c_char {
$crate::internals::base::wrappers::plugin_get_required_api_version::<
Expand Down

0 comments on commit 5072475

Please sign in to comment.