Skip to content

OwningRef is included in the compiler despite known soundness problems. #109974

Closed
@noamtashma

Description

@noamtashma

The OwningRef module in rustc_data_structures, which seems to be a copy of this crate (perhaps with small additions?), has known soundness issues.

I wrote an article about the soundness problems here.

It's used in rustc in MetadataRef and related things. (I don't know if it's used anywhere else).

I don't know of any actual unsafe use of this crate in rustc, but I haven't actually tried to look for any.

IMO, in order to keep the code safe, either owning_ref should be replaced with something else, or otherwise, it should be updated to contain the known fixes to these soundness problems (here).

Metadata

Metadata

Assignees

Labels

C-discussionCategory: Discussion or questions that doesn't represent real issues.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