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

bevy_reflect: Disambiguate type bounds in where clauses. #8761

Merged
merged 4 commits into from
Jun 5, 2023
Merged

bevy_reflect: Disambiguate type bounds in where clauses. #8761

merged 4 commits into from
Jun 5, 2023

Commits on Jun 5, 2023

  1. bevy_reflect: Disambiguate type bounds in where clauses.

    It was accidentally found that rustc is unable to parse certain
    constructs in `where` clauses properly. bevy_reflect::Reflect's habit
    of copying and pasting the types in a struct's definition to its where
    clauses made it very easy to accidentally run into this behaviour -
    particularly with the construct
        for<'a> fn(&'a T) -> &'a T: Trait1 + Trait2
    
    which was incorrectly parsed as
        for<'a> (fn(&'a T) -> &'a T: Trait1 + Trait2)
    
    instead of
        (for<'a> fn(&'a T) -> &'a T): Trait1 + Trait2
    
    This commit fixes the issue by inserting explicit parentheses to
    disambiguate types from their bound lists.
    Themayu committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    c6c5fbe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9ca8fc8 View commit details
    Browse the repository at this point in the history
  3. Reformatting

    Themayu committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    001a82a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ebbab1e View commit details
    Browse the repository at this point in the history