• B
    Auto merge of #45879 - nikomatsakis:nll-kill-cyclic-closures, r=arielb1 · d6d09e0b
    bors 提交于
    move closure kind, signature into `ClosureSubsts`
    
    Instead of using side-tables, store the closure-kind and signature in the substitutions themselves. This has two key effects:
    
    - It means that the closure's type changes as inference finds out more things, which is very nice.
        - As a result, it avoids the need for the `freshen_closure_like` code (though we still use it for generators).
    - It avoids cyclic closures calls.
        - These were never meant to be supported, precisely because they make a lot of the fancy inference that we do much more complicated. However, due to an oversight, it was previously possible -- if challenging -- to create a setup where a closure *directly* called itself (see e.g. #21410).
    
    We have to see what the effect of this change is, though. Needs a crater run. Marking as [WIP] until that has been assessed.
    
    r? @arielb1
    d6d09e0b
mod.rs 209.9 KB