Skip to content

document what "thin pointers" are #41300

Open
@droundy

Description

@droundy

I got the following error message:

error: casting `*const T` as `usize` is invalid
  --> src/refset.rs:17:9
   |
17 |         (self.0 as *const T as usize).hash(state);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: cast through a thin pointer first

which was quite clear, except that there seems to be no documentation as to what a "thin" pointer is. I ended up through guesswork casting to a *const usize in between which made this work for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.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