about summary refs log tree commit diff
path: root/src/test/ui/suggestions
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-20970/+0
2023-01-10Auto merge of #106607 - ↵bors-17/+55
compiler-errors:be-more-accurate-abt-method-suggestions, r=oli-obk Consider return type when giving various method suggestions 1. Fix a bug in method probe where we weren't normalizing `xform_ret_ty` for non-`impl` method candidates. This shouldn't affect happy-path code, since we only use `xform_ret_ty` when probing methods for diagnostics (I think). 2. Pass the return type expectation down to `lookup_probe`/`probe_for_name` usages in diagnostics. Added a few UI tests to gate against bad suggestions. 3. Make a `FnCtxt::lookup_probe_for_diagnostic` which properly passes down `IsSuggestion(true)`. Should help suppress other weird notes in some corner cases.
2023-01-09Consider method return type for various method suggestionsMichael Goulet-17/+55
2023-01-09Rollup merge of #105655 - RedDocMD:bug-105645, r=oli-obkfee1-dead-0/+26
Remove invalid case for mutable borrow suggestion If we have a call such as `foo(&mut buf)` and after reference collapsing the type is inferred as `&T` where-as the required type is `&mut T`, don't suggest `foo(&mut mut buf)`. This is wrong syntactically and the issue lies elsewhere, not in the borrow. Fixes #105645
2023-01-08Rollup merge of #106497 - chenyukang:yukang/fix-106443-sugg-clone, r=estebankMichael Goulet-0/+107
Suggest using clone when we have &T and T implemented Clone Fixes #106443
2023-01-08Rollup merge of #106363 - estebank:mutability-mismatch-arg, r=NilstriebMichael Goulet-5/+5
Structured suggestion for `&mut dyn Iterator` when possible Fix #37914.
2023-01-08Remove extra spaceYukang-1/+1
2023-01-07use type_implements_trait to check Param cloneyukang-2/+2
2023-01-06Change wording to avoid being misleadingEsteban Küber-5/+2
2023-01-06Structured suggestion for `&mut dyn Iterator` when possibleEsteban Küber-1/+4
Fix #37914.
2023-01-07Suggest possible clone when we have &Tyukang-0/+107
2023-01-05Correct detection of elided lifetimes in impl-trait.Camille GILLOT-0/+5
2023-01-05Tweak wording of fn call with wrong number of argsEsteban Küber-22/+22
2022-12-31Auto merge of #106245 - estebank:mutability-suggestions, r=jyn514bors-18/+31
Use verbose suggestions for mutability errors
2022-12-29Rollup merge of #106190 - estebank:multiline-start-tweak, r=jackh726Matthias Krüger-4/+1
Account for multiple multiline spans with empty padding Instead of ``` LL | fn oom( | __^ | | _| | || LL | || ) { | ||_- LL | | } | |__^ ``` emit ``` LL | // fn oom( LL | || ) { | ||_- LL | | } | |__^ ```
2022-12-29Account for multiple multiline spans with empty paddingEsteban Küber-4/+1
Instead of ``` LL | fn oom( | __^ | | _| | || LL | || ) { | ||_- LL | | } | |__^ ``` emit ``` LL | // fn oom( LL | || ) { | ||_- LL | | } | |__^ ```
2022-12-28Use verbose suggestions for mutability errorsEsteban Küber-18/+31
2022-12-28Rollup merge of #106199 - estebank:quiet-type-err-in-binding, r=compiler-errorsMatthias Krüger-20/+24
Silence knock-down errors on `[type error]` bindings Fix #56036, fix #76589.
2022-12-28Rollup merge of #106172 - estebank:suggest-impl-trait, r=compiler-errorsMatthias Krüger-2/+2
Suggest `impl Iterator` when possible for `_` return type Address #106096.
2022-12-27Silence knock-down errors on `[type error]` bindingsEsteban Küber-20/+24
Fix #56036, fix #76589.
2022-12-27Shorten type in noteEsteban Küber-2/+2
2022-12-27Rollup merge of #105852 - compiler-errors:hex-float-lit, r=cjgillotMichael Goulet-0/+61
Suggest rewriting a malformed hex literal if we expect a float Fixes #104706
2022-12-27Rollup merge of #105765 - estebank:range-typo, r=compiler-errorsMichael Goulet-0/+78
Detect likely `.` -> `..` typo in method calls Fix #65015.
2022-12-27Make resolve suggestion more genericEsteban Küber-1/+1
2022-12-27review comments: make suggestion more accurateEsteban Küber-20/+31
2022-12-27Suggest rewriting a malformed hex literal if we expect a floatMichael Goulet-0/+61
2022-12-27Auto merge of #106177 - matthiaskrgr:rollup-oe7z8ix, r=matthiaskrgrbors-0/+94
Rollup of 4 pull requests Successful merges: - #105515 (Account for macros in const generics) - #106146 (Readme: update section on how to run `x.py`) - #106150 (Detect when method call on LHS might be shadowed) - #106174 (Remove unused empty CSS rules in ayu theme) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-27Auto merge of #106095 - estebank:pin-mut-reborrow, r=compiler-errorsbors-0/+8
Suggest `Pin::as_mut` when encountering borrow error Fix #65409 for `Pin<&mut T>`.
2022-12-26Detect likely `.` -> `..` typo in method callsEsteban Küber-0/+67
Fix #65015.
2022-12-26Fix suggestion when there are arguments in the methodEsteban Küber-0/+48
2022-12-26Tweak wordingEsteban Küber-2/+5
2022-12-26Detect when method call on LHS might be shadowedEsteban Küber-0/+43
Address #39232.
2022-12-25Create new inference contextEsteban Küber-0/+8
2022-12-24Rollup merge of #105872 - chenyukang:yukang/fix-105494-remove-method-call, ↵Matthias Krüger-0/+76
r=eholk Suggest remove last method call when type coerce with expected type Fixes #105494
2022-12-22Deduplicate check_expr in builtin calls with errorMichael Goulet-0/+52
2022-12-22fix #105494, Suggest remove last method call when type coerce with expectedyukang-0/+76
2022-12-22Suggest associated const on capitalization errorMichael Goulet-0/+72
2022-12-18Don't ICE in closure arg borrow suggestionMichael Goulet-0/+32
2022-12-16Auto merge of #104334 - compiler-errors:ufcs-sugg-wrong-def-id, r=estebankbors-0/+58
Use impl's def id when calculating type to specify in UFCS Fixes #104327 Fixes #104328 Also addresses https://github.com/rust-lang/rust/pull/102670#discussion_r987381197
2022-12-15Rollup merge of #105679 - estebank:suggest-clone, r=compiler-errorsMatthias Krüger-0/+74
Suggest constraining type parameter with `Clone` Fix #34896.
2022-12-15Trim paths in E0599Esteban Küber-2/+2
2022-12-15Suggest `#[derive(Clone)]`Esteban Küber-1/+34
2022-12-15Suggest constraining type parameter with `Clone`Esteban Küber-0/+41
Fix #34896.
2022-12-14Use impl's def id when calculating type to specify UFCSMichael Goulet-0/+58
2022-12-13Rollup merge of #105500 - oli-obk:unhide_unknown_spans, r=estebankMatthias Krüger-156/+26
Make some diagnostics not depend on the source of what they reference being available r? `@estebank` follow up to https://github.com/rust-lang/rust/pull/104449
2022-12-13Account for dereference expressionsEsteban Küber-44/+55
2022-12-13Fix span for `&mut ` removal suggestionEsteban Küber-26/+26
2022-12-13Suggest `ref` for some patterns as a fallbackEsteban Küber-23/+99
2022-12-13Do not suggest borrowing binding in pattern in let elseEsteban Küber-8/+5
Fix #104838.
2022-12-13Change pattern borrowing suggestions to be verboseEsteban Küber-505/+815
Synthesize a more accurate span and use verbose suggestion output to make the message clearer.