Skip to content

Phantom types use repr(C), making them not "trivial" for repr(transparent) purposes #41

Description

@RalfJung

This crate interacts with rust-lang/rust#78586 in a suboptimal way:

#[phantom]
struct MyPhantom<T: ?Sized>;

#[repr(transparent)]
struct MyWrapper<T>(T, MyPhantom<T>);

The MyWrapper declaration triggers a FCW (likely to become a hard error soon: rust-lang/rust#155299) because MyPhantom contains a repr(C) type and repr(C) is an ABI-relevant marker on the type which means we cannot in general promise that it can just be ignored.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions