#![deny(warnings)]
use mockall::*;
struct Foo<T: 'static, V: 'static>((T, V));
trait MyTrait {
type Item;
fn myfunc(&self, cx: &NonStatic) -> Self::Item;
}
pub struct NonStatic<'ns>(&'ns i32);
#[automock]
impl<T: 'static, V: 'static> MyTrait for Foo<T, V> where T: Clone {
type Item = V;
fn myfunc<'a>(&self, _cx: &NonStatic<'a>) -> V { unimplemented!() }
}
#[test]
fn return_const() {
let mut mock = MockFoo::<u32, u32>::new();
let x = 5i32;
let ns = NonStatic(&x);
mock.expect_myfunc()
.return_const(42u32);
assert_eq!(42u32, mock.myfunc(&ns));
}