Skip to content

Commit

Permalink
feat: let delegate_noop can handle constGeneric
Browse files Browse the repository at this point in the history
the macro of delegate_noop cannot handle like
struct A<const X: unsize>, such kind of struct, so I want to fix it
  • Loading branch information
Decodetalkers committed Nov 29, 2023
1 parent fdd88c4 commit 0ac5b81
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions wayland-client/src/event_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,21 @@ macro_rules! delegate_noop {
}
};

($(@< $( $lt:tt $lct:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+ >)? $dispatch_from: ty : $interface: ty) => {
impl$(< $( $lt $lct:tt $( : $clt $(+ $dlt )* )? ),+ >)? $crate::Dispatch<$interface, ()> for $dispatch_from {
fn event(
_: &mut Self,
_: &$interface,
_: <$interface as $crate::Proxy>::Event,
_: &(),
_: &$crate::Connection,
_: &$crate::QueueHandle<Self>,
) {
unreachable!();
}
}
};

($(@< $( $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+ >)? $dispatch_from: ty : ignore $interface: ty) => {
impl$(< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $crate::Dispatch<$interface, ()> for $dispatch_from {
fn event(
Expand All @@ -864,4 +879,18 @@ macro_rules! delegate_noop {
}
}
};

($(@< $( $lt:tt $lct:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+ >)? $dispatch_from: ty : ignore $interface: ty) => {
impl$(< $( $lt $lct $( : $clt $(+ $dlt )* )? ),+ >)? $crate::Dispatch<$interface, ()> for $dispatch_from {
fn event(
_: &mut Self,
_: &$interface,
_: <$interface as $crate::Proxy>::Event,
_: &(),
_: &$crate::Connection,
_: &$crate::QueueHandle<Self>,
) {
}
}
};
}

0 comments on commit 0ac5b81

Please sign in to comment.