Skip to content

Can not create static function pointer to generic instantiation #13971

Closed
@Kimundi

Description

@Kimundi

Testcase:

fn foo<T>(a: T) -> T { a }

static BLOCK_FN: fn(usize) -> uint = foo::<usize>;

fn main() {}

Output:

bug_generic_static_function_ptr.rs:3:37: 3:48 error: paths in constants may only refer to items without type parameters
bug_generic_static_function_ptr.rs:3 static BLOCK_FN: fn(usize) -> uint = foo::<usize>;
                                                                         ^~~~~~~~~~~
error: aborting due to previous error

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