Skip to content

Improve pretty printing of const raw pointers #65349

Open
@BenLewis-Seequent

Description

@BenLewis-Seequent

#64986 changed the pretty-printing of const raw pointers to {pointer}. This can cause confusing diagnostics due to the lack of detail the printing of raw pointers provides, like the following:

error[E0308]: mismatched types
  --> $DIR/raw-ptr-const-param.rs:7:38
   |
LL |     let _: Const<{15 as *const _}> = Const::<{10 as *const _}>;
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{pointer}`, found `{pointer}`
   |
   = note: expected type `Const<{pointer}>`
              found type `Const<{pointer}>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions