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

Miscellaneous cleanup to formatting #69209

Merged
merged 4 commits into from
Feb 26, 2020
Merged

Commits on Feb 15, 2020

  1. Formatter::sign is &'static str

    The contents were always UTF-8 anyway, and &str has an equivalent representation
    to &[u8], so this should not affect performance while removing unsafety at
    edges.
    
    It may be worth exploring a further adjustment that stores a single byte
    (instead of 16) as the contents are always "", "-", or "+".
    Mark-Simulacrum committed Feb 15, 2020
    Configuration menu
    Copy the full SHA
    bd12cd3 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2020

  1. Configuration menu
    Copy the full SHA
    6c45e45 View commit details
    Browse the repository at this point in the history
  2. Move to using an extern type for opaqueness

    This prevents accidental dereferences and so forth of the Void type, as well as
    cleaning up the error message to reference Opaque rather than the more
    complicated PhantomData type.
    Mark-Simulacrum committed Feb 17, 2020
    Configuration menu
    Copy the full SHA
    34ef8f5 View commit details
    Browse the repository at this point in the history
  3. Move the show_usize marker function to a static

    Currently, function items are always tagged unnamed_addr, which means that
    casting a function to a function pointer is not guaranteed to produce a
    deterministic address. However, once a function pointer is created, we do expect
    that to remain stable. So, this changes the show_usize function to a static
    containing a function pointer and uses that for comparisons.
    
    Notably, a *static* may have 'unstable' address, but the function pointer within
    it must be constant.
    
    Resolves issue 58320.
    Mark-Simulacrum committed Feb 17, 2020
    Configuration menu
    Copy the full SHA
    f6bfdc9 View commit details
    Browse the repository at this point in the history