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

[Merged by Bors] - Fix FilteredAccessSet get_conflicts inconsistency #5105

Closed
wants to merge 3 commits into from

Commits on Nov 16, 2022

  1. Fix FilteredAccessSet get_conflicts inconsistency

    The `FilteredAccessSet::get_conflicts` methods didn't work properly with
    `Res` and `ResMut` parameters. Because those added their access by using
    the `combined_access_mut` method and directly modifying the global
    access state of the FilteredAccessSet. This caused an inconsistency,
    because get_conflicts assumes that ALL added access have a corresponding
    `FilteredAccess` added to the `filtered_accesses` field.
    
    In practice, that means that SystemParam that adds their access through
    the `Access` returned by `combined_access_mut` and the ones that add
    their access using the `add` method lived in two different universes. As
    a result, they could never be mutually exclusive.
    
    This commit fixes it by removing the `combined_access_mut` method. This
    ensures that the `combined_access` field of FilteredAccessSet is always
    updated consistently with the addition of a filter. When checking for
    filtered access, it is now possible to account for `Res` and `ResMut`
    invalid access. This is currently not needed, but might be in the
    future.
    
    We add the `add_unfiltered_{read,write}` methods to replace previous
    usages of `combined_access_mut`.
    
    We also add improved Debug implementations on FixedBitSet so that their
    meaning is much clearer in debug output.
    nicopap committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    1d1d190 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8df367a View commit details
    Browse the repository at this point in the history
  3. Precise use of SparseSetIndex

    nicopap committed Nov 16, 2022
    Configuration menu
    Copy the full SHA
    d9dd553 View commit details
    Browse the repository at this point in the history