-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
-Z show-span crashes rustc #17115
Labels
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
sfackler
added a commit
to sfackler/rust
that referenced
this issue
Sep 10, 2014
bors
added a commit
that referenced
this issue
Sep 11, 2014
lnicola
pushed a commit
to lnicola/rust
that referenced
this issue
Apr 24, 2024
…, r=Veykril Try to generate more meaningful names in json converter I just found out about rust-analyzer json converter, but I think it would be more convenient, if names were more useful, like using the names of the keys. Let's look at some realistic arbitrary json: ```json { "user": { "address": { "street": "Main St", "house": 3 }, "email": "example@example.com" } } ``` I think, new generated code is much easier to read and to edit, than the old: ```rust // Old struct Struct1{ house: i64, street: String } struct Struct2{ address: Struct1, email: String } struct Struct3{ user: Struct2 } // New struct Address1{ house: i64, street: String } struct User1{ address: Address1, email: String } struct Root1{ user: User1 } ``` Ideally, if we drop the numbers, I can see it being usable just as is (may be rename root) ```rust struct Address{ house: i64, street: String } struct User{ address: Address, email: String } struct Root{ user: User } ``` Sadly, we can't just drop them, because there can be multiple fields (recursive) with the same name, and we can't just easily retroactively add numbers if the name has 2 instances due to parsing being single pass. We could ignore the `1` and add number only if it's > 1, but I will leave this open to discussion and right now made it the simpler way In sum, even with numbers, I think this PR still helps in readability
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Platform: Linux Mint 16, 64-bit
Rustc version: rustc 0.12.0-pre-nightly (09cebc2 2014-09-07 00:31:28 +0000)
Sample Program:
When compiled with -Z show-span, the compiler will fail with `task 'rustc' failed at:
Backtrace:
The text was updated successfully, but these errors were encountered: