Skip to content

Can't put lifetime annotation on parameterized type #4290

Closed
@stevenblenkinsop

Description

@stevenblenkinsop

This code fails to compile:

enum E1 = ∫

fn f1(v: &r/int) -> E1/&r { E1(v) }

enum E2<T> = &T;

fn f2<T>(v: &r/T) -> E2<T>/&r { E2(v) }

fn main() {
        let v = &5;
        io::println(fmt!("%d", **f1(v)));
        io::println(fmt!("%d", **f2(v)));
}

test.rs:7:26: 7:27 error: expected { but found /
test.rs:7 fn f2<T>(v: &r/T) -> E2<T>/&r { E2(v) }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions