54597ba11f
Suggest replacing `typeof(...)` with an actual type This PR adds suggestion to replace `typeof(...)` with an actual type of `...`, for example in case of `typeof(1)` we suggest replacing it with `i32`. If the expression 1. Is not const (`{ let a = 1; let _: typeof(a); }`) 2. Can't be found (`let _: typeof(this_variable_does_not_exist)`) 3. Or has non-suggestable type (closure, generator, error, etc) we don't suggest anything. The 1 one is sad, but it's not clear how to support non-consts expressions for `typeof`. _This PR is inspired by [this tweet]._ [this tweet]: https://twitter.com/compiler_errors/status/1511945354752638976
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.