<div dir="auto"><div>The best strategy for Mockall consumers is to use the #[allow(dead_code)] just like you did. Or else, you know, to bug Mockall's maintainer to release the patch ;)<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 14, 2022, 2:59 PM Thomas Weißschuh <<a href="mailto:thomas@t-8ch.de" target="_blank" rel="noreferrer">thomas@t-8ch.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2022-10-14 21:54+0100, Richard W.M. Jones wrote:<br>
> On Fri, Oct 14, 2022 at 10:42:30PM +0200, Thomas Weißschuh wrote:<br>
> > rustc 1.64.0 generates warnings for the mocked Server.<br>
> > This leads to a failure of test.sh.<br>
> > <br>
> > ```<br>
> > warning: associated function `expect` is never used<br>
> > --> tests/common/mod.rs:49:1<br>
> > |<br>
> > 49 | / mock!{<br>
> > 50 | | pub Server {}<br>
> > 51 | | impl Server for Server {<br>
> > 52 | | fn cache(&self, count: u32, offset: u64) -> Result<()>;<br>
> > ... |<br>
> > 86 | | }<br>
> > 87 | | }<br>
> > | |_^<br>
> > |<br>
> > = note: `#[warn(dead_code)]` on by default<br>
> > ```<br>
> > ---<br>
> > <br>
> > Note: This also affects the maintenance branches.<br>
> > <br>
> > plugins/rust/tests/common/<a href="http://mod.rs" rel="noreferrer noreferrer noreferrer" target="_blank">mod.rs</a> | 1 +<br>
> > 1 file changed, 1 insertion(+)<br>
> > <br>
> > diff --git a/plugins/rust/tests/common/<a href="http://mod.rs" rel="noreferrer noreferrer noreferrer" target="_blank">mod.rs</a> b/plugins/rust/tests/common/<a href="http://mod.rs" rel="noreferrer noreferrer noreferrer" target="_blank">mod.rs</a><br>
> > index 61c30464..de26c89f 100644<br>
> > --- a/plugins/rust/tests/common/<a href="http://mod.rs" rel="noreferrer noreferrer noreferrer" target="_blank">mod.rs</a><br>
> > +++ b/plugins/rust/tests/common/<a href="http://mod.rs" rel="noreferrer noreferrer noreferrer" target="_blank">mod.rs</a><br>
> > @@ -48,6 +48,7 @@ lazy_static! {<br>
> > <br>
> > mock!{<br>
> > pub Server {}<br>
> > + #[allow(dead_code)]<br>
> > impl Server for Server {<br>
> > fn cache(&self, count: u32, offset: u64) -> Result<()>;<br>
> > fn can_cache(&self) -> Result<CacheFlags>;<br>
> > <br>
> > base-commit: 20c2dc98b6bbde2f92e63d500d5e6015184bb105<br>
> <br>
> Yes this has been bugging me as well, and probably we should put this<br>
> patch upstream.<br>
> <br>
> However I will note that Alan submitted an issue about the underlying<br>
> issue:<br>
> <br>
> <a href="https://listman.redhat.com/archives/libguestfs/2022-September/030074.html" rel="noreferrer noreferrer noreferrer" target="_blank">https://listman.redhat.com/archives/libguestfs/2022-September/030074.html</a><br>
> <a href="https://github.com/asomers/mockall/issues/414" rel="noreferrer noreferrer noreferrer" target="_blank">https://github.com/asomers/mockall/issues/414</a><br>
> <br>
> It's marked as fixed, but for some reason that didn't seem to fix the<br>
> tests - I'm still seeing the unused 'expect' here, even after<br>
> completely deleting the cargo cache.<br>
<br>
I think the fixed version of mockall is just not released yet.<br>
<br>
What is your guidance for packagers?<br>
Especially as this is also affecting the 1.32 branch.<br>
For now I am carrying the patch from the parent mail downstream.<br>
<br>
Thomas<br>
</blockquote></div></div></div>