about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2023-03-28Add `(..)` syntax for RTNMichael Goulet-0/+1
2023-03-24Rollup merge of #109536 - petrochenkov:qcstore3, r=cjgillotMatthias Krüger-1/+2
resolve: Rename some cstore methods to match queries and add comments about costs associated with replacing them with query calls. Supersedes https://github.com/rust-lang/rust/pull/108346. r? `@cjgillot`
2023-03-23Rollup merge of #107880 - jieyouxu:issue-107563, r=petrochenkovMatthias Krüger-1/+4
Lint ambiguous glob re-exports Attempts to fix #107563. We currently already emit errors for ambiguous re-exports when two names are re-exported *specifically*, i.e. not from glob exports. This PR attempts to emit deny-by-default lints for ambiguous glob re-exports.
2023-03-23resolve: Rename some cstore methods to match queries and add commentsVadim Petrochenkov-1/+2
about costs associated with replacing them with query calls.
2023-03-23Auto merge of #108221 - petrochenkov:cratecfg, r=michaelwoeristerbors-5/+6
rustc_interface: Add a new query `pre_configure` It partially expands crate attributes before the main expansion pass (without modifying the crate), and the produced preliminary crate attribute list is used for querying a few attributes that are required very early. Crate-level cfg attributes on the crate itself are then expanded normally during the main expansion pass, like attributes on any other nodes. This is a continuation of https://github.com/rust-lang/rust/pull/92473 and one more step to very unstable crate-level proc macro attributes maybe actually working. Previously crate attributes were pre-configured simultaneously with feature extraction, and then written directly into `ast::Crate`.
2023-03-23Auto merge of #109517 - matthiaskrgr:rollup-m3orqzd, r=matthiaskrgrbors-5/+2
Rollup of 7 pull requests Successful merges: - #108541 (Suppress `opaque_hidden_inferred_bound` for nested RPITs) - #109137 (resolve: Querify most cstore access methods (subset 2)) - #109380 (add `known-bug` test for unsoundness issue) - #109462 (Make alias-eq have a relation direction (and rename it to alias-relate)) - #109475 (Simpler checked shifts in MIR building) - #109504 (Stabilize `arc_into_inner` and `rc_into_inner`.) - #109506 (make param bound vars visibly bound vars with -Zverbose) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-23rustc_interface: Add a new query `pre_configure`Vadim Petrochenkov-5/+6
It partially expands crate attributes before the main expansion pass (without modifying the crate), and the produced preliminary crate attribute list is used for querying a few attributes that are required very early. Crate-level cfg attributes are then expanded normally during the main expansion pass, like attributes on any other nodes.
2023-03-22rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov-4/+4
2023-03-20Lint ambiguous glob re-exports许杰友 Jieyou Xu (Joe)-1/+4
2023-03-16resolve: Remove `item_attrs_untracked`Vadim Petrochenkov-4/+1
2023-03-16resolve: Remove `item_generics_num_lifetimes`Vadim Petrochenkov-1/+1
2023-03-13metadata/resolve: Minor refactoring to "tcx -> cstore" conversionsVadim Petrochenkov-3/+5
2023-03-13resolve: Remove `struct_field_names_untracked`Vadim Petrochenkov-6/+9
2023-03-13resolve: Centralize retrieval of items span and item nameVadim Petrochenkov-15/+6
2023-03-13resolve: Remove `fn_has_self_parameter_untracked`Vadim Petrochenkov-3/+3
2023-03-13resolve: Remove `struct_field_visibilities_untracked`Vadim Petrochenkov-2/+2
2023-03-11Simplify message pathsest31-1/+1
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done
2023-03-11Auto merge of #109019 - matthiaskrgr:rollup-ihjntil, r=matthiaskrgrbors-3/+8
Rollup of 9 pull requests Successful merges: - #104363 (Make `unused_allocation` lint against `Box::new` too) - #106633 (Stabilize `nonzero_min_max`) - #106844 (allow negative numeric literals in `concat!`) - #108071 (Implement goal caching with the new solver) - #108542 (Force parentheses around `match` expression in binary expression) - #108690 (Place size limits on query keys and values) - #108708 (Prevent overflow through Arc::downgrade) - #108739 (Prevent the `start_bx` basic block in codegen from having two `Builder`s at the same time) - #108806 (Querify register_tools and post-expansion early lints) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-11Rollup merge of #108806 - cjgillot:query-lints, r=davidtwcoMatthias Krüger-3/+8
Querify register_tools and post-expansion early lints The 2 extra queries correspond to code that happen before and after macro expansion, and don't need the resolver to exist.
2023-03-10rustdoc: Don't crash on `crate` references in blocksAdrian Heine-10/+2
This is a regression from #94857.
2023-03-06Querify early_lint_checks.Camille GILLOT-0/+2
2023-03-06Querify registered_tools.Camille GILLOT-3/+6
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-9/+2
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
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