about summary refs log tree commit diff
path: root/src/test/ui/suggestions
AgeCommit message (Collapse)AuthorLines
2019-04-25Rollup merge of #59697 - euclio:label-fixes, r=zackmdavisMazdak Farrokhzad-3/+15
tweak unresolved label suggestion Only suggest label names in the same hygiene context, and use a structured suggestion. Question for reviewer: Is this the right way to check for label hygiene?
2019-04-23Auto merge of #60155 - davidtwco:issue-59819, r=oli-obkbors-0/+109
Suggest dereferencing when `Deref` is implemented. Fixes #59819. r? @oli-obk cc @estebank
2019-04-22Only make suggestion when type is `Copy`.David Wood-5/+43
This commit makes the suggestion to dereference when a type implements `Deref` only apply if the dereference would succeed (ie. the type is `Copy`, otherwise a borrow check error would occur).
2019-04-22update tests for migrate mode by defaultMatthew Jasper-29/+5
2019-04-21Suggest dereferencing when `Deref` is implemented.David Wood-3/+30
This commit suggests dereferencing a type when it implements `Deref` with the correct `Output` associated type.
2019-04-21Add existing behaviour test for deref suggestions.David Wood-0/+44
This commit adds a test that demonstrates the current behaviour where suggestions to add a dereference aren't given for non-references.
2019-04-18Suggest appropriate path when calling associated item on bare typesEsteban Küber-0/+31
When looking at the documentation for `std::f32` or `std::str`, for example, it is easy to get confused and assume `std::f32` and `f32` are the same thing. Because of this, it is not uncommon to attempt writing `f32::consts::PI` instead of the correct `std::f32::consts::PI`. When encountering the former, which results in an access error due to it being an inexistent path, try to access the same path under `std`. If this succeeds, this information is stored for later tweaking of the final E0599 to provide an appropriate suggestion. This suggestion applies to both E0233 and E0599 and is only checked when the first ident of a path corresponds to a primitive type.
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-6/+5
2019-04-12Rollup merge of #59862 - estebank:tweak-unstable-diag, r=petrochenkovMazdak Farrokhzad-3/+6
Tweak unstable diagnostic output
2019-04-11Reword tracking issue noteEsteban Küber-3/+3
2019-04-10Tweak unstable diagnostic outputEsteban Küber-3/+6
2019-04-09improve unknown enum variant errorsAndy Russell-13/+61
2019-04-04tweak unresolved label suggestionAndy Russell-3/+15
Only suggest label names in the same hygiene context, and use a structured suggestion.
2019-03-31Only mention const generics if enabled.David Wood-4/+4
This commit updates the generic parameter re-ordering diagnostic to only mention const generics if the feature is enabled.
2019-03-29Rollup merge of #59473 - estebank:borrow-sugg-inside-macro, r=davidtwcoMazdak Farrokhzad-0/+32
Do not emit incorrect borrow suggestion involving macros and fix overlapping multiline spans Fix #58298.
2019-03-28Rollup merge of #59429 - estebank:for-loop-move-nll, r=petrochenkovMazdak Farrokhzad-4/+5
When moving out of a for loop head, suggest borrowing it in nll mode Follow up to #59195 for NLL.
2019-03-27Account for fully overlapping multiline annotationsEsteban Küber-12/+9
When two multiline span labels point at the same span, we special case the output to avoid weird behavior: ``` foo( _____^ |_____| || bar, || ); || ^ ||______| |______foo baz ``` instead showing ``` foo( _____^ | bar, | ); | ^ | | |______foo baz ```
2019-03-27Add testEsteban Küber-0/+35
2019-03-27Rollup merge of #59268 - estebank:from-string, r=QuietMisdreavusJosh Stone-0/+23
Add suggestion to use `&*var` when `&str: From<String>` is expected Fix #53879.
2019-03-26Rollup merge of #59267 - estebank:assoc-const-as-field, r=davidtwcoMazdak Farrokhzad-0/+24
Provide suggestion when using field access instead of path When trying to access an associated constant as if it were a field of an instance, provide a suggestion for the correct syntax. Fix #57316.
2019-03-26Rollup merge of #59150 - estebank:type-ascription, r=varkorMazdak Farrokhzad-0/+79
Expand suggestions for type ascription parse errors Fix #51222. CC #48016, #47666, #54516, #34255.
2019-03-25When moving out of a for loop head, suggest borrowing it in nll modeEsteban Küber-4/+5
2019-03-25Auto merge of #59258 - euclio:suggestions-filter-crate, r=oli-obkbors-0/+23
filter suggestions from extern prelude Fixes #59027. Modifies the candidate gathering code to call `filter_fn` on extern crates, which causes them to be filtered out when looking for a type.
2019-03-24Deduplicate code for path suggestionEsteban Küber-1/+1
2019-03-24Provide suggestion when using field access instead of pathEsteban Küber-0/+24
When trying to access an associated constant as if it were a field of an instance, provide a suggestion for the correct syntax.
2019-03-24Add nll testEsteban Küber-0/+24
2019-03-24When moving out of a for loop head, suggest borrowing itEsteban Küber-0/+34
When encountering code like the following, suggest borrowing the for loop head to avoid moving it into the for loop pattern: ``` fn main() { let a = vec![1, 2, 3]; for i in &a { for j in a { println!("{} * {} = {}", i, j, i * j); } } } ```
2019-03-22review commentsEsteban Küber-1/+1
2019-03-22Add suggestion to use `&*var` when `&str: From<String>` is expectedEsteban Küber-0/+23
2019-03-22Hide "type ascription is experimental error" unless it's the only oneEsteban Küber-24/+5
In order to minimize the verbosity of common syntax errors that are parsed as type ascription, hide the feature gate error unless there are no other errors being emitted by the parser.
2019-03-22Only suggest let assignment for type ascription if we find an equals signEsteban Küber-9/+3
2019-03-22Tweak labelsEsteban Küber-5/+1
2019-03-22Expand suggestions for type ascription parse errorsEsteban Küber-0/+108
2019-03-22Auto merge of #59035 - estebank:closure-instacall, r=davidtwcobors-0/+19
When encountering `||{}()`, suggest the likely intended `(||{})()` Fix #55851.
2019-03-18filter suggestions from extern preludeAndy Russell-0/+23
2019-03-12Suggest adding lifetime to struct fieldEsteban Küber-3/+11
2019-03-12review commentsEsteban Küber-2/+2
2019-03-12Suggest return lifetime when there's only one named lifetimeEsteban Küber-0/+27
2019-03-11Update testsVadim Petrochenkov-48/+48
2019-03-08When encountetring `||{}()`, suggest the likely intended `(||{})()`Esteban Küber-0/+19
2019-03-08Rollup merge of #58883 - estebank:unused-closure-arg, r=varkorPietro Albini-0/+40
Suggest appropriate code for unused field when destructuring pattern Fix #56472.
2019-03-08Rollup merge of #58877 - estebank:macro-borrow, r=davidtwcoPietro Albini-0/+33
Suggest removal of `&` when borrowing macro and appropriate Fix #58815.
2019-03-04On return type `impl Trait` for block with no expr point at last semiEsteban Küber-0/+20
2019-03-02Suggest appropriate code for unused field when desrtucturing pattternEsteban Küber-0/+40
Fix #56472.
2019-03-02Suggest removal of `&` when borrowing macro and appropriateEsteban Küber-0/+33
Fix #58815.
2019-02-13suggestion-diagnostics: as_ref improve snippetDan Robertson-8/+8
Improve the code snippet suggested in suggestion-diagnostics when suggesting the use of as_ref.
2019-02-07Update testsvarkor-114/+97
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-01-27add typo suggestion to unknown attribute errorAndy Russell-0/+40
2019-01-25Combining move lifetime and type suggestions.David Wood-5/+106
This commit combines the move lifetime and move type suggestions so that when rustfix applies them they don't conflict with each other.
2019-01-25Suggestion moving types before associated types.David Wood-0/+91
This commit extends existing suggestions to move lifetimes before types in generic arguments to also suggest moving types behind associated type bindings.