about summary refs log tree commit diff
path: root/compiler/rustc_resolve
AgeCommit message (Collapse)AuthorLines
2022-09-07Add instrument and debug callsSantiago Pastorino-0/+3
2022-09-07rustc: Parameterize `ty::Visibility` over used IDVadim Petrochenkov-34/+45
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-7/+7
`BindingAnnotation` refactor * `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`) * `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)` * Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}` One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`. I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.
2022-09-06Rollup merge of #101447 - cjgillot:no-remap-resolver, r=spastorinoYuki Okushi-8/+0
Remove generics_def_id_map from the resolver. This is internal state for lowering. This does not belong in the resolver. r? ``@spastorino``
2022-09-05Remove generics_def_id_map from the resolver.Camille GILLOT-8/+0
2022-09-05Rollup merge of #101391 - matthiaskrgr:perf0309, r=oli-obkDylan DPC-1/+1
more clippy::perf fixes
2022-09-03more clippy::perf fixesMatthias Krüger-1/+1
2022-09-03Do not call object_lifetime_default on lifetime params.Camille GILLOT-16/+22
2022-09-02Refactor and re-use BindingAnnotationCameron Steffen-7/+7
2022-09-02Rollup merge of #100147 - Bryanskiy:private-in-public, r=petrochenkovGuillaume Gomez-123/+80
optimization of access level table construction Refactoring which was mentioned in #87487
2022-09-01Auto merge of #98960 - cjgillot:entry-kind, r=estebankbors-1/+1
Remove EntryKind from metadata. This PR continues the refactor of metadata emission to be more systematic, iterating on definitions and filtering based on each definition's `DefKind`. This allows to remove the large `EntryKind` enum, replaced by linear tables in metadata.
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-15/+4
by module
2022-09-01Directly use the `instrument` macro instead of its full pathOli Scherer-27/+27
2022-09-01Auto merge of #100707 - dzvon:fix-typo, r=davidtwcobors-3/+3
Fix a bunch of typo This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31access_levels.rs refactorBryanskiy-123/+80
2022-08-31Fix a bunch of typoDezhi Wu-3/+3
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31Fix uintended diagnostic caused by `drain(..)`Donough Liu-12/+13
2022-08-30Remove fn_has_self_parameter table.Camille GILLOT-1/+1
2022-08-30Auto merge of #101183 - Dylan-DPC:rollup-6kewixv, r=Dylan-DPCbors-48/+9
Rollup of 9 pull requests Successful merges: - #95376 (Add `vec::Drain{,Filter}::keep_rest`) - #100092 (Fall back when relating two opaques by substs in MIR typeck) - #101019 (Suggest returning closure as `impl Fn`) - #101022 (Erase late bound regions before comparing types in `suggest_dereferences`) - #101101 (interpret: make read-pointer-as-bytes a CTFE-only error with extra information) - #101123 (Remove `register_attr` feature) - #101175 (Don't --bless in pre-push hook) - #101176 (rustdoc: remove unused CSS selectors for `.table-display`) - #101180 (Add another MaybeUninit array test with const) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-30Rollup merge of #101123 - JohnTitor:rm-register-attr, r=TaKO8KiDylan DPC-48/+9
Remove `register_attr` feature Closes #66080 Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-08-30Auto merge of #100812 - Nilstrieb:revert-let-chains-nightly, r=Mark-Simulacrumbors-0/+1
Revert let_chains stabilization This is the revert against master, the beta revert was already done in #100538. Bumps the stage0 compiler which already has it reverted.
2022-08-29Revert let_chains stabilizationNilstrieb-0/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. This is the revert against master, the beta revert was already done in #100538.
2022-08-29Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errorsDylan DPC-374/+80
Remove separate indexing of early-bound regions ~Based on https://github.com/rust-lang/rust/pull/99728.~ This PR copies some modifications from https://github.com/rust-lang/rust/pull/97839 around object lifetime defaults. These modifications allow to stop counting generic parameters during lifetime resolution, and rely on the indexing given by `rustc_typeck::collect`.
2022-08-28Auto merge of #100497 - kadiwa4:remove_clone_into_iter, r=cjgillotbors-1/+1
Avoid cloning a collection only to iterate over it `@rustbot` label: +C-cleanup
2022-08-28Remove `register_attr` featureYuki Okushi-48/+9
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-08-27rustc_middle: Remove `Visibility::Invisible`Vadim Petrochenkov-25/+37
2022-08-26Rollup merge of #100817 - vincenzopalazzo:macros/bool_spelling_sugg, r=davidtwcoMichael Goulet-5/+22
sugg: suggest the usage of boolean value when there is a typo in the keyword Fixes https://github.com/rust-lang/rust/issues/100686 This adds a new suggestion when there is a well-known typo With the following program ```rust fn main() { let x = True; } ``` Now we have the following suggestion ``` error[E0425]: cannot find value `True` in this scope --> test.rs:2:13 | 2 | let x = True; | ^^^^ not found in this scope | help: you may want to use a bool value instead | 2 | let x = true; | ~~~~ error: aborting due to previous error ``` Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-08-24Rollup merge of #100901 - TaKO8Ki:make-some-methods-private, r=sanxiynMatthias Krüger-1/+1
Make some methods private
2022-08-22sugg: suggest the usage of boolean value when there is a typo in the keywordVincenzo Palazzo-5/+22
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-08-23Mark suggestion as MaybeIncorrect.Camille GILLOT-1/+1
2022-08-23Remove FnItemRibKind.Camille GILLOT-27/+10
2022-08-23Improve local generic parameter suggestions.Camille GILLOT-31/+38
2022-08-23Create specific ConstantHasGenerics for ConstantItemRibKind.Camille GILLOT-18/+31
2022-08-22make some methods privateTakayuki Maeda-1/+1
2022-08-19Rollup merge of #100592 - cjgillot:debug-import-kind, r=TaKO8KiDylan DPC-1/+39
Manually implement Debug for ImportKind. This avoids crashing due to an infinite loop when running with `RUSTC_LOG=rustc_resolve`.
2022-08-18Rollup merge of #100643 - ↵Matthias Krüger-0/+12
TaKO8Ki:point-at-type-parameter-shadowing-another-type, r=estebank Point at a type parameter shadowing another type This patch fixes a part of #97459.
2022-08-17point at a type parameter shadowing another typeTakayuki Maeda-0/+12
2022-08-15Update compiler/rustc_resolve/src/imports.rsCamille Gillot-1/+1
2022-08-15Manually implement Debug for ImportKind.Camille GILLOT-1/+39
2022-08-13Rollup merge of #100367 - fmease:fix-100365, r=compiler-errorsMichael Goulet-16/+37
Suggest the path separator when a dot is used on a trait Fixes #100365. `@rustbot` label A-diagnostics r? diagnostics
2022-08-13avoid cloning and then iteratingKaDiWa-1/+1
2022-08-12Adjust cfgsMark Rousskov-1/+0
2022-08-11Suggest path separator when a dot is used on a traitLeón Orell Valerian Liehr-16/+37
2022-08-11Rollup merge of #100392 - nnethercote:simplify-visitors, r=cjgillotMatthias Krüger-1/+1
Simplify visitors By removing some unused arguments. r? `@cjgillot`
2022-08-11Rollup merge of #100351 - compiler-errors:diagnostic-convention, r=fee1-deadDylan DPC-3/+3
Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder` unless needed This seems to be the established convention (02ff9e0) when `DiagnosticBuilder` was first added. I am guilty of introducing some of these.
2022-08-11Simplify `rustc_ast::visit::Visitor::visit_poly_trait_ref`.Nicholas Nethercote-1/+1
It is passed an argument that is never used.
2022-08-10Do not consider method call receiver as an argument in AST.Camille GILLOT-3/+2
2022-08-10Use &mut Diagnostic instead of &mut DiagnosticBuilder unless neededMichael Goulet-3/+3
2022-08-09Rollup merge of #100228 - luqmana:suggestion-ice, r=estebankDylan DPC-6/+9
Don't ICE while suggesting updating item path. When an item isn't found, we may suggest an appropriate import to `use`. Along with that, we also suggest updating the path to work with the `use`. Unfortunately, if the code in question originates from a macro, the span used to indicate which part of the path needs updating may not be suitable and cause an ICE (*). Since, such code is not adjustable directly by the user without modifying the macro, just skip the suggestion in such cases. (*) The ICE happens because the emitter want to indicate to the user what code to delete by referencing a certain span. But in this case, said span has `lo == hi == 0` which means it thinks it's a dummy span. Adding a space before the proc macro attribute is enough to stop it from ICE'ing but even then the suggestion doesn't really make any sense: ``` help: if you import `DataStore`, refer to it directly | 1 - #[dbstruct::dbstruct] 1 + #[dbstruct::dbstruct] ``` Since suggestions are best-effort, I just gated this one on `can_be_used_for_suggestions` which catches cases like this. Fixes #100199
2022-08-07Use start_point instead of next_point to point to elided lifetime ampersand.Camille GILLOT-1/+1