about summary refs log tree commit diff
path: root/src/test/ui/suggestions
AgeCommit message (Collapse)AuthorLines
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-1/+1
2019-06-30Feature gate `rustc` attributes harderVadim Petrochenkov-2/+14
2019-06-30Make sure `#[rustc_doc_only_macro]` and other rustc attributes are registeredVadim Petrochenkov-15/+10
2019-06-04Remove asterisk suggestion for move errors in borrowckKenny Goodin-22/+22
As per issue #54985 removes the not useful suggestion to remove asterisk in move errors. Includes minor changes to tests in the `ui` suite to account for the removed suggestion.
2019-06-03Update tests for changes to cannot move errorsMatthew Jasper-831/+365
2019-05-29Auto merge of #61203 - memoryruins:bare_trait_objects, r=Centrilbors-10/+10
Warn on bare_trait_objects by default The `bare_trait_objects` lint is set to `warn` by default. Most ui tests have been updated to use `dyn` to avoid creating noise in stderr files. r? @Centril cc #54910
2019-05-29Rollup merge of #61217 - estebank:issue-52820, r=CentrilOliver Scherer-0/+39
Account for short-hand init structs when suggesting conversion Fix #52820.
2019-05-29Update ui test suite to use dynmemoryruins-10/+10
2019-05-27Auto merge of #61147 - estebank:suggest-as-ref, r=oli-obkbors-0/+99
When encountering move error on an `Option`, suggest using `as_ref` Fix #61109, cc #15457.
2019-05-26Account for short-hand init structs when suggesting conversionEsteban Küber-0/+39
2019-05-25Add support for suggesting as_ref to Result accessesEsteban Küber-1/+46
2019-05-24When encountering move error on an `Option`, suggest using `as_ref`Esteban Küber-0/+54
2019-05-24Suggest borrowing for loop head on move errorEsteban Küber-5/+4
2019-05-23Add regression test for negative caseEsteban Küber-4/+47
2019-05-22Suggest dereferencing on assignment to mutable borrowEsteban Küber-0/+21
2019-05-18Auto merge of #60252 - davidtwco:issue-57672, r=Mark-Simulacrumbors-0/+14
Don't suggest changing extern crate w/ alias to use. Fixes #57672.
2019-05-12Remove feature(nll) when compare mode is sufficientMatthew Jasper-208/+200
2019-05-12Change compare mode to use -Zborrowck=mirMatthew Jasper-0/+11
2019-05-03Rollup merge of #60393 - estebank:pat-sugg, r=oli-obkMazdak Farrokhzad-0/+93
Do not suggest incorrect syntax on pattern type error due to borrow Fix #55174.
2019-04-30review comments: change wordingEsteban Küber-5/+4
2019-04-29Add if let testEsteban Küber-1/+14
2019-04-29review commentsEsteban Küber-1/+1
2019-04-29add testsEsteban Küber-0/+81
2019-04-29Suggest try_into when possibleEsteban Küber-63/+45
2019-04-25Do not suggest use over extern crate w/ alias.David Wood-15/+1
This commit stops `unused_extern_crates` lints from occuring on `extern crate` statements that alias the crate as the suggestion to change to a `use` statement would result in the aliased name no longer being added to the prelude, thereby causing compilation errors if other imports expected this to be the case.
2019-04-25Add test for current behaviour.David Wood-0/+28
This commit adds a test that causes a suggestion to replace `extern crate` with `use` when doing so would cause a compliation error, as the new name of the import would not be added to the prelude if a `use` was used.
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