Skip to content

Lifetime arguments are completely ignored in method calls #42403

Closed
@petrochenkov

Description

@petrochenkov

This snippet successfully compiles despite f not having lifetime parameters and even 'a, 'b, 'c being non-existent.

struct S;

impl S {
    fn f(self) {}   
}

fn main() {
    S.f::<'a, 'b, 'c>();
}

The parser parses lifetime arguments, but doesn't store them anywhere, so they don't present in AST/HIR.
The issue exists since Rust 1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions