Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhelpful error if a Edges struct contains two or more exclusive borrows of the same resource #4

Open
schell opened this issue Sep 23, 2022 · 1 comment

Comments

@schell
Copy link
Owner

schell commented Sep 23, 2022

For example:

#[derive(CanFetch)]
struct SceneSetupData {
    entities: Write<Entities>,
    render_objects: RenderObjectData
}

will err during construction because RenderObjectData also has a Write<Entities>, but the error message is this:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: could not construct SceneSetupData

Caused by:
    'Write::construct' requested missing resource "apecs::world::Entities" encountered while building request: the borrow is exclusive and the resource is missing
@schell
Copy link
Owner Author

schell commented Sep 23, 2022

Maybe we can check the exclusivity of borrows at compile time in the derive macro?

@schell schell transferred this issue from schell/apecs Mar 26, 2024
@schell schell changed the title Unhelpful error if a CanFetch struct contains two or more exclusive borrows of the same resource Unhelpful error if a Edges struct contains two or more exclusive borrows of the same resource Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant