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

Always resolve type@primitive as a primitive, not a module #74078

Merged
merged 1 commit into from
Jul 7, 2020

Commits on Jul 6, 2020

  1. Always resolve type@primitive as a primitive, not a module

    Previously, if there were a module in scope with the same name as the
    primitive, that would take precedence. Coupled with
    rust-lang#58699, this made it impossible
    to link to the primitive when that module was in scope.
    
    This approach could be extended so that `struct@foo` would no longer resolve
    to any type, etc. However, it could not be used for glob imports:
    
    ```rust
    pub mod foo {
      pub struct Bar;
    }
    
    pub enum Bar {}
    use foo::*;
    
    // This is expected to link to `inner::Bar`, but instead it will link to the enum.
    /// Link to [struct@Bar]
    pub struct MyDocs;
    ```
    
    The reason for this is that this change does not affect the resolution
    algorithm of rustc_resolve at all. The only reason we could special-case
    primitives is because we have a list of all possible primitives ahead of time.
    jyn514 committed Jul 6, 2020
    Configuration menu
    Copy the full SHA
    e46c187 View commit details
    Browse the repository at this point in the history