Improve error message and snippet for "did you mean x"#36798
Improve error message and snippet for "did you mean x"#36798bors merged 1 commit intorust-lang:masterfrom
x"#36798Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
For the default cause, I'd just use an "unknown field" label |
|
@gavinb nice! Can you change the test to be a UI-style test? I agree with @jonathandturner, something generic like "unknown field" would be a good fallback label. Ideally, we'd have a test for that case too. |
|
@nikomatsakis I've added the "unknown field" handling, converted the test to UI style test and added a test specifically for the unknown field case. |
|
Looks like adding the label means also updating a set of tests that don't expect it yet. Here's what I see from Travis: |
|
Ok, I'll run the complete test suite and fix up the above. (Didn't before as I was running on batteries!) Will update PR once full build and test suite pass. |
27f3c70 to
338bef8
Compare
- Fixes rust-lang#36164 - Part of rust-lang#35233 - handles unknown fields - uses UI-style tests - update all related tests (cfail, ui, incremental)
|
@jonathandturner I went through and updated all the tests so that |
|
Thanks! @bors: r+ rollup |
|
📌 Commit 99aae9b has been approved by |
Improve error message and snippet for "did you mean `x`" - Fixes rust-lang#36164 - Part of rust-lang#35233 Based on the standalone example https://is.gd/8STXMd posted by @nikomatsakis and using the third formatting option mentioned in rust-lang#36164 and agreed by @jonathandturner. Note however this does not address the question of [how to handle an empty or unknown suggestion](rust-lang#36164 (comment)). @nikomatsakis any suggestions on how best to address that part?
x" is not so helpful #36164Based on the standalone example https://is.gd/8STXMd posted by @nikomatsakis and using the third formatting option mentioned in #36164 and agreed by @jonathandturner.
Note however this does not address the question of how to handle an empty or unknown suggestion. @nikomatsakis any suggestions on how best to address that part?