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

Arbitrary self types v2: probe for more methods. #127812

Commits on Jul 16, 2024

  1. Arbitrary self types v2: probe for more methods.

    Rust prioritizes method candidates in this order:
    1. By value;
    2. By reference;
    3. By mutable reference;
    4. By const ptr.
    
    Previously, if a suitable candidate was found in one of these earlier
    categories, Rust wouldn't even move onto probing the other categories.
    
    As part of the arbitrary self types work, we're going to need to change
    that - even if we choose a method from one of the earlier categories, we
    will sometimes need to probe later categories to search for methods that
    we may be shadowing.
    
    This commit adds those extra searches for shadowing, but it does not yet
    produce an error when such shadowing problems are found. That will come
    in a subsequent commit, by filling out the 'check_for_shadowing'
    method.
    
    We're adding the extra searches in a preliminary commit because they are
    the risky bit. We want to find any functional or performance problems
    from these extra searches before we proceed with the actual work on
    arbitrary self types and specifically on extra deshadowing errors.
    adetaylor committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    670c724 View commit details
    Browse the repository at this point in the history