about summary refs log tree commit diff
path: root/tests/ui/resolve
AgeCommit message (Collapse)AuthorLines
2023-08-02Resolve visibility paths as modules not as types.Camille GILLOT-0/+20
2023-07-29fix(resolve): update the ambiguity glob binding as warning recursivelybohan-4/+20
2023-07-20Auto merge of #113622 - RickleAndMortimer:issue-113184-fix, r=oli-obkbors-0/+1
add links to query documentation for E0391 This PR adds links to https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for the rustc --explain E0391 and within the compiler error itself. Fixes: #113184
2023-07-18moved note as unspanned note, moved note to the bottom of the msgnxya-5/+1
2023-07-18added links as a notenxya-1/+1
2023-07-18add links to query documentation for E0391nxya-1/+1
2023-07-18added links as a notenxya-1/+6
2023-07-18add links to query documentation for E0391nxya-1/+1
2023-07-18Fix removal span calculation of unused_qualifications suggestion许杰友 Jieyou Xu (Joe)-6/+101
2023-07-15Check entry type as part of item type checking.Camille GILLOT-12/+12
2023-07-13Add machine-applicable suggestion for `unused_qualifications` lint许杰友 Jieyou Xu (Joe)-0/+75
2023-07-10Rollup merge of #113331 - chenyukang:yukang-fix-112590-false-positive, ↵Matthias Krüger-10/+131
r=estebank Add filter with following segment while lookup typo for path From the discussion: https://github.com/rust-lang/rust/pull/112917#discussion_r1239150173 Seems we can not get the assoc items for `Struct`, `Enum` in the resolving phase. A obvious filter is avoid suggesting the same name with the following segment path. Use `following_seg` can extend the function `smart_resolve_partial_mod_path_errors` for more scenarios, such as `std::sync_error::atomic::AtomicBool` in test case. r? `@estebank`
2023-07-08Remove `default_free_fn` featureYuki Okushi-15/+6
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-07-07smart_resolve_partial_mod_path_errors should not suggest parentyukang-10/+0
2023-07-07Add filter with next segment while lookup typo for pathyukang-0/+131
2023-07-04Auto merge of #112917 - chenyukang:yukang-fix-112590, r=estebankbors-1/+35
Suggest importing for partial mod path matching in name resolving Fixes #112590
2023-07-03Don't perform selection if IATs are not enabledLeón Orell Valerian Liehr-15/+15
2023-07-02add testcase for 112590yukang-1/+30
2023-06-22Tweak privacy errors to account for reachable itemsEsteban Küber-2/+6
Suggest publicly accessible paths for items in private mod: When encountering a path in non-import situations that are not reachable due to privacy constraints, search for any public re-exports that the user could use instead. Track whether an import suggestion is offering a re-export. When encountering a path with private segments, mention if the item at the final path segment is not publicly accessible at all. Add item visibility metadata to privacy errors from imports: On unreachable imports, record the item that was being imported in order to suggest publicly available re-exports or to be explicit that the item is not available publicly from any path. In order to allow this, we add a mode to `resolve_path` that will not add new privacy errors, nor return early if it encounters one. This way we can get the `Res` corresponding to the final item in the import, which is used in the privacy error machinery.
2023-06-22suggest importing for partial mod path in name resolvingyukang-0/+5
2023-06-20test(resolve): update_resolution for remove single importbohan-0/+33
2023-06-15Fix suggestion for E0404 not dealing with multiple generics许杰友 Jieyou Xu (Joe)-0/+87
2023-06-14Rollup merge of #112495 - bvanjoi:fix-109153, r=petrochenkovMatthias Krüger-1/+40
fix(resolve): update shadowed_glob more precision - Fixes #109153 - Fixes #109962 ## Why does it panic? We use #109153 as an illustration. The process of `resolve_imports` is: | Iter | resolve | resolution of **`(Mod(root), Ident(bar) in type ns)`** | | - | - | - | | 0 | `use foo::*` | `binding` -> foo::bar, `shallowed_glob` -> `None` | | 1 | `use bar::bar` | `binding` -> foo::bar::bar, `shallowed_glob` -> foo::bar | | 2 | `use bar::*` | `binding` -> foo::bar::bar, `shallowed_glob` -> foo::bar::bar::bar | So during `finalize_import`, the `root::bar` in `use bar::bar` had been pointed to `foo::bar::bar::bar`, which is different from the `initial_module` valued of `foo::bar`, therefore, the panic had been triggered. ## Try to solve it ~I think #109153 should check-pass rather than throw an ambiguous error. Following this idea, there are two ways to solve this problem:~ ~1. Give up the `initial_module` and update `import.imported_module` after each resolution update. However, I think this method may have too much impact.~ ~2. Do not update the `shadowed_glob` when it is defined.~ ~To be honest, I am not sure if this is the right way to solve this ICE. Perhaps there is a better resolution.~ Edit: we had made the `resolution.shadowed_glob` update more detailed. r? `@petrochenkov`
2023-06-14fix(resolve): update `shadowed_glob` more precisionbohan-1/+40
2023-06-12Adjust UI tests for `unit_bindings`许杰友 Jieyou Xu (Joe)-2/+2
- Either explicitly annotate `let x: () = expr;` where `x` has unit type, or remove the unit binding to leave only `expr;` instead. - Fix disjoint-capture-in-same-closure test
2023-06-10Adjust span labels for `HIDDEN_GLOB_REEXPORTS`许杰友 Jieyou Xu (Joe)-13/+36
2023-05-27Add warn-by-default lint for local binding shadowing exported glob re-export ↵许杰友 Jieyou Xu (Joe)-0/+83
item
2023-05-19Keep only the trait when emitting the error for `MyTrait + 'a`Mu001999-0/+14
2023-05-17Rollup merge of #111588 - MU001999:diag/improve-e0782, r=fee1-deadDylan DPC-0/+26
Emits E0599 when meeting `MyTrait::missing_method` Fixes #111312
2023-05-17Emits E0599 when meeting MyTrait::missing_methodmu001999-0/+26
2023-05-16Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obkNilstrieb-7/+0
Suppress "erroneous constant used" for constants tainted by errors When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not. Fixes #110891.
2023-05-16Rollup merge of #111428 - bvanjoi:fix-109250, r=NilstriebNilstrieb-0/+31
refactor(resolve): clean up the early error return caused by non-call closes https://github.com/rust-lang/rust/issues/109250 It seems no bad happened, r? ``@Nilstrieb``
2023-05-15Suppress "erroneous constant used" for constants tainted by errorsTomasz Miąsko-7/+0
When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not.
2023-05-11Improve error for `self: Box<self>`clubby789-0/+16
2023-05-10refactor(resolve): clean up the early error return caused by non-callbohan-0/+31
2023-05-08Move testsCaio-0/+38
2023-04-12Special-case item attributes in the suggestion outputEsteban Küber-63/+0
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-63/+126
2023-04-04Deny `use`ing tool pathsclubby789-0/+17
2023-04-02Move some UI tests into subdirectoriesjyn-0/+34
to avoid going over the existing limit now that the ui-fulldeps tests have been moved to ui.
2023-03-20Lint ambiguous glob re-exports许杰友 Jieyou Xu (Joe)-0/+80
2023-03-01Rollup merge of #108297 - chenyukang:yukang/delim-error-exit, r=petrochenkovMatthias Krüger-67/+19
Exit when there are unmatched delims to avoid noisy diagnostics From https://github.com/rust-lang/rust/pull/104012#issuecomment-1311764832 r? ``@petrochenkov``
2023-02-28Exit when there are unmatched delims to avoid noisy diagnosticsyukang-67/+19
2023-02-27diagnostics: avoid querying `associated_item` in the resolverMichael Howell-0/+17
Fixes #108529
2023-02-14Make removal suggestion not verboseEsteban Küber-6/+4
2023-02-14rebase and review commentsEsteban Küber-1/+1
2023-02-14More accurate spans for arg removal suggestionEsteban Küber-2/+3
2023-01-30Modify primary span label for E0308Esteban Küber-5/+5
The previous output was unintuitive to users.
2023-01-13Rollup merge of #106585 - estebank:issue-46585, r=compiler-errorsMatthias Krüger-1/+6
When suggesting writing a fully qualified path probe for appropriate types Address the more common part of #46585.
2023-01-13Auto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obkbors-0/+2
Const closures cc https://github.com/rust-lang/rust/issues/106003