summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query
AgeCommit message (Collapse)AuthorLines
2023-04-14Auto merge of #110160 - petrochenkov:notagain2, r=cjgillotbors-4/+0
resolve: Pre-compute non-reexport module children Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
2023-04-12Rollup merge of #110153 - DaniPopes:compiler-typos, r=NilstriebMatthias Krüger-3/+3
Fix typos in compiler I ran [`typos -w compiler`](https://github.com/crate-ci/typos) to fix typos in the `compiler` directory. Refs #110150
2023-04-12resolve: Pre-compute non-reexport module childrenVadim Petrochenkov-4/+0
Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
2023-04-11Split implied and super predicate queriesMichael Goulet-0/+6
2023-04-11Split super_predicates_that_define_assoc_type query from super_predicates_ofMichael Goulet-4/+4
2023-04-10Fix typos in compilerDaniPopes-3/+3
2023-04-08rustc_middle: Remove `Option` from `module_reexports` queryVadim Petrochenkov-1/+1
2023-04-08resolve: Preserve reexport chains in `ModChild`renVadim Petrochenkov-1/+0
This may be potentially useful for - avoiding uses of `hir::ItemKind::Use` - preserving documentation comments on all reexports - preserving and checking stability/deprecation info on reexports - all kinds of diagnostics
2023-04-06Auto merge of #109333 - Zoxc:erase-query-cache-values, r=cjgillotbors-0/+338
Erase query cache values This replaces most concrete query values `V` with `MaybeUninit<[u8; { size_of::<V>() }]>` without introducing dynamic dispatch like https://github.com/rust-lang/rust/pull/108638 does. This is split out of https://github.com/rust-lang/rust/pull/108638 so the performance impact of only this change can be measured. r? `@cjgillot`
2023-04-06Fully erase query valuesJohn Kåre Alsaker-15/+135
2023-04-06Address commentsJohn Kåre Alsaker-1/+3
2023-04-06Avoid the assertion in `erase`John Kåre Alsaker-8/+7
2023-04-06Don't rely on `Debug` impl for `Erased`John Kåre Alsaker-10/+1
2023-04-06Erase query cache valuesJohn Kåre Alsaker-0/+226
2023-04-03Make check_match take a LocalDefId.Camille GILLOT-3/+3
2023-03-28Move `mir::Field` → `abi::FieldIdx`Scott McMurray-1/+2
The first PR for https://github.com/rust-lang/compiler-team/issues/606 This is just the move-and-rename, because it's plenty big-and-bitrotty already. Future PRs will start using `FieldIdx` more broadly, and concomitantly removing `FieldIdx::new`s.
2023-03-23rustc_interface: Add a new query `pre_configure`Vadim Petrochenkov-1/+1
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-21LocalCrate keyMichael Goulet-3/+7
2023-03-21AsLocalKey traitMichael Goulet-306/+44
2023-03-21Use LocalDefId in ItemCtxtMichael Goulet-4/+4
2023-03-21Use local key in providersMichael Goulet-109/+202
2023-03-20Update some names and commentsMichael Goulet-2/+2
2023-03-17Rollup merge of #109198 - compiler-errors:new-rpitit-default-body, r=spastorinoMatthias Krüger-0/+1
Install projection from RPITIT to default trait method opaque correctly 1. For new lowering strategy `-Zlower-impl-trait-in-trait-to-assoc-ty`, install the correct default trait method projection predicates (RPITIT -> opaque). This makes default trait body tests pass! 2. Fix two WF-checking bugs -- first, we want to make sure that we're always looking for an opaque type in `check_return_position_impl_trait_in_trait_bounds`. That's because the RPITIT projections are normalized to opaques during wfcheck. Second, fix RPITIT's param-envs by not adding the projection predicates that we install on trait methods to make default RPITITs work -- I left a comment why. 3. Also, just a small drive-by for `rustc_on_unimplemented`. Not sure if it affects any tests, but can't hurt. r? ````@spastorino,```` based off of #109140
2023-03-16Rollup merge of #109180 - gimbles:master, r=compiler-errorsMatthias Krüger-1/+1
Unequal → Not equal Fixes #109168
2023-03-15Feed is_type_alias_impl_trait for RPITITs on the trait sideSantiago Pastorino-0/+1
2023-03-15unequal → not equalgimbles-1/+1
2023-03-15Rollup merge of #109109 - compiler-errors:polymorphize-foreign, r=NilstriebDylan DPC-2/+2
Use `unused_generic_params` from crate metadata Due to the way that `separate_provide_extern` interacted with the implementation of `<ty::InstanceDef<'tcx> as Key>::query_crate_is_local`, we actually never hit the foreign provider for `unused_generic_params`. Additionally, since the *local* provider of `unused_generic_params` calls `should_polymorphize`, which always returns false if the def-id is foreign, this means that we never actually polymorphize monomorphic instances originating from foreign crates. We don't actually encode `unused_generic_params` for items where all generics are used, so I had to tweak the foreign provider to fall back to `ty::UnusedGenericParams::new_all_used()` to avoid more ICEs when the above bugs were fixed.
2023-03-14Use `unused_generic_params` from crate metadataMichael Goulet-2/+2
2023-03-13Don't opt_rpitit_info as a separate queryMichael Goulet-8/+0
2023-03-12Auto merge of #108700 - spastorino:new-rpitit-impl-side-2, r=compiler-errorsbors-0/+1
Make RPITITs simple cases work when using lower_impl_trait_in_trait_to_assoc_ty r? `@compiler-errors` It's probably best reviewed commit by commit.
2023-03-11Rollup merge of #108806 - cjgillot:query-lints, r=davidtwcoMatthias Krüger-0/+9
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-08Auto merge of #108312 - michaelwoerister:hash-set-not-hash-stable, r=eholkbors-6/+6
Do not implement HashStable for HashSet (MCP 533) This PR removes all occurrences of `HashSet` in query results, replacing it either with `FxIndexSet` or with `UnordSet`, and then removes the `HashStable` implementation of `HashSet`. This is part of implementing [MCP 533](https://github.com/rust-lang/compiler-team/issues/533), that is, removing the `HashStable` implementations of all collection types with unstable iteration order. The changes are mostly mechanical. The only place where additional sorting is happening is in Miri's override implementation of the `exported_symbols` query.
2023-03-06Implement param_env for RPITITs assoc typeSantiago Pastorino-0/+1
2023-03-06Querify early_lint_checks.Camille GILLOT-0/+4
2023-03-06Querify registered_tools.Camille GILLOT-0/+5
2023-03-03Match unmatched backticks in compiler/ that are part of rustdocest31-1/+1
2023-03-01Make associated_item_def_ids for traits use an unstable option to also ↵Santiago Pastorino-0/+11
return associated types for RPITITs
2023-03-01Add opt_rpitit_info querySantiago Pastorino-0/+8
2023-03-01Use UnordSet instead of FxHashSet for names_imported_by_glob_use query.Michael Woerister-1/+1
2023-03-01Use FxIndexSet instead of FxHashSet for asm_target_features query.Michael Woerister-1/+1
2023-03-01Use LocalDefIdSet/Map instead of FxHashSet/Map for ↵Michael Woerister-2/+2
live_symbols_and_ignored_derived_traits query.
2023-03-01Use LocalDefIdSet instead of FxHashSet for reachable_set query.Michael Woerister-1/+1
2023-03-01Use DefIdMap instead of FxHashMap for impl_item_implementor_ids query.Michael Woerister-1/+1
2023-03-01Rollup merge of #108505 - Nilstrieb:further-unify-validity-intrinsics, ↵Matthias Krüger-4/+4
r=michaelwoerister Further unify validity intrinsics Also merges the inhabitedness check into the query to further unify the code paths. Depends on #108364
2023-02-27Auto merge of #108487 - cjgillot:no-typeck-mir, r=oli-obkbors-7/+3
Avoid invoking typeck from borrowck This PR attempts to reduce direct dependencies between typeck and MIR-related queries. The goal is to have all the information transit either through THIR or through dedicated queries that avoid depending on the whole `TypeckResults`. In a first commit, we store the type information that MIR building requires into THIR. This avoids edges between mir_built and typeck. In the second and third commit, we wrap informations around closures (upvars, kind origin and user-provided signature) to avoid borrowck depending on typeck information. There should be a single remaining borrowck -> typeck edge in the good path, due to inline consts.
2023-02-27Rollup merge of #108363 - cjgillot:unused-crate, r=WaffleLapkinMatthias Krüger-3/+0
Move the unused extern crate check back to the resolver. It doesn't have anything to do in `rustc_hir_typeck`.
2023-02-27Unify all validity check intrinsicsNilstrieb-4/+4
Also merges the inhabitedness check into the query to further unify the code paths.
2023-02-26Wrap more into into closure_typeinfo query.Camille GILLOT-1/+1
2023-02-26Access upvars through a query.Camille GILLOT-7/+3
2023-02-23Unify validity checks into a single queryNilstrieb-7/+25
Previously, there were two queries to check whether a type allows the 0x01 or zeroed bitpattern. I am planning on adding a further initness to check, truly uninit for MaybeUninit, which would make this three queries. This seems overkill for such a small feature, so this PR unifies them into one.