Skip to content

StrInterner exposes unsafe functions as safe #17181

Closed
@tbu-

Description

@tbu-

The StrInterner from librustc has two conflicting methods:

/// Returns this string with lifetime tied to the interner.
/// Since strings may never be removed from the interner,
/// this is safe.
fn get_ref<'a>(&'a self, idx: Name) -> &'a str;

And

fn clear(&self);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions