Skip to content

Why are region parameters not allowed on type parameters? #3277

Closed
@bblum

Description

@bblum
unsafe fn transmute_region<T>(x: T/&a) -> T/&b {
    unsafe { unsafe::transmute(x) }
}

refuses to compile with:

trans.rs:1:33: 1:34 error: region parameters are not allowed on this type
trans.rs:1 unsafe fn transmute_region<T>(x: T/&a) -> T/&b {
                                            ^
trans.rs:1:42: 1:43 error: region parameters are not allowed on this type
trans.rs:1 unsafe fn transmute_region<T>(x: T/&a) -> T/&b {
                                                     ^

Is there some unsafety lurking, is it impossible to implement, or is it just not implemented?

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