Skip to content

Commit 6073a33

Browse files
committed
Fix warnings in tests that appeared on recent Rust versions.
1 parent 3c8325f commit 6073a33

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎src/benches_borrowed.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'a> From<&'a DataEnum> for DataEnum2<'a> {
4646
}
4747
}
4848

49-
fn bench_data2(bench_data: &[Data]) -> Vec<Data2> {
49+
fn bench_data2(bench_data: &[Data]) -> Vec<Data2<'_>> {
5050
bench_data.iter().map(From::from).collect()
5151
}
5252

‎src/derive/mod.rs‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,57 +142,71 @@ mod tests {
142142
test!([], [u8; 0]);
143143
}
144144

145+
#[allow(unused)]
145146
#[derive(Encode, Decode)]
146147
enum Never {}
147148

149+
#[allow(unused)]
148150
#[derive(Encode, Decode)]
149151
enum One {
150152
A(u8),
151153
}
152154

153155
// cargo expand --lib --tests | grep -A15 Two
156+
#[allow(unused)]
154157
#[derive(Encode, Decode)]
155158
enum Two {
156159
A(u8),
157160
B(i8),
158161
}
159162

163+
#[allow(unused)]
160164
#[derive(Encode, Decode)]
161165
struct TupleStruct(u8, i8);
162166

167+
#[allow(unused)]
163168
#[derive(Encode, Decode)]
164169
struct Generic<T>(T);
165170

171+
#[allow(unused)]
166172
#[derive(Encode, Decode)]
167173
struct GenericManual<T>(#[bitcode(bound_type = "T")] T);
168174

175+
#[allow(unused)]
169176
#[derive(Encode, Decode)]
170177
struct GenericWhere<A, B>(A, B)
171178
where
172179
A: From<B>;
173180

181+
#[allow(unused)]
174182
#[derive(Encode, Decode)]
175183
struct Lifetime<'a>(&'a str);
176184

185+
#[allow(unused)]
177186
#[derive(Encode, Decode)]
178187
struct LifetimeWhere<'a, 'b>(&'a str, &'b str)
179188
where
180189
'a: 'b;
181190

191+
#[allow(unused)]
182192
#[derive(Encode, Decode)]
183193
struct ConstGeneric<const N: usize>([u8; N]);
184194

195+
#[allow(unused)]
185196
#[derive(Encode, Decode)]
186197
struct Empty;
187198

199+
#[allow(unused)]
188200
#[derive(Encode, Decode)]
189201
struct AssociatedConst([u8; Self::N]);
190202
impl AssociatedConst {
191203
const N: usize = 1;
192204
}
193205

206+
#[allow(unused)]
194207
#[derive(Encode, Decode)]
195208
struct AssociatedConstTrait([u8; <Self as Trait>::N]);
209+
#[allow(unused)]
196210
trait Trait {
197211
const N: usize;
198212
}
@@ -379,8 +393,10 @@ mod tests {
379393

380394
#[test]
381395
fn skipped_fields_regression() {
396+
#[allow(unused)]
382397
#[derive(Encode, Decode, Default, Debug, PartialEq)]
383398
pub struct Indirect<A>(A);
399+
#[allow(unused)]
384400
#[derive(Encode, Decode, Debug, PartialEq)]
385401
struct SkipGeneric<A> {
386402
#[bitcode(bound_type = "Indirect<A>")]

‎src/derive/variant.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::coder::{Buffer, Decoder, Encoder, Result, View};
2-
use crate::error::err;
32
use crate::fast::{CowSlice, NextUnchecked, PushUnchecked, VecImpl};
43
use crate::pack::{check_less_than, pack_bytes_less_than, unpack_bytes_less_than};
54
use crate::pack_ints::{pack_ints, unpack_ints, Int};

0 commit comments

Comments
 (0)