File tree 3 files changed +22
-0
lines changed
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
7
7
8
8
### Fixed
9
9
10
+ - Suppress warnings about the ` #[expect] ` lint, new in Rust 1.81.0, in
11
+ generated code.
12
+ ([ #619 ] ( https://github.com/asomers/mockall/pull/619 ) )
13
+
10
14
- Suppress the ` #[clippy::ref_option] ` warning, new in Rust 1.83.0, in
11
15
generated code.
12
16
([ #618 ] ( https://github.com/asomers/mockall/pull/618 ) )
Original file line number Diff line number Diff line change
1
+ //! It should be possible to use #[expect::clippy] within an #[automock] block
2
+
3
+ use mockall:: automock;
4
+
5
+ pub struct Foo { }
6
+
7
+ #[ automock]
8
+ impl Foo {
9
+ #[ expect( unused_variables) ]
10
+ pub fn foo ( & self ) {
11
+ let a = 0 ;
12
+ }
13
+ }
Original file line number Diff line number Diff line change @@ -820,6 +820,11 @@ impl<'a> AttrFormatter<'a> {
820
820
self . doc
821
821
} else if * i. as_ref ( ) . unwrap ( ) == "async_trait" {
822
822
self . async_trait
823
+ } else if * i. as_ref ( ) . unwrap ( ) == "expect" {
824
+ // This probably means that there's a lint that needs to be
825
+ // surpressed for the real code, but not for the mock code.
826
+ // Skip it.
827
+ false
823
828
} else if * i. as_ref ( ) . unwrap ( ) == "inline" {
824
829
// No need to inline mock functions.
825
830
false
You can’t perform that action at this time.
0 commit comments