rust/src/test
bors 6eff103aa1 Auto merge of #46461 - zackmdavis:elemental_method_suggestion_jamboree, r=estebank
type error method suggestions use whitelisted identity-like conversions

![method_jamboree_summit](https://user-images.githubusercontent.com/1076988/33523646-e5c43184-d7c0-11e7-98e5-1bff426ade86.png)

Previously, on a type mismatch (and if this wasn't preëmpted by a
higher-priority suggestion), we would look for argumentless methods
returning the expected type, and list them in a `help` note. This had two
major shortcomings: firstly, a lot of the suggestions didn't really make
sense (if you used a &str where a String was expected,
`.to_ascii_uppercase()` is probably not the solution you were hoping
for). Secondly, we weren't generating suggestions from the most useful
traits! We address the first problem with an internal
`#[rustc_conversion_suggestion]` attribute meant to mark methods that keep
the "same value" in the relevant sense, just converting the type. We
address the second problem by making `FnCtxt.probe_for_return_type` pass
the `ProbeScope::AllTraits` to `probe_op`: this would seem to be safe
because grep reveals no other callers of `probe_for_return_type`.

Also, structured suggestions are pretty and good for RLS and friends.

Unfortunately, the trait probing is still not all one would hope for: at a
minimum, we don't know how to rule out `into()` in cases where it wouldn't
actually work, and we don't know how to rule in `.to_owned()` where it
would. Issues #46459 and #46460 have been filed and are ref'd in a FIXME.

This is hoped to resolve #42929, #44672, and #45777.
2018-01-13 02:15:19 +00:00
..
codegen Auto merge of #46739 - arielb1:simple-loops, r=nikomatsakis 2018-01-05 02:31:19 +00:00
codegen-units Convert codegen-unit tests to use start instead of main 2017-12-26 12:26:39 +01:00
compile-fail Rollup merge of #47382 - topecongiro:issue-43105, r=eddyb 2018-01-13 03:17:08 +08:00
compile-fail-fulldeps Same change to point at borrow for mir errors 2017-12-15 13:52:05 -08:00
debuginfo Debuginfo Shadowed Variable test: fix check numbering 2018-01-06 11:10:17 +00:00
incremental Remove excessive trailing newlines. 2017-12-30 15:50:52 +08:00
mir-opt Add trailing newlines to files which have no trailing newlines. 2017-12-30 15:50:52 +08:00
parse-fail Auto merge of #47156 - petrochenkov:extpath, r=nikomatsakis 2018-01-07 00:51:42 +00:00
pretty Fix whitespacing issues in pretty-printing of bounds 2017-12-20 00:23:18 +03:00
run-fail Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI. 2018-01-02 14:11:41 +01:00
run-fail-fulldeps
run-make Fix typo 2018-01-10 09:15:51 +11:00
run-pass Rollup merge of #47344 - topecongiro:fixed-ices, r=alexcrichton 2018-01-13 03:17:00 +08:00
run-pass-fulldeps Prefer to use attr::contains_name() and attr::find_by_name() 2017-12-28 12:32:24 +09:00
run-pass-valgrind Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI. 2018-01-02 14:11:41 +01:00
rustdoc Rollup merge of #47263 - ollie27:rustdoc_private_macro_import, r=GuillaumeGomez 2018-01-09 03:37:19 +08:00
ui Auto merge of #46461 - zackmdavis:elemental_method_suggestion_jamboree, r=estebank 2018-01-13 02:15:19 +00:00
ui-fulldeps Add 'Span.parent()' and 'Span.source()' to proc_macro API. 2018-01-03 00:20:33 -08:00
COMPILER_TESTS.md A few small improvements to the contributing docs 2017-12-20 22:18:13 +02:00