summarylogtreecommitdiffstats
path: root/0001-rust-prevent-dead_code-warning.patch
blob: 26beb4475af15b31c71f09daffda4541645b0dff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 8a41274ae95fcc79d51743b0e46ff6923328573d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Fri, 14 Oct 2022 22:34:29 +0200
Subject: [nbdkit PATCH] rust: prevent dead_code warning

rustc 1.64.0 generates warnings for the mocked Server.
This leads to a failure of test.sh.

```
warning: associated function `expect` is never used
  --> tests/common/mod.rs:49:1
   |
49 | / mock!{
50 | |     pub Server {}
51 | |     impl Server for Server {
52 | |         fn cache(&self, count: u32, offset: u64) -> Result<()>;
...  |
86 | |     }
87 | | }
   | |_^
   |
   = note: `#[warn(dead_code)]` on by default
```
---

Note: This also affects the maintenance branches.

 plugins/rust/tests/common/mod.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/rust/tests/common/mod.rs b/plugins/rust/tests/common/mod.rs
index 61c30464..de26c89f 100644
--- a/plugins/rust/tests/common/mod.rs
+++ b/plugins/rust/tests/common/mod.rs
@@ -48,6 +48,7 @@ lazy_static! {
 
 mock!{
     pub Server {}
+    #[allow(dead_code)]
     impl Server for Server {
         fn cache(&self, count: u32, offset: u64) -> Result<()>;
         fn can_cache(&self) -> Result<CacheFlags>;

base-commit: 20c2dc98b6bbde2f92e63d500d5e6015184bb105
-- 
2.38.0