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

polymorphization: shims and predicates #89514

Merged
merged 5 commits into from
Oct 17, 2021

Commits on Oct 1, 2021

  1. polymorphize: don't check foreign items

    Foreign items do not have bodies and so cannot be polymorphized.
    
    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    50433a0 View commit details
    Browse the repository at this point in the history
  2. polymorphize: remove predicate logic

    This commit removes all logic which marks parameters as used based on
    their presence in predicates - given rust-lang#75675, this will
    enable more polymorphization and avoid the symbol clashes that predicate
    logic previously sidestepped.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    da2b69b View commit details
    Browse the repository at this point in the history
  3. collector: limit pme context note to user-defd fns

    rustc adds notes to errors which happen post-monomorphization to
    provide the user with helpful context (as these errors may rely on the
    specific instantiations). To prevent this note being added where it is
    not appropriate, the node is checked to originate outwith the current
    crate. However, when polymorphization is enabled, this can result in
    some errors (produced by `optimized_mir`) to occur earlier in
    compilation than they normally would, during the collection of shims.
    Some shims have ids that originate in the standard library, but these
    should not receive the PME note, so instances for compiler-generated
    functions no longer receive this note.
    
    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    4528b8e View commit details
    Browse the repository at this point in the history
  4. polymorphize: polymorphize shims

    This commit removes the restriction of `InstanceDef::Item` on
    polymorphization, so that shims can now be polymorphized.
    
    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    76b0553 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2021

  1. polymorphize: don't normalize self-ty need substs

    `characteristic_def_id_of_type` was being invoked during partitioning
    for self types of impl blocks which had projections that depended on the
    value of unused generic parameters of a function, resulting in an ICE in
    the 'generic-names' debuginfo test. If partitioning is enabled and the
    instance needs substitution then this is now skipped.
    
    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    b39e915 View commit details
    Browse the repository at this point in the history