Skip to content

Disallow return types of &'static foo from being written as &foo #8309

Closed
@bstrie

Description

@bstrie

As far as I can tell, when &str appears as the return type of a function, this silently implies &'static str. I think this holds for all other types as well, not just str. I propose that we force people to be explicit here, since our general rule is that any borrowed pointer that is returned from a function must have an explicit lifetime.

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