• R
    Rollup merge of #72280 - nbdd0121:typeck, r=nikomatsakis · 70622db4
    Ralf Jung 提交于
    Fix up autoderef when reborrowing
    
    Currently `(f)()` and `f.call_mut()` behaves differently if expression `f` contains autoderef in it. This causes a weird error in #72225.
    
    When `f` is type checked, `Deref` is used (this is expected as we can't yet determine if we should use `Fn` or `FnMut`). When subsequently we determine the actual trait to be used, when using the `f.call_mut()` syntax the `Deref` is patched to `DerefMut`, while for the `(f)()` syntax case it is not.
    
    This PR replicates the fixup for the first case.
    
    Fixes #72225
    Fixes #68590
    70622db4
mod.rs 232.3 KB