summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/simple.rs7
-rw-r--r--src/lib.rs12
2 files changed, 12 insertions, 7 deletions
diff --git a/examples/simple.rs b/examples/simple.rs
index a0a5860..a5b7203 100644
--- a/examples/simple.rs
+++ b/examples/simple.rs
@@ -15,7 +15,7 @@ trait Foo
fn baz<Foobar>(&self, name: &str, foobar: Foobar)
where
- Foobar: SomeFoobar;
+ Foobar: SomeFoobar + Debug;
}
mock! {
@@ -27,9 +27,8 @@ mock! {
fn biz<Fiz: (Debug +), Bar>(self: (&Self), fiz: Fiz) -> &Bar;
fn baz<Foobar>(self: (&Self), name: &str, foobar: Foobar)
- where (
- Foobar: SomeFoobar
- );
+ where
+ Foobar: SomeFoobar + Debug;
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 9f404f1..c4868a2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,7 +11,9 @@ macro_rules! mock {
self: ($($self_type: tt)+),
$($func_param: ident: $func_param_type: ty),*
)$( -> $return_type: ty)?
- $(where ($($where: tt)*))?;
+ $(where $(
+ $where_param: ident: $first_where_param_bound: tt $(+ $where_param_bound: tt)*
+ ),*)?;
)*
}
) => {
@@ -45,7 +47,9 @@ macro_rules! mock {
$($type_param$(: $($type_param_bound +)*)?),*
>)?(&mut self)
-> &mut [<$mock Expectation _ $func>]$(<$($type_param),*>)?
- $(where $($where)*)?
+ $(where $(
+ $where_param: $first_where_param_bound $(+ $where_param_bound)*
+ ),*)?
{
let ids = vec![
$($($crate::__private::type_id::TypeID::of::<$type_param>()),*)?
@@ -71,7 +75,9 @@ macro_rules! mock {
self: $($self_type)+,
$($func_param: $func_param_type),*
)$( -> $return_type)?
- $(where $($where)*)?
+ $(where $(
+ $where_param: $first_where_param_bound $(+ $where_param_bound)*
+ ),*)?
{
let ids = vec![
$($($crate::__private::type_id::TypeID::of::<$type_param>()),*)?