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

Disentangle Debug and Display for Ty. #115661

Merged
merged 1 commit into from
Sep 11, 2023

Commits on Sep 11, 2023

  1. Disentangle Debug and Display for Ty.

    The `Debug` impl for `Ty` just calls the `Display` impl for `Ty`. This
    is surprising and annoying. In particular, it means `Debug` doesn't show
    as much information as `Debug` for `TyKind` does. And `Debug` is used in
    some user-facing error messages, which seems bad.
    
    This commit changes the `Debug` impl for `Ty` to call the `Debug` impl
    for `TyKind`. It also does a number of follow-up changes to preserve
    existing output, many of which involve inserting
    `with_no_trimmed_paths!` calls. It also adds `Display` impls for
    `UserType` and `Canonical`.
    
    Some tests have changes to expected output:
    - Those that use the `rustc_abi(debug)` attribute.
    - Those that use the `EMIT_MIR` annotation.
    
    In each case the output is slightly uglier than before. This isn't
    ideal, but it's pretty weird (particularly for the attribute) that the
    output is using `Debug` in the first place. They're fairly obscure
    attributes (I hadn't heard of them) so I'm not worried by this.
    
    For `async-is-unwindsafe.stderr`, there is one line that now lacks a
    full path. This is a consistency improvement, because all the other
    mentions of `Context` in this test lack a path.
    nnethercote committed Sep 11, 2023
    Configuration menu
    Copy the full SHA
    64ea8eb View commit details
    Browse the repository at this point in the history