about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query
AgeCommit message (Collapse)AuthorLines
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.
2023-02-22Remove some resolver outputs.Camille GILLOT-3/+0
2023-02-21Rollup merge of #108141 - spastorino:add_rpitit_queries, r=compiler-errorsDylan DPC-4/+23
Add rpitit queries This is part of the changes we are making to lower RPITITs as an associated type. The rest of the stuff will follow under a `-Z` flag. I still need to add comments to the code, explain stuff and also I'd need to avoid encoding in metadata when rpitit queries return `&[]` r? `@compiler-errors`
2023-02-20Move the resolver into a queryOli Scherer-1/+13
2023-02-19Document associated_item methodsSantiago Pastorino-1/+6
2023-02-19Add associated_item_for_impl_trait_in_trait querySantiago Pastorino-0/+8
2023-02-19Add associated_items_for_impl_trait_in_trait querySantiago Pastorino-0/+7
2023-02-17Make encode_attrs use opt_local_def_id_to_hir_id so we can feed it with None ↵Santiago Pastorino-4/+3
for definitions that have no HIR
2023-02-17Auto merge of #108075 - WaffleLapkin:de-arena-allocates-you-OwO, r=Nilstriebbors-3/+2
Remove `arena_cache` modifier from `associated_item` query & copy `ty::AssocItem` instead of passing by ref r? `@ghost`
2023-02-17Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwUbors-1/+1
Switch to `EarlyBinder` for `type_of` query Part of the work to finish #105779 and implement https://github.com/rust-lang/types-team/issues/78. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`. r? `@lcnr`
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-1/+1
in metadata
2023-02-17Rollup merge of #108133 - kylematsuda:earlybinder-cleanups, r=compiler-errorsMatthias Krüger-1/+1
Small cleanups around `EarlyBinder` Cleaning up a few things that were brought up by `@lcnr` in reviewing #106696: - [make `issue33140_self_ty` query return `Option<EarlyBinder<Ty>>`](https://github.com/rust-lang/rust/pull/106696#discussion_r1067821423) - [small style improvement](https://github.com/rust-lang/rust/pull/106696#discussion_r1067816772)
2023-02-16make issue33140_self_ty return Option<EarlyBinder<Ty>>Kyle Matsuda-1/+1
2023-02-16Rename some region-specific stuffMichael Goulet-3/+3
2023-02-15Auto merge of #108012 - compiler-errors:issue-107999, r=oli-obkbors-4/+4
Don't ICE in `might_permit_raw_init` if reference is polymorphic Emitting optimized MIR for a polymorphic function may require computing layout of a type that isn't (yet) known. This happens in the instcombine pass, for example. Let's fail gracefully in that condition. cc `@saethlin` fixes #107999
2023-02-15Copy `ty::AssocItem` all other the placeMaybe Waffle-1/+1