Skip to content

Representation of Rust references (&T, &mut T) and raw pointers (*const T, *mut T`) #16

Closed
@nikomatsakis

Description

@nikomatsakis

Representation of Rust references:

  • Are &T and &mut T guaranteed to be a pointer?
  • Must always be aligned, non-null
  • Guaranteed to be ABI compatible with C pointer types ("in every way?")
    • presuming that the referent is compatible, of course

Representation of raw pointers:

  • Guaranteed to be ABI compatible with C pointer types
    • presuming that the referent is compatible, of course

Other factors:

  • Considerations for storing things in the low bits of pointers
    • safe with raw pointers, not safe with references (from this comment)

Metadata

Metadata

Assignees

Labels

A-layoutTopic: Related to data structure layout (`#[repr]`)S-writeup-assignedStatus: Ready for a writeup and someone is assigned to it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions