Skip to content

Commit 68173bd

Browse files
Nathan RingoLuthaf
Nathan Ringo
authored andcommitted
Fixes rust-lang/rust#83583 warnings.
I'm a bit confused by these; is their presence a rustc bug? It doesn't look like the relevant pattern actually occurs.
1 parent 60be58c commit 68173bd

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

tests/vec.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
mod particles;
44
use self::particles::{Particle, ParticleVec};
55
use soa_derive::StructOfArray;
6+
use std::{cell::Cell, rc::Rc};
67

78
#[test]
89
fn ty() {
@@ -162,21 +163,19 @@ fn retain() {
162163
assert_eq!(particles.index(1).name, "C");
163164
}
164165

165-
#[test]
166-
fn drop_vec() {
167-
use std::{cell::Cell, rc::Rc};
168-
169-
#[derive(StructOfArray)]
170-
struct IncrOnDrop {
171-
cell: Rc<Cell<usize>>,
172-
}
166+
#[derive(StructOfArray)]
167+
struct IncrOnDrop {
168+
cell: Rc<Cell<usize>>,
169+
}
173170

174-
impl Drop for IncrOnDrop {
175-
fn drop(&mut self) {
176-
self.cell.set(self.cell.get() + 1);
177-
}
171+
impl Drop for IncrOnDrop {
172+
fn drop(&mut self) {
173+
self.cell.set(self.cell.get() + 1);
178174
}
175+
}
179176

177+
#[test]
178+
fn drop_vec() {
180179
let counter = Rc::new(Cell::default());
181180
let mut vec = IncrOnDropVec::new();
182181
for _ in 0..5 {

0 commit comments

Comments
 (0)