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

in region, treat current (and future) item-likes alike #37920

Merged
merged 4 commits into from
Dec 4, 2016

Commits on Dec 1, 2016

  1. in region, treat current (and future) item-likes alike

    The `visit_fn` code mutates its surrounding context.  Between *items*,
    this was saved/restored, but between impl items it was not. This meant
    that we wound up with `CallSiteScope` entries with two parents (or
    more!).  As far as I can tell, this is harmless in actual type-checking,
    since the regions you interact with are always from at most one of those
    branches. But it can slow things down.
    
    Before, the effect was limited, since it only applied to impl items
    within an impl. After rust-lang#37660, impl items are visisted all together at
    the end, and hence this could create a very messed up
    hierarchy. Isolating impl item properly solves both issues.
    
    I cannot come up with a way to unit-test this; for posterity, however,
    you can observe the messed up hierarchies with a test as simple as the
    following, which would create a callsite scope with two parents both
    before and after
    
    ```
    struct Foo {
    }
    
    impl Foo {
        fn bar(&self) -> usize {
            22
        }
    
        fn baz(&self) -> usize {
            22
        }
    }
    
    fn main() { }
    ```
    
    Fixes rust-lang#37864.
    nikomatsakis committed Dec 1, 2016
    Configuration menu
    Copy the full SHA
    fa22fc3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6fe4bff View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2016

  1. Configuration menu
    Copy the full SHA
    0adb1b1 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2016

  1. Configuration menu
    Copy the full SHA
    f809706 View commit details
    Browse the repository at this point in the history