about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
AgeCommit message (Collapse)AuthorLines
2022-10-20fix rust-lang#101880: suggest let for assignment, and some code refactoryukang-53/+51
2022-10-20Auto merge of #103185 - chenyukang:yukang/fix-span-next-point, r=davidtwcobors-1/+1
Fix the bug of next_point in source_map There is a bug in `next_point`, the new span won't move to next position when be called in the first time. For this reason, our current code is working like this: 1. When we really want to move to the next position, we called two times of `next_point` 2. Some code which use `next_point` actually done the same thing with `shrink_to_hi` This fix make sure when `next_point` is called, span will move with the width at least 1, and also work correctly in the scenario of multiple bytes. Ref: https://github.com/rust-lang/rust/pull/103140#discussion_r997710998 r? `@davidtwco`
2022-10-20check if impl_self is `Some`Takayuki Maeda-1/+1
2022-10-20fix span for suggestionyukang-13/+7
2022-10-20fix #103112, add diagnostic for calling a function with the same name when a ↵yukang-2/+20
Macro is not found
2022-10-19resolve: Revert "Set effective visibilities for imports more precisely"Vadim Petrochenkov-35/+18
2022-10-19Rollup merge of #103216 - cjgillot:issue-103210, r=jackh726Dylan DPC-6/+11
Consider patterns in fn params in an `Elided(Infer)` lifetime rib. Fixes https://github.com/rust-lang/rust/issues/103210
2022-10-19fix `SelfVisitor::is_self_ty` ICETakayuki Maeda-3/+3
2022-10-18Consider patterns in fn params in an `Elided(Infer)` lifetime rib.Camille GILLOT-6/+11
2022-10-18Fix the bug of next_point in spanyukang-1/+1
2022-10-17Auto merge of #103096 - petrochenkov:indresdoc, r=cjgillotbors-1/+1
resolve: Shadow erroneous glob imports with erroneous single imports If such shadowing doesn't happen we end up in a weird state that may cause ICEs. (In non-erroneous cases single imports always shadow glob imports too.) Fixes https://github.com/rust-lang/rust/issues/100047 Fixes https://github.com/rust-lang/rust/issues/100241
2022-10-16Auto merge of #102026 - Bryanskiy:resolve_update, r=petrochenkovbors-64/+65
Populate effective visibilities in 'rustc_resolve' Next part of RFC https://github.com/rust-lang/rust/issues/48054. previous: https://github.com/rust-lang/rust/pull/101713 `@rustbot` author r? `@petrochenkov`
2022-10-16Populate effective visibilities in 'rustc_resolve'Bryanskiy-64/+65
2022-10-16Point to shadowed name when it exists.Camille GILLOT-5/+40
2022-10-16Account for hygiene when suggesting typos.Camille GILLOT-9/+29
2022-10-16resolve: Shadow erroneous glob imports with erroneous single importsVadim Petrochenkov-1/+1
2022-10-15Rollup merge of #102884 - petrochenkov:liferib, r=cjgillotDylan DPC-65/+77
resolve: Some cleanup, asserts and tests for lifetime ribs Follow up to https://github.com/rust-lang/rust/pull/98279 and friends. r? ``@cjgillot``
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