Skip to content

Commit

Permalink
resolve clippy lints for undocumented private items and locations of …
Browse files Browse the repository at this point in the history
…hoisted struct definitions
  • Loading branch information
claytonwramsey committed Nov 9, 2023
1 parent 0ac98bc commit 8e32c78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dumpster/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ pub use dumpster_derive::Collectable;
/// - `Ok(false)`: The data structure contains no garbage-collected pointers.
/// - `Err(())`: The data structure was accessed while we checked it for garbage-collected pointers.
fn contains_gcs<T: Collectable + ?Sized>(x: &T) -> Result<bool, ()> {
/// A visitor structure used for determining whether some garbage-collected pointer contains a
/// `Gc` in its pointed-to value.
struct ContainsGcs(bool);

impl Visitor for ContainsGcs {
Expand Down
7 changes: 4 additions & 3 deletions dumpster_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,16 @@ fn parallel_loop() {
}

#[test]
#[allow(clippy::similar_names)]
fn unsync_as_ptr() {
#[derive(Collectable)]
struct B(Gc<Empty>);

let empty = Gc::new(Empty);
let empty_a = Gc::clone(&empty);
let empty_ptr = Gc::as_ptr(&empty);
assert_eq!(empty_ptr, Gc::as_ptr(&empty_a));

#[derive(Collectable)]
struct B(Gc<Empty>);

let b = B(Gc::clone(&empty));
assert_eq!(empty_ptr, Gc::as_ptr(&b.0));
let bb = Gc::new(B(Gc::clone(&empty)));
Expand Down

0 comments on commit 8e32c78

Please sign in to comment.