You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to export mocks behind a feature flag in a project with #![deny(missing_docs)] set. My trait and all of its members are documented, but the output of #[automock] causes "missing documentation for" messages:
My example source:
/// Trait for abstracting connections to the database////// A `MockDatabaseAbstraction` struct is exported when the "mockall" feature is used#[cfg_attr(feature = "mockall", automock)]pubtraitDatabaseAbstraction{/// Selects a row for a user login, otherwise `None` is returned////// # Errors////// When a connection can't be obtained from the pool, or the query failsfnread_user_login(&self,user_id:u64,) -> Result<Option<Login>, std::io::Error>;}
My example output (line numbers are slightly off due to other boilerplate code):
error: missing documentation for a module
--> src/example.rs:24:33
|
24 | #[cfg_attr(feature = "mockall", automock)]
| ^^^^^^^^
|
note: lint level defined here
--> src/lib.rs:10:9
|
10 | #![deny(missing_docs)]
| ^^^^^^^^^^^^
error: missing documentation for a struct
--> src/example.rs:24:33
|
24 | #[cfg_attr(feature = "mockall", automock)]
| ^^^^^^^^
error: missing documentation for a module
--> src/example.rs:24:33
|
24 | #[cfg_attr(feature = "mockall", automock)]
| ^^^^^^^^
error: missing documentation for a method
--> src/example.rs:24:33
|
24 | #[cfg_attr(feature = "mockall", automock)]
| ^^^^^^^^
error: aborting due to 4 previous errors
It might be useful to carry over the documentation of the trait itself, and fill in something generic for the generated module. Some IDEs may display useful hints when writing mocked tests
The text was updated successfully, but these errors were encountered:
I'm trying to export mocks behind a feature flag in a project with
#![deny(missing_docs)]
set. My trait and all of its members are documented, but the output of#[automock]
causes "missing documentation for" messages:My example source:
My example output (line numbers are slightly off due to other boilerplate code):
It might be useful to carry over the documentation of the trait itself, and fill in something generic for the generated module. Some IDEs may display useful hints when writing mocked tests
The text was updated successfully, but these errors were encountered: