Skip to content

Commit

Permalink
Added test for Manishearth#79
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican committed Apr 17, 2020
1 parent 619b8f5 commit c60fcb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion gc/tests/finalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
extern crate gc_derive;
extern crate gc;

use std::cell::Cell;
use gc::Finalize;
use std::cell::Cell;

#[derive(PartialEq, Eq, Debug, Clone, Copy)]
struct Flags(i32, i32);
Expand Down Expand Up @@ -40,6 +40,9 @@ impl Finalize for B {
}
}

#[derive(Trace, Finalize)]
struct X(Box<dyn Trace>);

#[test]
fn drop_triggers_finalize() {
FLAGS.with(|f| assert_eq!(f.get(), Flags(0, 0)));
Expand Down
2 changes: 1 addition & 1 deletion gc/tests/gc_semantics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
extern crate gc_derive;
extern crate gc;

use gc::{force_collect, Finalize, Gc, GcCell, Trace};
use std::cell::Cell;
use std::thread::LocalKey;
use gc::{Trace, Finalize, GcCell, Gc, force_collect};

// Utility methods for the tests
#[derive(PartialEq, Eq, Debug, Clone, Copy)]
Expand Down

0 comments on commit c60fcb2

Please sign in to comment.