about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
AgeCommit message (Collapse)AuthorLines
2022-10-14Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8KiDylan DPC-1/+1
More dupe word typos I only picked those changes (from the regex search) that I am pretty certain doesn't change meaning and is just a typo fix. Do correct me if any fix is undesirable and I can revert those. Thanks.
2022-10-14more dupe word typosRageking8-1/+1
2022-10-13Rollup merge of #102956 - TaKO8Ki:fix-102946, r=fee1-deadDylan DPC-1/+1
Use `full_res` instead of `expect_full_res` Fixes #102946 Fixes #102978
2022-10-13resolve: Regroup lifetime rib kinds to account for their purposeVadim Petrochenkov-16/+23
2022-10-13resolve: Remove redundant item lifetime ribsVadim Petrochenkov-37/+28
and cleanup lifetime rib walking loops
2022-10-13resolve: Add some asserts for unexpected lifetime rib combinationsVadim Petrochenkov-12/+26
2022-10-12fix #102946Takayuki Maeda-1/+1
2022-10-12Rollup merge of #102913 - SparrowLii:import-candidate, r=compiler-errorsDylan DPC-35/+33
unify `IsPattern` and `IsImport` enum in `show_candidates` Follow-up of #102876 A binding cannot appear in both pattern and import at the same time, so it makes sense to unify them r? `@compiler-errors`
2022-10-12unify `IsPattern` and `IsImport` enumSparrowLii-35/+33
2022-10-11Rollup merge of #102889 - petrochenkov:partres, r=cjgillotMatthias Krüger-53/+38
rustc_hir: Less error-prone methods for accessing `PartialRes` resolution
2022-10-11Rollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkovMatthias Krüger-3/+45
Check uniqueness of impl items by trait item when applicable. When checking uniqueness of item names in impl blocks, we currently use the same definition of hygiene as for toplevel items. This means that a plain item and one generated by a macro 2.0 do not collide. This hygiene rule does not match with how impl items resolve to associated trait items. As a consequence, we misdiagnose the trait impls. This PR proposes to consider that trait impl items are uses of the corresponding trait items during resolution, instead of checking for duplicates later. An error is emitted when a trait impl item is used twice. There should be no stable breakage, since macros 2.0 are still unstable. r? ``@petrochenkov`` cc ``@RalfJung`` Fixes https://github.com/rust-lang/rust/issues/71614.
2022-10-11Rollup merge of #102859 - cjgillot:collect-lifetimes, r=oli-obkYuki Okushi-1905/+0
Move lifetime resolution module to rustc_hir_analysis. Now that lifetime resolution has been removed from it, this file has nothing to do in `rustc_resolve`. It's purpose is to compute Debruijn indices for lifetimes, so let's put it in type collection.
2022-10-11Report duplicate definitions in trait impls during resolution.Camille GILLOT-3/+45
2022-10-11rustc_hir: Less error-prone methods for accessing `PartialRes` resolutionVadim Petrochenkov-53/+38
2022-10-10Rollup merge of #102876 - SparrowLii:import-candidate, r=fee1-deadMatthias Krüger-4/+62
suggest candidates for unresolved import Currently we prompt suggestion of candidates(help notes of `use xxx::yyy`) for names which cannot be resolved, but we don't do that for import statements themselves that couldn't be resolved. It seems reasonable to add candidate help information for these statements as well. Fixes #102711
2022-10-10Move lifetime resolution module to rustc_hir_analysis.Camille GILLOT-1905/+0
2022-10-10Rollup merge of #102868 - compiler-errors:rename-assoc-tyalias-to-ty, r=TaKO8KiDylan DPC-9/+9
Rename `AssocItemKind::TyAlias` to `AssocItemKind::Type` Thanks `@camsteffen` for catching this in ast too, cc https://github.com/rust-lang/rust/pull/102829#issuecomment-1272649247
2022-10-10suggest candidates for unresolved importSparrowLii-4/+62
2022-10-10Rename AssocItemKind::TyAlias to AssocItemKind::TypeMichael Goulet-9/+9
2022-10-10Rollup merge of #102323 - Stoozy:master, r=cjgillotYuki Okushi-2/+31
Trying to suggest additional lifetime parameter ``@cjgillot`` This is what I have so far for #100615
2022-10-10Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8KiYuki Okushi-1/+1
rename `ImplItemKind::TyAlias` to `ImplItemKind::Type` The naming of this variant seems inconsistent given that this is not really a "type alias", and the associated type variant for `TraitItemKind` is just called `Type`.
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-1/+1
2022-10-05Delay function resolution error until typeckMichael Goulet-2/+12
2022-10-01Removed unnecessary for loopstoozy-16/+9
2022-09-30Rollup merge of #102483 - spastorino:create-defs-on-lowering, r=cjgillotMatthias Krüger-15/+0
create def ids for impl traits during ast lowering r? `@cjgillot`
2022-09-30create def ids for impl traits during ast loweringSantiago Pastorino-15/+0
2022-09-29Auto merge of #101887 - nnethercote:shrink-Res, r=spastorinobors-47/+54
Shrink `hir::def::Res` r? `@spastorino`
2022-09-29Emitting error regardless of new param suggestionstoozy-33/+33
2022-09-29Rollup merge of #102085 - chenyukang:code-refactor, r=cjgillotYuki Okushi-247/+366
Code refactoring smart_resolve_report_errors `smart_resolve_report_errors` https://github.com/rust-lang/rust/blob/4ecfdfac51b159f68fce608792affb34a70e6f73/compiler/rustc_resolve/src/late/diagnostics.rs#L143 is almost 600 lines of code, we should do some code refactoring.
2022-09-29Shrink `hir::def::Res`.Nicholas Nethercote-46/+53
`Res::SelfTy` currently has two `Option`s. When the second one is `Some` the first one is never consulted. So we can split it into two variants, `Res::SelfTyParam` and `Res::SelfTyAlias`, reducing the size of `Res` from 24 bytes to 12. This then shrinks `hir::Path` and `hir::PathSegment`, which are the HIR types that take up the most space.
2022-09-29Change the "dummy self type".Nicholas Nethercote-2/+2
Because this is the only occurrence of a `Res::SelfTy` with `None` and `None` fields, and the next commit will rely on those not being present.
2022-09-28Proper span for new generic param suggestionstoozy-2/+7
2022-09-27Do not overwrite binders for another HirId.Camille GILLOT-20/+35
2022-09-27Properly formatting the multipart suggestionstoozy-1/+1
2022-09-27rustc_typeck to rustc_hir_analysislcnr-2/+2
2022-09-26Using multipart suggestionstoozy-12/+19
2022-09-26Trying to suggest additional lifetime parameterstoozy-8/+32
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-25Only generate closure def id for async fns with bodyMichael Goulet-3/+7
2022-09-26trivial fix on fallbackyukang-3/+1
2022-09-26more code refactor on smart_resolve_report_errorsyukang-175/+207
2022-09-25Rollup merge of #102161 - compiler-errors:issue-102138, r=tmandryMatthias Krüger-36/+37
Resolve async fn signature even without body (e.g., in trait) Fixes #102138 This "bail if no body" behavior was introduced in #69539 to fix #69401, but that ICE does not reproduce any more. The error message changes a bit, but that's all, and I don't think it's a particularly diagnostic bad regression.
2022-09-24Auto merge of #102040 - TaKO8Ki:separate-definitions-and-hir-owners, r=cjgillotbors-16/+16
Separate definitions and HIR owners in the type system Fixes #83158 r? `@cjgillot`
2022-09-24Only record extra lifetime params for async trait fn with no bodyMichael Goulet-38/+40
2022-09-24Resolve async fn signature even without body (in trait)Michael Goulet-3/+2
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-16/+16
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-24Rollup merge of #102109 - petrochenkov:addids, r=oli-obkMatthias Krüger-10/+30
resolve: Set effective visibilities for imports more precisely Instead of setting them for all primary and additional IDs of the import, only set them for the binding's true ID.
2022-09-22resolve: Set effective visibilities for imports more preciselyVadim Petrochenkov-10/+30
Instead of setting them for all primary and additional IDs of the import, only set them for the binding's true ID.
2022-09-22Fix a typo in error messageFrank Steffahn-1/+1
2022-09-21add trivial commentsyukang-2/+3