Skip to content

Commit

Permalink
Fixes rust-lang/rust#83583 warnings.
Browse files Browse the repository at this point in the history
I'm a bit confused by these; is their presence a rustc bug? It doesn't
look like the relevant pattern actually occurs.
  • Loading branch information
Nathan Ringo authored and Luthaf committed Nov 9, 2021
1 parent 5487dff commit 170391f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
mod particles;
use self::particles::{Particle, ParticleVec};
use soa_derive::StructOfArray;
use std::{cell::Cell, rc::Rc};

#[test]
fn ty() {
Expand Down Expand Up @@ -162,21 +163,19 @@ fn retain() {
assert_eq!(particles.index(1).name, "C");
}

#[test]
fn drop_vec() {
use std::{cell::Cell, rc::Rc};

#[derive(StructOfArray)]
struct IncrOnDrop {
cell: Rc<Cell<usize>>,
}
#[derive(StructOfArray)]
struct IncrOnDrop {
cell: Rc<Cell<usize>>,
}

impl Drop for IncrOnDrop {
fn drop(&mut self) {
self.cell.set(self.cell.get() + 1);
}
impl Drop for IncrOnDrop {
fn drop(&mut self) {
self.cell.set(self.cell.get() + 1);
}
}

#[test]
fn drop_vec() {
let counter = Rc::new(Cell::default());
let mut vec = IncrOnDropVec::new();
for _ in 0..5 {
Expand Down

0 comments on commit 170391f

Please sign in to comment.