Uh oh!
There was an error while loading. Please reload this page.
fix misleading type annotation diagonstics - #69456
Conversation
This comment has been minimized.
This comment has been minimized.
LeSeulArtichaut
commented
Feb 25, 2020
You may want to add a regression test for this. See the rustc book. |
This comment has been minimized.
This comment has been minimized.
744fb23 to
6153629Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6153629 to
6d7e5e2CompareJohnCSimon
commented
Apr 6, 2020
Ping from triage: |
contrun
commented
Apr 6, 2020
@JohnCSimon As I explained in #69455 (comment), the problem is that my PR will eliminate some relevant error message in some cases. The current error messages obviously more informative. I can push a new commit to resolve the conflict and use |
6d7e5e2 to
25ec438Compare
This comment has been minimized.
This comment has been minimized.
cramertj
commented
Apr 6, 2020
Yes, if you could |
This comment has been minimized.
This comment has been minimized.
ccbb4e1 to
88c45cfCompareThis solves the method call part of issue rust-lang#69455 I added a `target_span` field so as to pin down the exact location of the error. We need a dedicated field `found_exact_method_call` to prioritize situations like the test case `issue-69455.rs`. If we reuse `found_method_call`, `found_local_pattern` will show up first. We can not move `found_method_call` up, it is undesirable in various situations.
88c45cf to
3ae974fComparecontrun
commented
Apr 8, 2020
@cramertj It is now ready for review. I added two field in the original struct. They are needed because I can not find any way to it without affecting existing error messages. I added a |
crlf0710
commented
Apr 24, 2020
r? @estebank |
| | ------^^^^----------------- | ||
| | | | | ||
| | | cannot infer type for type `u64` | ||
| | this method call resolves to `<Self as Test<Rhs>>::Output` |
There was a problem hiding this comment.
It would be amazing if we actually suggested <u64 as Test<u64>>::test(23u64, xs.iter().sum()), but that is beyond the scope of this PR.
estebank
commented
Apr 24, 2020
The code looks ok to me. @contrun could you add tests for the cases you mention in your original comment would regress? I'm not sure I can see what they would be. |
@estebank Unfortunately, my current PR does not solve that yet. This is because |
estebank
commented
Apr 24, 2020
@contrun it is ok if this PR doesn't fix it, but having the test in the codebase helps us catch when an unrelated change either improves or degrades it. It also makes it easier for the reviewer to see the explicitly ignored cases. That being said, now I see what the problem is and it shouldn't block this PR. @bors r+ |
bors
commented
Apr 24, 2020
📌 Commit 3ae974f has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#69456 (fix misleading type annotation diagonstics) - rust-lang#71330 (Only run dataflow for const qualification if type-based check would fail) - rust-lang#71480 (Improve PanicInfo examples readability) - rust-lang#71485 (Add BinaryHeap::retain as suggested in rust-lang#42849) - rust-lang#71512 (Remove useless "" args) - rust-lang#71527 (Miscellaneous cleanup in `check_consts`) - rust-lang#71534 (Avoid unused Option::map results) - rust-lang#71535 (Fix typos in docs for keyword "in") Failed merges: r? @ghost
This solves the method call part of issue #69455