Skip to content

Region parameterization inference does not play well with explicit self #5224

Closed
@nikomatsakis

Description

@nikomatsakis

Right now the compiler incorrectly infers that a trait like:

trait Foo {
    fn get_foo(&self) -> &self/int;
}

must be region parameterized. This leads to various errors, for example using the Map trait. This will be a non-issue once the new region syntax is complete, because region parameterization will be explicit, but it's causing issues now. I've got a patch I was going to push as part of a larger pull request but due to the fact that I'm having trouble landing that big patch I am breaking it up into bits, and hence opening a separate issue for this.

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