Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--pretty typed produces non-scalar casts #13552

Closed
klutzy opened this issue Apr 16, 2014 · 3 comments
Closed

--pretty typed produces non-scalar casts #13552

klutzy opened this issue Apr 16, 2014 · 3 comments
Labels
A-pretty Area: Pretty printing (incl. `-Z unpretty`).

Comments

@klutzy
Copy link
Contributor

klutzy commented Apr 16, 2014

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); }
                                 ^~~~~~
@klutzy
Copy link
Contributor Author

klutzy commented Apr 16, 2014

We may have to print let _a = A /* as A */ like --pretty identified does.

@eddyb
Copy link
Member

eddyb commented Apr 16, 2014

I would actually prefer /*: A */ - without being wrapped in a comment where it's valid to have a type hint (locals and closure expressions).

@alexcrichton alexcrichton added the A-pretty Area: Pretty printing (incl. `-Z unpretty`). label Nov 25, 2014
@steveklabnik
Copy link
Member

pretty=typed doesn't exist anymore.

matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Nov 16, 2022
bors pushed a commit to rust-lang-ci/rust that referenced this issue Feb 13, 2023
With rust-lang#13552 the depencency of on the command-group crate was introduced, which also
introduced a dependency on nix. That version of nix does not build on Haiku. This
change introduces a newer version of command-group, which also updates nix from
0.22.3 to 0.26.1, which is compatible on Haiku.
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 13, 2023
Update command-group from 1.0.8 to 2.0.1

With rust-lang#13552 the depencency of on the command-group crate was introduced, which also introduced a dependency on nix. That version of nix does not build on Haiku. This change introduces a newer version of command-group, which also updates nix from 0.22.3 to 0.26.1, which is compatible on Haiku.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pretty Area: Pretty printing (incl. `-Z unpretty`).
Projects
None yet
Development

No branches or pull requests

4 participants