about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query/erase.rs
AgeCommit message (Collapse)AuthorLines
2024-04-04cache type info for ParamEnvLukas Markeffsky-0/+4
2024-03-22Add `tag_for_variant` queryJack Wrenn-0/+1
This query allows for sharing code between `rustc_const_eval` and `rustc_transmutability`. Also moves `DummyMachine` to `rustc_const_eval`.
2024-03-07Apply `EarlyBinder` only to `TraitRef` in `ImplTraitHeader`Yoshitomo Nakanishi-2/+2
2024-03-04Return a struct from `query intrinsic` to be able to add another field in ↵Oli Scherer-1/+1
the next commit
2024-02-16Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkinbors-0/+1
Implement intrinsics with fallback bodies fixes #93145 (though we can port many more intrinsics) cc #63585 The way this works is that the backend logic for generating custom code for intrinsics has been made fallible. The only failure path is "this intrinsic is unknown". The `Instance` (that was `InstanceDef::Intrinsic`) then gets converted to `InstanceDef::Item`, which represents the fallback body. A regular function call to that body is then codegenned. This is currently implemented for * codegen_ssa (so llvm and gcc) * codegen_cranelift other backends will need to adjust, but they can just keep doing what they were doing if they prefer (though adding new intrinsics to the compiler will then require them to implement them, instead of getting the fallback body). cc `@scottmcm` `@WaffleLapkin` ### todo * [ ] miri support * [x] default intrinsic name to name of function instead of requiring it to be specified in attribute * [x] make sure that the bodies are always available (must be collected for metadata)
2024-02-15Return ConstAllocation from eval_static_initializer query directlyOli Scherer-1/+1
2024-02-15Add new query just for static initializersOli Scherer-0/+1
2024-02-13Auto merge of #120919 - oli-obk:impl_polarity, r=compiler-errorsbors-2/+2
Merge `impl_polarity` and `impl_trait_ref` queries Hopefully this is perf neutral. I want to finish https://github.com/rust-lang/rust/pull/120835 and stop using the HIR in `coherent_trait`, which should then give us a perf improvement.
2024-02-12Use a struct instead of a tupleOli Scherer-3/+2
2024-02-12Make impl_trait_ref into a query also returning more information about the implOli Scherer-2/+3
2024-02-12Make `is_intrinsic` query return the intrinsic nameOli Scherer-0/+1
2024-02-12Lowering field access for anonymous adtsFrank King-0/+1
2024-02-03hir: Remove the generic type parameter from `MaybeOwned`Vadim Petrochenkov-2/+2
It's only ever used with a reference to `OwnerInfo` as an argument.
2024-01-23Remove track_errors entirelyOli Scherer-0/+5
2024-01-19Auto merge of #120112 - matthiaskrgr:rollup-48o3919, r=matthiaskrgrbors-0/+4
Rollup of 9 pull requests Successful merges: - #119582 (bootstrap: handle vendored sources when remapping crate paths) - #119730 (docs: fix typos) - #119828 (Improved collapse_debuginfo attribute, added command-line flag) - #119869 (replace `track_errors` usages with bubbling up `ErrorGuaranteed`) - #120037 (Remove `next_root_ty_var`) - #120094 (tests/ui/asm/inline-syntax: adapt for LLVM 18) - #120096 (Set RUSTC_BOOTSTRAP=1 consistently) - #120101 (change `.unwrap()` to `?` on write where `fmt::Result` is returned) - #120102 (Fix typo in munmap_partial.rs) r? `@ghost` `@rustbot` modify labels: rollup
2024-01-19Auto merge of #120006 - cjgillot:no-hir-owner, r=wesleywiserbors-5/+0
Get rid of the hir_owner query. This query was meant as a firewall between `hir_owner_nodes` which is supposed to change often, and the queries that only depend on the item signature. That firewall was inefficient, leaking the contents of the HIR body through `HirId`s. `hir_owner` incurs a significant cost, as we need to hash HIR twice in multiple modes. This PR proposes to remove it, and simplify the hashing scheme. For the future, `def_kind`, `def_span`... are much more efficient for incremental decoupling, and should be preferred.
2024-01-18Rollup merge of #119869 - oli-obk:track_errors2, r=matthewjasperMatthias Krüger-0/+4
replace `track_errors` usages with bubbling up `ErrorGuaranteed` more of the same as https://github.com/rust-lang/rust/pull/117449 (removing `track_errors`)
2024-01-17Correctly handle normalization in implied boundsAli MJ Al-Nasrawy-0/+4
Special-case Bevy dependents to not error
2024-01-17Make crate_inherent_impls fallible and stop using `track_errors` for itOli Scherer-0/+4
2024-01-16Get rid of the hir_owner query.Camille GILLOT-5/+0
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-0/+1
is immutable
2023-11-08Rollup merge of #116399 - WaffleLapkin:erase_small_things, r=cjgillotMatthias Krüger-6/+16
Small changes w/ `query::Erase<_>` r? `@cjgillot` cc `@Zoxc`
2023-11-07Add an explanation for `transmute_unchecked`Maybe Waffle-0/+9
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-10-03Use consisntent style of `size_of` in query type erasureMaybe Waffle-4/+4
All other impls replace type generics with `()` (or a type implementing the necessery traits) and lifetimes with `'static`, do the same for those impls.
2023-10-03Use `transmute_unchecked` and make the types explicit in query type erasureMaybe Waffle-3/+4
This doesn't really change anything, but makes the code a bit more explicit/readable.
2023-09-21Record asyncness span in HIRMichael Goulet-0/+1
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-4/+3
2023-09-19move ConstValue into mirRalf Jung-10/+6
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-08-27More precisely detect cycle errors from type_of on opaqueMichael Goulet-0/+5
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-0/+1
2023-07-21Revert "Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk"David Tolnay-6/+0
This reverts commit 557359f92512ca88b62a602ebda291f17a953002, reversing changes made to 1e6c09a803fd543a98bfbe1624d697a55300a786.
2023-07-21add crate-local `-Z reference_niches` unstable flag (does nothing for now)Moulins-0/+1
2023-07-21add `naive_layout_of` queryMoulins-0/+5
2023-07-03Remove chalk from the compilerMichael Goulet-1/+0
2023-07-01Put `FnAbiError` behind reference to shrink resultNilstrieb-2/+2
The `FnAbi` is just a pointer, so the error type should not be bigger.
2023-07-01Put `LayoutError` behind reference to shrink resultNilstrieb-4/+6
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's shrink that.
2023-06-21Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnrNilstrieb-1/+1
Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind` Does two basic things before I put up a more delicate set of PRs (along the lines of #112714, but hopefully much cleaner) that migrate existing usages of `ty::Predicate` to `ty::Clause` (`predicates_of`/`item_bounds`/`ParamEnv::caller_bounds`). 1. Rename `Clause` to `ClauseKind`, so it's parallel with `PredicateKind`. 2. Add a new `Clause` type which is parallel to `Predicate`. * This type exposes `Clause::kind(self) -> Binder<'tcx, ClauseKind<'tcx>>` which is parallel to `Predicate::kind` 😸 The new `Clause` type essentially acts as a newtype wrapper around `Predicate` that asserts that it is specifically a `PredicateKind::Clause`. Turns out from experimentation[^1] that this is not negative performance-wise, which is wonderful, since this a much simpler design than something that requires encoding the discriminant into the alignment bits of a predicate kind, or something else like that... r? ``@lcnr`` or ``@oli-obk`` [^1]: https://github.com/rust-lang/rust/pull/112714#issuecomment-1595653910
2023-06-19Make closure_saved_names_of_captured_variables a query.Camille GILLOT-0/+4
2023-06-19s/Clause/ClauseKindMichael Goulet-1/+1
2023-05-18Auto merge of #111345 - jyn514:cfg-release-caching, r=cjgillot,est31bors-1/+1
Only depend on CFG_VERSION in rustc_interface This avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`. cc https://github.com/rust-lang/rust/issues/76720 - this won't fix it, and I'm not suggesting we turn this on by default, but it will make it less painful for people who do have `omit-git-hash` on as a workaround.
2023-05-17Only depend on CFG_VERSION in rustc_interfacejyn-1/+1
this avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`.
2023-05-12Use the opaque_types_defined_by query to cheaply check for whether a hidden ↵Oli Scherer-0/+4
type may be registered for an opaque type
2023-05-09add EarlyBinder to thir_abstract_const; remove tcx.bound_abstract_constKyle Matsuda-3/+4
2023-04-10Fix typos in compilerDaniPopes-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-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