about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta
AgeCommit message (Collapse)AuthorLines
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-19/+23
And suggest adding the `#[coroutine]` to the closure
2024-04-23Auto merge of #123126 - oli-obk:feed_crate_num, r=davidtwcobors-8/+7
Enable `CrateNum` query feeding via `TyCtxt` Instead of having a magic function that violates some `TyCtxtFeed` invariants, add a `create_def` equivalent for `CrateNum`s. Note that this still isn't tracked by the query system (unlike `create_def`), and that feeding most `CrateNum` queries for crates other than the local one will likely cause performance regressions. These things should be attempted on their own separately, but this PR should stand on its own
2024-04-19Move `stable_crate_ids` from `CrateStore` to `Untracked`Oli Scherer-8/+7
This way it's like `Definitions`, which creates `DefId`s by interning `DefPathData`s, but for interning stable crate hashes
2024-04-17consistency rename: language item -> lang itemRalf Jung-1/+1
2024-04-11remove some things that do not need to beMatthias Krüger-1/+1
2024-04-09Auto merge of #123099 - oli-obk:span_tcx, r=petrochenkovbors-18/+20
Replace some `CrateStore` trait methods with hooks. Just like with the `CrateStore` trait, this avoids the cyclic definition issues with `CStore` being defined after TyCtxt, but needing to be used in TyCtxt.
2024-03-28Replace `RemapFileNameExt::for_codegen` with explicit callsUrgau-11/+5
2024-03-27Make `def_path_hash_to_def_id` a hookOli Scherer-5/+9
2024-03-27Move `CrateStore::expn_hash_to_expn_id` to a hookOli Scherer-11/+5
2024-03-27Start replacing `CStore` trait methods with hooks.Oli Scherer-4/+8
This also avoids the cyclic definition issues with CrateStore being defined after TyCtxt, but needing to be used in TyCtxt.
2024-03-22Always encode implied_predicates query for traitsMichael Goulet-12/+2
With associated type bounds enabled, the implied_predicates and super_predicates queries may differ for traits, since associated type bounds are also implied but are not counted as super predicates.
2024-03-20Split item bounds and item super predicatesMichael Goulet-0/+24
2024-03-20Rollup merge of #121543 - onur-ozkan:clippy-args, r=oli-obkMatthias Krüger-1/+1
various clippy fixes We need to keep the order of the given clippy lint rules before passing them. Since clap doesn't offer any useful interface for this purpose out of the box, we have to handle it manually. Additionally, this PR makes `-D` rules work as expected. Previously, lint rules were limited to `-W`. By enabling `-D`, clippy began to complain numerous lines in the tree, all of which have been resolved in this PR as well. Fixes #121481 cc `@matthiaskrgr`
2024-03-20resolve clippy errorsonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-03-19Rollup merge of #122695 - surechen:make_only_local_explict_argument, r=lcnrMatthias Krüger-2/+2
Change only_local to a enum type. Change only_local to enum type and change the macros to always require a variant of that enum. r? `@lcnr`
2024-03-19Change only_local to enum type and change the macros to always require a ↵surechen-2/+2
variant of that enum.
2024-03-19Remove all checks of `IntrinsicDef::must_be_overridden` except for the ↵Oli Scherer-8/+3
actual overrides in codegen
2024-03-19Make `const_eval_select` a rustc_intrinsicOli Scherer-2/+4
2024-03-18Rollup merge of #122588 - klensy:imported_source_file, r=michaelwoeristerMatthias Krüger-10/+10
less useless filter calls in imported_source_file This reduces calls to `filter` greatly, giving 0.3% instructions win on some tests.
2024-03-16less useless array builds in imported_source_fileklensy-10/+10
2024-03-14hir: Remove `opt_local_def_id_to_hir_id` and `opt_hir_node_by_def_id`Vadim Petrochenkov-2/+2
Also replace a few `hir_node()` calls with `hir_node_by_def_id()`
2024-03-12s/mt/mutability/Oli Scherer-4/+4
2024-03-12Ensure nested allocations in statics do not get deduplicatedOli Scherer-3/+6
2024-03-12Add `nested` bool to `DefKind::Static`.Oli Scherer-2/+4
Will be used in the next commit
2024-03-12Change `DefKind::Static` to a struct variantOli Scherer-14/+14
2024-03-09Rollup merge of #122187 - bjorn3:merge_header_version_checks, r=petrochenkovMatthias Krüger-6/+18
Move metadata header and version checks together This will make it easier to report rustc versions for older metadata formats. Split out of https://github.com/rust-lang/rust/pull/120855
2024-03-09Auto merge of #122010 - oli-obk:intrinsics3.0, r=pnkfelixbors-1/+1
Avoid invoking the `intrinsic` query for DefKinds other than `Fn` or `AssocFn` fixes the perf regression from https://github.com/rust-lang/rust/pull/120675 by only invoking (and thus inserting into the dep graph) the `intrinsic` query if the `DefKind` matches items that can actually be intrinsics
2024-03-08Move metadata header and version checks togetherbjorn3-6/+18
This will make it easier to report rustc versions for older metadata formats.
2024-03-07Apply `EarlyBinder` only to `TraitRef` in `ImplTraitHeader`Yoshitomo Nakanishi-3/+2
2024-03-06Auto merge of #119455 - Mark-Simulacrum:relative-spans, r=cjgillotbors-6/+24
Embed length of offset/position into Span tag byte This cuts the average bytes/relative span from 3.5 to 3.2 on libcore, ultimately saving ~400kb of data.
2024-03-05Avoid invoking the `intrinsic` query for DefKinds other than `Fn` or `AssocFn`Oli Scherer-1/+1
2024-03-05Auto merge of #120675 - oli-obk:intrinsics3.0, r=pnkfelixbors-6/+9
Add a scheme for moving away from `extern "rust-intrinsic"` entirely All `rust-intrinsic`s can become free functions now, either with a fallback body, or with a dummy body and an attribute, requiring backends to actually implement the intrinsic. This PR demonstrates the dummy-body scheme with the `vtable_size` intrinsic. cc https://github.com/rust-lang/rust/issues/63585 follow-up to #120500 MCP at https://github.com/rust-lang/compiler-team/issues/720
2024-03-05Rename all `ParseSess` variables/fields/lifetimes as `psess`.Nicholas Nethercote-2/+2
Existing names for values of this type are `sess`, `parse_sess`, `parse_session`, and `ps`. `sess` is particularly annoying because that's also used for `Session` values, which are often co-located, and it can be difficult to know which type a value named `sess` refers to. (That annoyance is the main motivation for this change.) `psess` is nice and short, which is good for a name used this much. The commit also renames some `parse_sess_created` values as `psess_created`.
2024-03-04make `intrinsic` query legal for any `DefId`Oli Scherer-8/+6
2024-03-04Add a scheme for moving away from `extern "rust-intrinsic"` entirelyOli Scherer-2/+7
2024-03-04Return a struct from `query intrinsic` to be able to add another field in ↵Oli Scherer-2/+2
the next commit
2024-02-18resolve: Scale back unloading of speculatively loaded cratesVadim Petrochenkov-0/+10
2024-02-18By tracking import use types to check whether it is scope uses or the other ↵surechen-1/+1
situations like module-relative uses, we can do more accurate redundant import checking. fixes #117448 For example unnecessary imports in std::prelude that can be eliminated: ```rust use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly use std::option::Option::None; //~ WARNING the item `None` is imported redundantly ```
2024-02-16Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkinbors-5/+7
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-16Auto merge of #120486 - reitermarkus:use-generic-nonzero, r=dtolnaybors-22/+22
Use generic `NonZero` internally. Tracking issue: https://github.com/rust-lang/rust/issues/120257
2024-02-15Return ConstAllocation from eval_static_initializer query directlyOli Scherer-6/+6
2024-02-15Store static initializers in metadata instead of the MIR of statics.Oli Scherer-5/+19
2024-02-15Replace `NonZero::<_>::new` with `NonZero::new`.Markus Reiter-13/+11
2024-02-15Use generic `NonZero` internally.Markus Reiter-23/+25
2024-02-13Auto merge of #120919 - oli-obk:impl_polarity, r=compiler-errorsbors-7/+5
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-12Remove impl_polarity queryOli Scherer-3/+0
2024-02-12Implement intrinsics with fallback bodiesOli Scherer-5/+7
2024-02-12Use a struct instead of a tupleOli Scherer-2/+2
2024-02-12Make impl_trait_ref into a query also returning more information about the implOli Scherer-4/+5
2024-02-12Make `is_intrinsic` query return the intrinsic nameOli Scherer-5/+5