bevy/.github
Boxy a1a07945d6 fix some memory leaks detected by miri (#4959)
The first leak:
```rust
    #[test]
    fn blob_vec_drop_empty_capacity() {
        let item_layout = Layout:🆕:<Foo>();
        let drop = drop_ptr::<Foo>;
        let _ = unsafe { BlobVec::new(item_layout, Some(drop), 0) };
    }
```
this is because we allocate the swap scratch in blobvec regardless of what the capacity is, but we only deallocate if capacity is > 0

The second leak:
```rust
    #[test]
    fn panic_while_overwriting_component() {
        let helper = DropTestHelper::new();

        let res = panic::catch_unwind(|| {
            let mut world = World::new();
            world
                .spawn()
                .insert(helper.make_component(true, 0))
                .insert(helper.make_component(false, 1));

            println!("Done inserting! Dropping world...");
        });

        let drop_log = helper.finish(res);

        assert_eq!(
            &*drop_log,
            [
                DropLogItem::Create(0),
                DropLogItem::Create(1),
                DropLogItem::Drop(0),
            ]
        );
    }
```
this is caused by us not running the drop impl on the to-be-inserted component if the drop impl of the overwritten component panics

---

managed to figure out where the leaks were by using this 10/10 command
```
cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation" xargs -n1 cargo miri test --lib -- --exact
```
which runs every test one by one rather than all at once which let miri actually tell me which test had the leak 🙃
2022-07-01 21:54:28 +00:00
..
contributing Clean up advice on glob imports in style guide (#4644) 2022-05-02 18:45:00 +00:00
example-run Add an example to test small window sizes (#3597) 2022-04-26 22:15:24 +00:00
ISSUE_TEMPLATE Make bug template more beginner-friendly (#4652) 2022-05-30 22:11:44 +00:00
linters Remove markdown dead link check (#4839) 2022-05-25 05:08:34 +00:00
start-wasm-example run examples in wasm in CI (#4818) 2022-06-06 20:22:51 +00:00
workflows fix some memory leaks detected by miri (#4959) 2022-07-01 21:54:28 +00:00
bors.toml Fix rust 1.62 changes (#5154) 2022-06-30 19:24:28 +00:00
dependabot.yml dependabot: use new C-Dependencies label 2021-07-13 12:51:48 -07:00
FUNDING.yml Create FUNDING.yml 2020-08-18 10:59:30 -07:00
pull_request_template.md Let contributors know it's okay to delete optional template sections (#4498) 2022-04-16 18:57:51 +00:00