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

Implement (but don't use) valtree and refactor in preparation of use #82936

Merged
merged 27 commits into from
Mar 17, 2021

Commits on Mar 12, 2021

  1. Implement valtree

    valtree is a version of constants that is inherently safe to be used within types.
    This is in contrast to ty::Const which can have different representations of the same value. These representation differences can show up in hashing or equality comparisons, breaking type equality of otherwise equal types.
    valtrees do not have this problem.
    oli-obk committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    a4fbac1 View commit details
    Browse the repository at this point in the history
  2. Intern valtree field vector

    oli-obk committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    0fe4f38 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    858216c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    09f7f91 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    019dba0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4d917fa View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5e8a89b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b729cc9 View commit details
    Browse the repository at this point in the history
  9. Split pretty printer logic for scalar int and scalar ptr

    Value trees won't have scalar ptr at all, so we need a scalar int printing method anyway. This way we'll be able to share that method between all const representations.
    oli-obk committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    0bb367e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d5eec65 View commit details
    Browse the repository at this point in the history
  11. Add ty helper function for mir constants

    This is in preparation of the `literal` field becoming an enum that distinguishes between type level constants and runtime constants
    oli-obk committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    914df2a View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    3ecde6f View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    3127a9c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    20f7379 View commit details
    Browse the repository at this point in the history
  15. Visit mir::Constant::user_ty for completeness.

    It's not necessary yet, but it may become necessary with things like lazy normalization.
    oli-obk committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    6ca1d87 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    c51749a View commit details
    Browse the repository at this point in the history
  17. Run rustfmt

    oli-obk committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    11ddd22 View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2021

  1. Configuration menu
    Copy the full SHA
    c30c1be View commit details
    Browse the repository at this point in the history
  2. Document valtree

    oli-obk committed Mar 15, 2021
    Configuration menu
    Copy the full SHA
    bc8641a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f646c1e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c01c494 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0dd5a1b View commit details
    Browse the repository at this point in the history
  6. Do not expose fallible to_int operation on Scalar.

    Any use of it has been shown to be a bug in the past.
    oli-obk committed Mar 15, 2021
    Configuration menu
    Copy the full SHA
    9f407ae View commit details
    Browse the repository at this point in the history
  7. Pacify tidy

    oli-obk committed Mar 15, 2021
    Configuration menu
    Copy the full SHA
    1ffd21a View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2021

  1. Update compiler/rustc_mir/src/const_eval/mod.rs

    Co-authored-by: Ralf Jung <post@ralfj.de>
    oli-obk and RalfJung committed Mar 16, 2021
    Configuration menu
    Copy the full SHA
    f0997fa View commit details
    Browse the repository at this point in the history
  2. Update compiler/rustc_middle/src/ty/consts/valtree.rs

    Co-authored-by: Ralf Jung <post@ralfj.de>
    oli-obk and RalfJung committed Mar 16, 2021
    Configuration menu
    Copy the full SHA
    5b9bd90 View commit details
    Browse the repository at this point in the history
  3. Update compiler/rustc_middle/src/ty/consts/valtree.rs

    Co-authored-by: Ralf Jung <post@ralfj.de>
    oli-obk and RalfJung committed Mar 16, 2021
    Configuration menu
    Copy the full SHA
    c4d564c View commit details
    Browse the repository at this point in the history