-
Notifications
You must be signed in to change notification settings - Fork 13k
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
SessionDiagnostic derive does not consider #[label = "..."]
on Span field valid
#100714
Comments
@rustbot label +A-translation |
That's just somewhere that the dev guide is out of date unfortunately. We used to refer to Fluent slugs as strings, like in these examples, but then we switched to always referring to them using the "typed identifiers" that we generate, as that provides a degree of compile-time validation. So in these examples, If you want to submit a pull request to the dev guide with a fix for that then I'd happily approve it, otherwise I'll make a note to do this later today. |
I'll close this because it's not really a rustc bug, just some out of date documentation in the dev guide. |
So it's not possible to group multiple labels/notes/etc together with their respective diagnostic? |
It's still possible. |
Huh, that's slightly confusing, but good to know! So attributes really aren't attributes of slugs, but rather also part of the global namespace? In other words, you'd get a name clash if you had both |
Not quite - we cheat a little here. The trick is that That means you could use a |
That's a little hacky, but also means that manually derived |
I tried this code:
I expected to see this happen: As explained in the current rustc-dev-guide, the error message is fetched from
parser_if_expression_missing_condition
, and the attributes.condition_label
and.block_label
of this fluent resource are used to create two note subdiagnostics.Instead, this happened:
Working off current rustc master, 9c20b2a.
cc @davidtwco
The text was updated successfully, but these errors were encountered: