• J
    Always resolve type@primitive as a primitive, not a module · e46c1876
    Joshua Nelson 提交于
    Previously, if there were a module in scope with the same name as the
    primitive, that would take precedence. Coupled with
    https://github.com/rust-lang/rust/issues/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.
    e46c1876
intra-link-prim-precedence.rs 414 字节