Commit graph

28 commits

Author SHA1 Message Date
yukang 5d1796a608 soften the wording for removing type ascription 2023-05-01 16:37:00 +08:00
yukang f54489978d fix tests 2023-05-01 16:15:17 +08:00
yukang f44ebf7e54 fix test cases 2023-05-01 16:15:17 +08:00
Nilstrieb c63b6a437e Rip it out
My type ascription
Oh rip it out
Ah
If you think we live too much then
You can sacrifice diagnostics
Don't mix your garbage
Into my syntax
So many weird hacks keep diagnostics alive
Yet I don't even step outside
So many bad diagnostics keep tyasc alive
Yet tyasc doesn't even bother to survive!
2023-05-01 16:15:13 +08:00
Michael Goulet 015acc2611 Provide RHS type hint when reporting operator error 2023-04-27 01:34:03 +00:00
Michael Goulet 5cc4757421 More accurate argument blames, add some comments 2023-04-12 23:20:12 +00:00
Michael Goulet 5a71029dd3 Properly note source of arg mismatch 2023-04-12 23:20:12 +00:00
Michael Goulet 29aee6a125 Restore suggestion based off of backwards inference from bad usage to method call 2023-04-12 23:20:11 +00:00
Michael Goulet e72c45ad98 Point at which arg causes a binding to be constrained 2023-04-12 23:20:11 +00:00
Michael Goulet 42c4373ad1 Make note_source_of_type_mismatch_constraint simpler 2023-04-12 23:05:55 +00:00
yukang 65ad5f8de7 remove duplicated diagnostic for unclosed delimiter 2023-02-28 07:57:17 +00:00
yukang f01d0c02e7 Exit when there are unmatched delims to avoid noisy diagnostics 2023-02-28 07:55:19 +00:00
Michael Howell 3f374128ee diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
Matthias Krüger f65c6e416c
Rollup merge of #106347 - estebank:removal-suggestion, r=TaKO8Ki
More accurate spans for arg removal suggestion

Partially address #106304.
2023-02-16 17:51:24 +01:00
Martin Gammelsæter e159c1e0ec Skip method calls with arity mismatch 2023-02-15 18:52:23 +01:00
Martin Gammelsæter 08cc628e73 Add point-at-inference ui test for wrong arity case 2023-02-15 18:44:03 +01:00
Esteban Küber bd176ee591 Make removal suggestion not verbose 2023-02-14 20:22:10 +00:00
Esteban Küber 5d63e10318 rebase and review comments 2023-02-14 20:22:10 +00:00
Esteban Küber f02d8ec15e More accurate spans for arg removal suggestion 2023-02-14 20:22:09 +00:00
许杰友 Jieyou Xu (Joe) b58347a9c6
Don't expose type parameters and implementation details from macro expansion 2023-02-09 15:15:15 +08:00
Esteban Küber 62ba3e70a1 Modify primary span label for E0308
The previous output was unintuitive to users.
2023-01-30 20:12:19 +00:00
Esteban Küber 62aff3bbc7 tweak wording 2023-01-23 14:47:00 +00:00
Esteban Küber df81147b51 Ensure suggestion correctness 2023-01-23 14:47:00 +00:00
Esteban Küber e477cf9475 Suggest coercion of Result using ?
Fix #47560.
2023-01-23 14:46:59 +00:00
Matthias Krüger f04f97cea4
Rollup merge of #106820 - m-ou-se:macro-type-error-thing, r=estebank
Deprioritize fulfillment errors that come from expansions.

Fixes (part of?) #69455
2023-01-14 18:45:27 +01:00
Mara Bos 6821adb651 Deprioritize fulfillment errors that come from expansions. 2023-01-14 14:05:26 +01:00
Robin Schroer a3cf3822d2
Emit a hint for bad call return types due to generic arguments
When the return type of a function call depends on the type of an
argument, e.g.

```
fn foo<T>(x: T) -> T {
    x
}
```

and the expected type is set due to either an explicitly typed
binding, or because the call to the function is in a tail position
without semicolon, the current error implies that the argument in the
call has the wrong type.

This new hint highlights that the expected type doesn't match the
returned type, which matches the argument type, and that that's why
we're flagging the argument type.

Fixes #43608.
2023-01-13 13:34:55 +09:00
Albert Larsan cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00