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 #69749

Merged
merged 13 commits into from
Jul 21, 2020
Merged

Polymorphization #69749

merged 13 commits into from
Jul 21, 2020

Commits on Jul 20, 2020

  1. mir: avoid double substitution

    This commit avoids a natural, free-range double substitution error by
    monomorphizing the projection element before getting the type.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    996bc9a View commit details
    Browse the repository at this point in the history
  2. mir: rename should_monomorphize_locally

    This commit renames `should_monomorphize_locally` to
    `should_codegen_locally` which better describes what the function
    determines once polymorphization is added.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    576deef View commit details
    Browse the repository at this point in the history
  3. ty: STILL_FURTHER_SPECIALIZABLE w/out prnt subst

    This commit modifies the `STILL_FURTHER_SPECIALIZABLE` flag so that the
    flag isn't set by the parent substs of closures or generators.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    c6ed442 View commit details
    Browse the repository at this point in the history
  4. trait_sel: only test predicates w/ no substs

    This commit modifies the `substitute_normalize_and_test_predicates`
    query, renaming it to `impossible_predicates` and only checking
    predicates which do not require substs. By making this change,
    polymorphization doesn't have to explicitly support vtables.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    ce7c48f View commit details
    Browse the repository at this point in the history
  5. ty: add doc comments to Generics methods

    This commit adds doc comments to the `param_at`, `region_param` and
    `const_param` methods on the `Generics` struct.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    842fa0c View commit details
    Browse the repository at this point in the history
  6. debuginfo: no type metadata if substs reqd

    This commit skips generating debuginfo type metadata if substitutions
    are required by the type. This avoids ICEs that result from layouts
    of types with substitutions being computed.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    5bf2c7d View commit details
    Browse the repository at this point in the history
  7. debuginfo: add type metadata for params

    This commit adds type metadata for generic parameters (that arise from
    polymorphization). Generic parameter metadata is considered zero-sized
    and named after the generic parameter.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    19e8495 View commit details
    Browse the repository at this point in the history
  8. shim: adjust valid shim asserts

    This commit makes valid shim asserts more specific - checking for the
    specific types that are valid for a given type of shim - and removes
    asserts for types which require substitutions.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    47756bb View commit details
    Browse the repository at this point in the history
  9. mir: unused_generic_params query

    This commit implements the `unused_generic_params` query, an initial
    version of polymorphization which detects when an item does not use
    generic parameters and is being needlessly monomorphized as a result.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    2989fea View commit details
    Browse the repository at this point in the history
  10. ty: normalize fn sigs before subst

    This commit normalizes function signatures for instances before
    substituting, a workaround for polymorphization considering
    parameters unused when they show up in the signature, but not the
    body (due to being normalized).
    
    Unfortunately, this causes test output to change with the parallel
    compiler only.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    f52c729 View commit details
    Browse the repository at this point in the history
  11. metadata: record unused_generic_params

    This commit records the results of `unused_generic_params` in crate
    metadata, hopefully improving performance.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    5ce29d3 View commit details
    Browse the repository at this point in the history
  12. mir: use attribute over -Z polymorphize-errors

    This commit replaces the `-Z polymorphize-errors` debugging flag with a
    `#[rustc_polymorphize_error]` attribute for use on functions.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    b1f8bd6 View commit details
    Browse the repository at this point in the history
  13. index: introduce and use FiniteBitSet

    This commit introduces a `FiniteBitSet` type which replaces the manual
    bit manipulation which was being performed in polymorphization.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    4b99699 View commit details
    Browse the repository at this point in the history