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

Handle multiple error fix suggestions carefuly #67880

Merged
merged 1 commit into from
Jan 7, 2020

Commits on Jan 5, 2020

  1. Handle multiple error fix suggestions carefuly

    The existing code seems to assume that substitutions spans are disjoint,
    which is not always the case.
    
    In the example:
    
        pub trait AAAA {}
        pub trait B {}
        pub trait C {}
        pub type T<P: AAAA + B + C> = P;
    
    , we get three substituions starting from ':' and ending respectively at
    the end of each trait token.
    
    With the former offset calculation, this would cause `underline_start` to
    eventually become negative before being converted to `usize`...
    
    The new version may report erroneous results for non perfectly overlapping
    substitutions but I don't know if such examples exist. Alternatively, we
    could detect these cases and trim out overlapping substitutions.
    lbonn committed Jan 5, 2020
    Configuration menu
    Copy the full SHA
    12545c7 View commit details
    Browse the repository at this point in the history