From ebd14373f3f50987d042fa877e9baa9c616d1acb Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Wed, 11 Jun 2025 10:28:59 -0400 Subject: [PATCH 1/2] Convert the raw pointer to a reference later to avoid UB Closes #84 Closes #89 --- src/raw.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raw.rs b/src/raw.rs index 1ddc4c6..fed0219 100644 --- a/src/raw.rs +++ b/src/raw.rs @@ -512,9 +512,9 @@ impl Connections { C: Into, { let child = child.into(); - let parent_r = unsafe { &mut *self.root }; - child.replace_parent(self.root); + + let parent_r = unsafe { &mut *self.root }; parent_r.children.push(child); } From 1fcd67708bbf03e571ea8bb89e8195fb89b8fe23 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Wed, 11 Jun 2025 10:33:57 -0400 Subject: [PATCH 2/2] Run Miri in CI --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 079bb8b..a5ef794 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,3 +63,20 @@ jobs: - run: cargo build - run: cargo test + + miri: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - nightly + + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + components: miri + + - run: cargo miri test