summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2023-02-27Rollup merge of #108363 - cjgillot:unused-crate, r=WaffleLapkinMatthias Krüger-9/+0
Move the unused extern crate check back to the resolver. It doesn't have anything to do in `rustc_hir_typeck`.
2023-02-22Remove some resolver outputs.Camille GILLOT-9/+0
2023-02-22Rollup merge of #108353 - petrochenkov:rmir, r=cjgillotMatthias Krüger-4/+2
resolve: Remove `ImportResolver` It's a trivial wrapper over `Resolver` that doesn't bring any benefits
2023-02-22resolve: Remove `ImportResolver`Vadim Petrochenkov-4/+2
It's a trivial wrapper over `Resolver` that doesn't bring any benefits
2023-02-22Auto merge of #103042 - davidtwco:translation-distributed-ftl, r=oli-obkbors-1/+6
errors: generate typed identifiers in each crate Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. There are advantages and disadvantages to this change.. #### Advantages - Changing a diagnostic now only recompiles the crate for that diagnostic and those crates that depend on it, rather than `rustc_error_messages` and all crates thereafter. - This approach can be used to support first-party crates that want to supply translatable diagnostics (e.g. `rust-lang/thorin` in https://github.com/rust-lang/rust/pull/102612#discussion_r985372582, cc `@JhonnyBillM)` - We can extend this a little so that tools built using rustc internals (like clippy or rustdoc) can add their own diagnostic resources (much more easily than those resources needing to be available to `rustc_error_messages`) #### Disadvantages - Crates can only refer to the diagnostic messages defined in the current crate (or those from dependencies), rather than all diagnostic messages. - `rustc_driver` (or some other crate we create for this purpose) has to directly depend on *everything* that has error messages. - It already transitively depended on all these crates. #### Pending work - [x] I don't know how to make `rustc_codegen_gcc`'s translated diagnostics work with this approach - because `rustc_driver` can't depend on that crate and so can't get its resources to provide to the diagnostic emission. I don't really know how the alternative codegen backends are actually wired up to the compiler at all. - [x] Update `triagebot.toml` to track the moved FTL files. r? `@compiler-errors` cc #100717
2023-02-22errors: generate typed identifiers in each crateDavid Wood-1/+6
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-21Use a lock-free datastructure for `source_span`Oli Scherer-1/+1
2023-02-20Remove `ResolverTree`Oli Scherer-19/+2
2023-02-20Remove some unnecessary tcx-passingOli Scherer-0/+4
2023-02-20Stop passing in values that one can also get from the tcx lazilyOli Scherer-15/+5
2023-02-20Remove definitions field that is only needed for one methodOli Scherer-1/+0
2023-02-20Stuff a TyCtxt into the ResolverOli Scherer-33/+25
2023-02-20Run the resolver after TyCtxt constructionOli Scherer-17/+10
2023-02-20Make untracked.source_span lockable so that resolution can still write to it ↵Oli Scherer-3/+3
when using TyCtxt
2023-02-20Make untracked.cstore lockable so that resolution can still write to it when ↵Oli Scherer-6/+6
using TyCtxt
2023-02-20Prepare crate loader for LockGuardOli Scherer-6/+8
2023-02-20Prepare for adding a `TyCtxt` to `Resolver`Oli Scherer-15/+23
2023-02-14Separate the lifetime of the session and the arena in the resolverOli Scherer-15/+15
2023-02-13rustc_resolve: Remove `Resolver::clone_output`Vadim Petrochenkov-48/+1
And remove `Clone` impls and `Lrc`s that are no longer necessary
2023-02-13rustdoc: Eliminate remaining uses of resolverVadim Petrochenkov-34/+23
2023-02-10Resolve documentation links in rustc and store the results in metadataVadim Petrochenkov-22/+16
This commit implements MCP https://github.com/rust-lang/compiler-team/issues/584 It also removes code that is no longer used, and that includes code cloning resolver, so issue #83761 is fixed.
2023-01-20Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"Felix S. Klock II-2/+4
This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36. I am doing this to buy us some time with respect to issue #106337 w.r.t. the 1.67 release.
2023-01-13Rollup merge of #106813 - oli-obk:sess_cleanup, r=GuillaumeGomez,petrochenkovMatthias Krüger-1/+5
Remove redundant session field There was already a session available in the resolver, so we access that session.
2023-01-13Remove redundant session fieldOli Scherer-1/+5
2023-01-11Suggest making private tuple struct field publicEsteban Küber-0/+5
Fix #52144.
2022-12-22Rollup merge of #105769 - lyming2007:issue-105177-fix, r=eholkMatthias Krüger-2/+24
add function to tell the identical errors for ambiguity_errors if 2 errors of the kind and ident and span of the ident, b1, b2 and misc1 misc2 are the same we call these 2 ambiguity errors identical prevent identical ambiguity error from pushing into vector of ambiguity_errors this will fix #105177
2022-12-21Change comment to doc commentEric Holk-1/+1
2022-12-19add function to tell if the current ambiguity error matches a previous one ↵Yiming Lei-2/+24
in ambiguity_errors if 2 errors of the kind and ident and span of the ident, b1, b2 and misc1 misc2 are the same then these 2 ambiguity errors matched prevent identical ambiguity error from pushing into vector of ambiguity_errors this will fix #105177
2022-12-18don't clone Copy typesMatthias Krüger-1/+1
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-19/+21
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-20/+13
2022-12-09Generate crate loaders on the flyOli Scherer-12/+24
2022-12-09ResolverTree does not require access to the crate loader, only the storeOli Scherer-5/+5
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-1/+1
2022-11-28Rename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.Nicholas Nethercote-1/+1
We already use a mix of `Literal` and `Lit`. The latter is better because it is shorter without causing any ambiguity.
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-0/+5
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-24Record in HIR whether lifetime elision was succesful.Camille GILLOT-0/+5
2022-11-22rustc_metadata: Switch module children decoding to an iteratorVadim Petrochenkov-1/+1
2022-11-18Rollup merge of #101162 - rajputrajat:master, r=davidtwcoMatthias Krüger-0/+1
Migrate rustc_resolve to use SessionDiagnostic, part # 1 crate a somewhat on larger size, so plz allow some time to get it finished.
2022-11-13rustdoc: Resolve doc links in external traits having local implsVadim Petrochenkov-0/+5
2022-11-13migrating rustc_resolve to SessionDiagnostic. work in progress. startRajput, Rajat-0/+1
implement binding_shadows migrate till self-in-generic-param-default use braces in fluent message as suggested by @compiler-errors. to fix lock file issue reported by CI migrate 'unreachable label' error run formatter name the variables correctly in fluent file SessionDiagnostic -> Diagnostic test "pattern/pat-tuple-field-count-cross.rs" passed test "resolve/bad-env-capture2.rs" passed test "enum/enum-in-scope.rs" and other depended on "resolve_binding_shadows_something_unacceptable" should be passed now. fix crash errors while running test-suite. there might be more. then_some(..) suits better here. all tests passed convert TraitImpl and InvalidAsm. TraitImpl is buggy yet. will fix after receiving help from Zulip migrate "Ralative-2018" migrate "ancestor only" migrate "expected found" migrate "Indeterminate" migrate "module only" revert to the older implementation for now. since this is failing at the moment. follow the convension for fluent variable order the diag attribute as suggested in review comment fix merge error. migrate trait-impl-duplicate make the changes compatible with "Flatten diagnostic slug modules #103345" fix merge remove commented code merge issues fix review comments fix tests
2022-11-05resolve: More detailed effective visibility tracking for importsVadim Petrochenkov-3/+16
Also drop `extern` blocks from the effective visibility table, they are nominally private and it doesn't make sense to keep them there.
2022-11-01Rollup merge of #103760 - petrochenkov:macimp, r=cjgillotDylan DPC-17/+24
resolve: Turn the binding from `#[macro_export]` into a proper `Import` Continuation of https://github.com/rust-lang/rust/pull/91795. ```rust #[macro_export] macro_rules! m { /*...*/ } ``` is desugared to something like ```rust macro_rules! m { /*...*/ } // Non-modularized macro_rules item pub use m; // It's modularized reexport ``` This PR adjusts the internal representation to better match this model.
2022-11-01Rollup merge of #84022 - Aaron1011:remove-derive-res-fallback, r=petrochenkovDylan DPC-4/+2
Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error r? `@ghost`
2022-10-31resolve: Turn the binding from `#[macro_export]` into a proper `Import`Vadim Petrochenkov-11/+14
2022-10-31resolve: Not all imports have their own `NodeId`Vadim Petrochenkov-6/+10
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-10/+11
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-25rustc_middle: Rearrange resolver outputs structures slightlyVadim Petrochenkov-14/+13
2022-10-24Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard errorAaron Hill-4/+2
2022-10-14more dupe word typosRageking8-1/+1