about summary refs log tree commit diff
path: root/src/test/ui/resolve
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-7170/+0
2023-01-05Tweak wording of fn call with wrong number of argsEsteban Küber-1/+1
2022-12-23Move testsCaio-0/+93
2022-12-14Tweak output for bare `dyn Trait` in argumentsEsteban Küber-0/+4
Fix #35825.
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-2/+2
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-13review commentsEsteban Küber-3/+3
2022-12-13Suggest `: Type` instead of `: _`Esteban Küber-3/+3
2022-12-13Suggest `collect`ing into `Vec<_>`Esteban Küber-1/+1
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-7/+2
available
2022-12-13Rollup merge of #104864 - chenyukang:yukang/fix-104700-binding, r=estebankMatthias Krüger-0/+32
Account for item-local in inner scope for E0425 Fixes #104700
2022-12-04Rollup merge of #101975 - chenyukang:fix-101749, r=compiler-errorsMatthias Krüger-45/+122
Suggest to use . instead of :: when accessing a method of an object Fixes #101749 Fixes #101542
2022-12-03fix #101749, use . instead of :: when accessing a method of an objectyukang-45/+122
2022-12-03fix #105069, Add AmbiguityError for inconsistent resolution for an importyukang-0/+32
2022-11-25fix #104700, account for item-local in inner scope for E0425yukang-0/+32
2022-11-22Auto merge of #103578 - petrochenkov:nofict, r=nagisabors-97/+44
Unreserve braced enum variants in value namespace With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed. Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900.
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-97/+44
2022-11-20Move testsCaio-0/+34
2022-11-17Move a ui test to make space for new folderDeadbeef-0/+13
2022-11-16cleanup and dedupe CTFE and Miri error reportingRalf Jung-6/+5
2022-11-12Move testsCaio-0/+140
2022-11-11Rollup merge of #103531 - chenyukang:yukang/fix-103474, r=estebankManish Goregaokar-2/+65
Suggest calling the instance method of the same name when method not found Fixes #103474
2022-11-03Correctly resolve Inherent Associated TypesDeadbeef-15/+15
2022-11-01Rollup merge of #103706 - zbyrn:issue-101637-fix, r=estebankDylan DPC-3/+99
Fix E0433 No Typo Suggestions Fixes #48676 Fixes #87791 Fixes #96625 Fixes #95462 Fixes #101637 Follows up PR #72923 Several open issues refer to the problem that E0433 does not suggest typos like other errors normally do. This fix augments the implementation of PR #72923. **Background** When the path of a function call, e.g. `Struct::foo()`, involves names that cannot be resolved, there are two errors that could be emitted by the compiler: - If `Struct` is not found, it is ``E0433: failed to resolve: use of undeclared type `Struct` ``. - If `foo` is not found in `Struct`, it is ``E0599: no function or associated item named `foo` found for struct `Struct` in the current scope`` When a name is used as a type, `e.g. fn foo() -> Struct`, and the name cannot be resolved, it is ``E0412: cannot find type `Struct` in this scope``. Before #72923, `E0433` does not implement any suggestions, and the PR introduces suggestions for missing `use`s. When a resolution error occurs in the path of a function call, it tries to smart resolve just the type part of the path, e.g. `module::Struct` of a call to `module::Struct::foo()`. However, along with the suggestions, the smart-resolve function will report `E0412` since it only knows that it is a type that we cannot resolve instead of being a part of the path. So, the original implementation swap out `E0412` errors returned by the smart-resolve function with the real `E0433` error, but keeps the "missing `use`" suggestions to be reported to the programmer. **Issue** The current implementation only reports if there are "missing `use`" suggestions returned by the smart-resolve function; otherwise, it would fall back the normal reporting, which does not emit suggestions. But the smart-resolve function could also produce typo suggestions, which are omitted currently. Also, it seems like that not all info has been swapped out when there are missing suggestions. The error message underlining the name in the snippet still says ``not found in this scope``, which is a `E0412` messages, if there are `use` suggestions, but says the normal `use of undeclared type` otherwise. **Fixes** This fix swaps out all fields in `Diagnostic` returned by the smart-resolve function except for `suggestions` with the current error, and merges the `suggestions` of the returned error and that of the current error together. If there are `use` suggestions, the error is saved to `use_injection` to be reported at the end; otherwise, the error is emitted immediately as `Resolver::report_error` does. Some tests are updated to use the correct underlining error messages, and one additional test for typo suggestion is added to the test suite. r? rust-lang/diagnostics
2022-10-30Rollup merge of #103560 - zbyrn:issue-103358-fix, r=cjgillotDylan DPC-9/+7
Point only to the identifiers in the typo suggestions of shadowed names instead of the entire struct Fixes #103358. As discussed in the issue, the `Span` of the candidate `Ident` for a typo replacement is stored alongside its `Symbol` in `TypoSuggestion`. Then, the span of the identifier is what the "you might have meant to refer to" note is pointed at, rather than the entire struct definition. Comments in #103111 and the issue both suggest that it is desirable to: 1. include names defined in the same crate as the typo, 2. ignore names defined elsewhere such as in `std`, _and_ 3. include names introduced indirectly via `use`. Since a name from another crate but introduced via `use` has non-local `def_id`, to achieve this, a suggestion is displayed if either the `def_id` of the suggested name is local, or the `span` of the suggested name is in the same file as the typo itself. Some UI tests have also been modified to reflect this change. r? `@cjgillot`
2022-10-27use proper spansBoxy-20/+39
2022-10-27DoItBoxy-82/+16
2022-10-27Add a test for issue #101637Byron Zhong-0/+96
2022-10-27Correct inconsistent error messages in testsByron Zhong-3/+3
2022-10-25Modify ui tests to reflect the changeByron Zhong-9/+7
2022-10-26add testcase for suggest selfyukang-1/+28
2022-10-26suggest calling the method of the same name when method not foundyukang-2/+38
2022-10-25Rollup merge of #103350 - clubby789:refer-to-assoc-method, r=wesleywiserYuki Okushi-9/+44
Change terminology for assoc method suggestions when they are not called Fixes #103325 ```@rustbot``` label +A-diagnostics
2022-10-21Update UI testsclubby789-9/+44
2022-10-21Rollup merge of #103111 - cjgillot:shadow-label, r=estebankDylan DPC-4/+9
Account for hygiene in typo suggestions, and use them to point to shadowed names Fixes https://github.com/rust-lang/rust/issues/97459 r? `@estebank`
2022-10-20Rollup merge of #103221 - TaKO8Ki:fix-103202, r=oli-obkMatthias Krüger-0/+16
Fix `SelfVisitor::is_self_ty` ICE Fixes #103202
2022-10-19instantiate -> constructMichael Goulet-3/+3
2022-10-19fix `SelfVisitor::is_self_ty` ICETakayuki Maeda-0/+16
2022-10-16Point to shadowed name when it exists.Camille GILLOT-4/+9
2022-10-12fix #102946Takayuki Maeda-0/+33
2022-10-05Delay function resolution error until typeckMichael Goulet-202/+202
2022-09-24Add testMichael Goulet-0/+11
2022-09-24Only record extra lifetime params for async trait fn with no bodyMichael Goulet-4/+4
2022-09-24Resolve async fn signature even without body (in trait)Michael Goulet-4/+4
2022-09-23Rollup merge of #100734 - ComputerDruid:afit_feature, r=compiler-errorsMatthias Krüger-2/+2
Split out async_fn_in_trait into a separate feature PR #101224 added support for async fn in trait desuraging behind the `return_position_impl_trait_in_trait` feature. Split this out so that it's behind its own feature gate, since async fn in trait doesn't need to follow the same stabilization schedule.
2022-09-21Split out async_fn_in_trait into a separate featureDan Johnson-2/+2
PR #101224 added support for async fn in trait desuraging behind the return_position_impl_trait_in_trait feature. Split this out so that it's behind its own feature gate, since async fn in trait doesn't need to follow the same stabilization schedule.
2022-09-22Bless test output changesFrank Steffahn-1/+1
2022-09-09Bless tests, fix ICE with ImplTraitPlaceholderMichael Goulet-30/+14
2022-09-03Shrink suggestion span of argument mismatch errorMichael Goulet-1/+1
2022-08-31Rollup merge of #101161 - ldm0:ldm_fix_diagnostic, r=cjgillotMatthias Krüger-15/+45
Fix uintended diagnostic caused by `drain(..)` Calling `drain(..)` makes later `suggestable_variants.is_empty()` always true, which makes the diagnostics unintended.
2022-08-31Fix uintended diagnostic caused by `drain(..)`Donough Liu-15/+45