Skip to content

The Drop flag is a footgun for #[repr(C)] #24585

Closed
@pnkfelix

Description

@pnkfelix

(imported from improperly closed bug #18380)

As suggested by @huonw:

the improper_ctypes lint should check for repr(C) on the RHS of a Drop impl. "warning: implementing Drop changes the representation of the type, conflicting with repr(C)".

(It should presumably also check for #[unsafe_no_drop_flag] and not warn if it exists.)

Until #5016 is done, we really should lint for this scenario. People have run into it

Metadata

Metadata

Assignees

Labels

P-highHigh priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions