| Age | Commit message (Collapse) | Author | Lines |
|
And suggest adding the `#[coroutine]` to the closure
|
|
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
|
|
This way it's like `Definitions`, which creates `DefId`s by interning `DefPathData`s, but for interning stable crate hashes
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
This also avoids the cyclic definition issues with CrateStore being
defined after TyCtxt, but needing to be used in TyCtxt.
|
|
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.
|
|
|
|
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`
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
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`
|
|
variant of that enum.
|
|
actual overrides in codegen
|
|
|
|
less useless filter calls in imported_source_file
This reduces calls to `filter` greatly, giving 0.3% instructions win on some tests.
|
|
|
|
Also replace a few `hir_node()` calls with `hir_node_by_def_id()`
|
|
|
|
|
|
Will be used in the next commit
|
|
|
|
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
|
|
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
|
|
This will make it easier to report rustc versions for older metadata
formats.
|
|
|
|
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.
|
|
|
|
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
|
|
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`.
|
|
|
|
|
|
the next commit
|
|
|
|
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
```
|
|
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)
|
|
Use generic `NonZero` internally.
Tracking issue: https://github.com/rust-lang/rust/issues/120257
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|