Skip to content

returning an unconstrained, bound region should be an error #2478

Closed
@nikomatsakis

Description

@nikomatsakis

If you have a function like this:

fn foo() -> &a.int

we should report an error. The only thing you could legally do in that case is fail or return a static item, so you miight as well write:

fn foo() -> &static.int

This sounds like a good lint warning/error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions