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

Emit a better diagnostic when function actually has a 'self' parameter #72308

Merged
merged 1 commit into from
May 25, 2020

Commits on May 17, 2020

  1. Emit a better diagnostic when function actually has a 'self' parameter

    Fixes rust-lang#66898
    
    When we are unable to resolve a reference to `self`, we current assume
    that the containing function doesn't have a `self` parameter, and
    emit an error message accordingly.
    
    However, if the reference to `self` was created by a macro invocation,
    then resolution will correctly fail, due to hygiene. In this case, we
    don't want to tell the user that the containing fuction doesn't have a
    'self' paramter if it actually has one.
    
    This PR checks for the precense of a 'self' parameter, and adjusts the
    error message we emit accordingly.
    
    TODO: The exact error message we emit could probably be improved. Should
    we explicitly mention hygiene?
    Aaron1011 committed May 17, 2020
    Configuration menu
    Copy the full SHA
    b684448 View commit details
    Browse the repository at this point in the history