// vim: tw=80
#![deny(missing_docs)]

//! Examples of mock objects and their generated methods.
//!
//! This crate only exists to document the autogenerated methods of the
//! [`Mockall`](https://docs.rs/mockall/latest/mockall)
//! crate.  You should never depend on this crate.
//

#[cfg(doc)]
use mockall::*;

/// A basic trait with several kinds of method.
///
/// It is mocked by the [`MockFoo`](struct.MockFoo.html) struct.
#[cfg(doc)]
#[automock]
pub trait Foo {
    /// A method with a `'static` return type
    fn foo(&self, x: i32, y: i16) -> i32;

    /// A method returning a reference
    fn bar(&self, x: i32) -> &i32;

    /// A method returning a mutable reference
    fn baz(&mut self, x: i32) -> &mut i32;

    /// A method returning a `'static` reference
    fn bean(&self) -> &'static i32;

    /// A static method
    fn bang(x: i32) -> i32;
}

/// A trait implemented by a Struct we want to mock
pub trait Bah {
    /// Some trait method
    fn bah(&self);
}

#[cfg(doc)]
mock! {
    /// structs can be mocked with `mock!`
    ///
    /// Their mock methods have an identical API to the methods generated by
    /// `#[automock]`
    pub Boo {
        /// A method on a struct
        fn boo(&self);
    }
    /// An implementation of a trait on a mocked struct
    trait Bah {
        fn bah(&self);
    }
}

#[cfg(doc)]
#[automock(mod mock_ffi;)]
extern "C" {
    /// A foreign "C" function
    pub fn ffi_func();
}

// vim: tw=80
//#![deny(missing_docs)]

//! Examples of mock objects and their generated methods.
//!
//! This crate only exists to document the autogenerated methods of the
//! [`Mockall`](https://docs.rs/mockall/latest/mockall)
//! crate.  You should never depend on this crate.
//

#[cfg(doc)]
use mockall::*;

/// A basic trait with several kinds of method.
///
/// It is mocked by the [`MockFoo`](struct.MockFoo.html) struct.
#[cfg(doc)]
#[automock]
pub trait Foo {
    /// A method with a `'static` return type
    fn foo(&self, x: i32, y: i16) -> i32;

    /// A method returning a reference
    fn bar(&self, x: i32) -> &i32;

    /// A method returning a mutable reference
    fn baz(&mut self, x: i32) -> &mut i32;

    /// A method returning a `'static` reference
    fn bean(&self) -> &'static i32;

    /// A static method
    fn bang(x: i32) -> i32;
}

#[cfg(doc)]
#[automock(mod mock_ffi;)]
extern "C" {
    /// A foreign "C" function
    pub fn ffi_func();
}

--- 
+++ 
@@ -1,5 +1,5 @@
 // vim: tw=80
-//#![deny(missing_docs)]
+#![deny(missing_docs)]
 
 //! Examples of mock objects and their generated methods.
 //!
@@ -33,6 +33,28 @@
     fn bang(x: i32) -> i32;
 }
 
+/// A trait implemented by a Struct we want to mock
+pub trait Bah {
+    /// Some trait method
+    fn bah(&self);
+}
+
+#[cfg(doc)]
+mock! {
+    /// structs can be mocked with `mock!`
+    ///
+    /// Their mock methods have an identical API to the methods generated by
+    /// `#[automock]`
+    pub Boo {
+        /// A method on a struct
+        fn boo(&self);
+    }
+    /// An implementation of a trait on a mocked struct
+    trait Bah {
+        fn bah(&self);
+    }
+}
+
 #[cfg(doc)]
 #[automock(mod mock_ffi;)]
 extern "C" {
Add a use of mock! in mockall_examples
