rustc_parse: diagnostics migration, v4#105670
Conversation
|
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
This comment was marked as resolved.
This comment was marked as resolved.
0d23e8e to
7658faa
Compare
src/test/ui/pub/pub-ident-fn-3.rs
Outdated
There was a problem hiding this comment.
Why were these tests deleted?
There was a problem hiding this comment.
They weren't deleted, just changed and renamed. I've split the changing and renaming into different commits to ease reviewing.
There was a problem hiding this comment.
What do these changes to the macros do? Also, it might be nice to have that message be a bit more helpful, like: "it's not supported at all" or "try x instead".
There was a problem hiding this comment.
I've improved the message. The problem is that #[suggestion(code = "foo")] spans: Vec<Span> could either mean:
for span in spans {
span_suggestion(span, "foo");
}or:
multipart_suggestion(spans.into_iter().map(|span| (span, "foo")));In order to avoid ambiguity, a Subdiagnostic must be used (either a Vec of #[suggestion] subdiagnostics, or a single #[multipart_suggestion] subdiagnostic).
There was a problem hiding this comment.
Ah, so the change is not "forbid x" but "give a better error if x happens"? Thanks for this change, these sort of papercuts have been annoying me in the past 👍
Please add this case to one of the files in https://github.com/rust-lang/rust/tree/master/src/test/ui-fulldeps/session-diagnostic
There was a problem hiding this comment.
It is "forbid x", but previously "x" was the first behaviour, which, while technically a correct interpretation, is probably not what most people would want. This behaviour wasn't actually used anywhere, it's just a preventative measure.
There was a problem hiding this comment.
Thanks for clarifying, that seems like a good idea.
671c276 to
7843eb0
Compare
This comment was marked as resolved.
This comment was marked as resolved.
7843eb0 to
2a46df2
Compare
mejrs
left a comment
There was a problem hiding this comment.
(now to wait for someone with r+ permissions to drive by 😅 )
|
📌 Commit ddfdcbe5e279ee76e618c6f29f50953abb537527 has been approved by It is now in the queue for this repository. |
This comment was marked as resolved.
This comment was marked as resolved.
ddfdcbe to
02141b6
Compare
|
@rustbot ready |
The check previously matched this, and suggested adding a missing `struct`: pub Foo(...): It was probably intended to match this instead (semicolon instead of colon): pub Foo(...);
This is required in order to support translatable diagnostics.
#[derive(Subdiagnostic)] does not allow multiple subdiagnostics on one variant, as in NonItemInItemListSub::Other.
d623e3f to
0d0d369
Compare
|
@rustbot ready |
|
@bors r=davidtwco |
|
🌲 The tree is currently closed for pull requests below priority 50. This pull request will be tested once the tree is reopened. |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (131f0c6): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
This is all the
rustc_parsemigrations I have in store right now; unfortunately life is pretty busy right now, so I won't be able to do much more in the near future.cc #100717
r? @davidtwco