``` Rust pub struct A; pub fn f() { let _a = A; } #[deriving(Clone)] pub struct B; ``` `rustc --pretty=typed` produces: ``` Rust ... 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); } ^~~~~~ ```
Activity
klutzy commentedon Apr 16, 2014
We may have to print
let _a = A /* as A */like--pretty identifieddoes.eddyb commentedon 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).steveklabnik commentedon Nov 7, 2015
pretty=typed doesn't exist anymore.
Auto merge of rust-lang#13552 - Veykril:flycheck-process-group, r=Vey…
Update command-group from 1.0.8 to 2.0.1
Auto merge of rust-lang#13956 - nielx:fix/nix-haiku-fix, r=lnicola