Skip to content

--pretty typed produces non-scalar casts #13552

Closed
@klutzy

Description

@klutzy
pub struct A;

pub fn f() {
    let _a = A;
}

#[deriving(Clone)]
pub struct B;

rustc --pretty=typed produces:

...

pub struct A;

pub fn f() { let _a = (A as A); }

#[deriving(Clone)]
pub struct B;
#[automatically_derived]
impl ::std::clone::Clone for B {
    #[inline]
    fn clone(&self) -> B {
        (match (*(self as &B) as B) { B => (B as B) } as B)
    }
}

where all as is invalid e.g.

a.rs.rs:5:24: 5:30 error: non-scalar cast: `A` as `A`
a.rs.rs:5 pub fn f() { let _a = (A as A); }
                                 ^~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-prettyArea: Pretty printing (including `-Z unpretty`)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions