-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #41236 - cengizIO:master, r=nikomatsakis
Move E0101 and E0102 logic into new E0282 mechanism #40013 Hello there! ## What's this? Previously, me and @nikomatsakis worked on error messages of uninferred locals. (#38812) This aims to build up on that by moving certain type checks from `writeback`. With this, `E0101` and `E0102` errors are getting obsoleted and no longer thrown. They're replaced with customized versions of `E0282`s instead. ## Sample Error Messages #### `E0101` is getting converted into: ```rust error[E0282]: type annotations needed --> test.rs:2:14 | 2 | let x = |_| {}; | ^ consider giving this closure parameter a type error: aborting due to previous error ``` #### `E0102` is getting converted into: ```rust error[E0282]: type annotations needed --> test.rs:2:9 | 2 | let x = []; | ^ | | | consider giving `x` a type | cannot infer type for `[_; 0]` error: aborting due to previous error ``` ## Annoyances - I think we need to change our way of type name resolving in relevant places, because that `[_; 0]` looks horrible IMHO. - I'm not terribly happy with the note ordering of errors. So please do point to code that might help me accomplish this. ## Tests Tests of `E0101` and `E0102` are getting converted from `compile-fail` to `ui` tests. ## Documentation Please help me with documentation update. There are some confusing places that needed an update but I'm not sure if I did the right ones. Please do comment on messages, layouts and other details. ## Appreciation Huge thanks goes to @nikomatsakis for being a patient and humble mentor along this long journey. 🍻
- Loading branch information
Showing
17 changed files
with
221 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.