| Age | Commit message (Collapse) | Author | Lines |
|
|
|
This query allows for sharing code between `rustc_const_eval` and
`rustc_transmutability`.
Also moves `DummyMachine` to `rustc_const_eval`.
|
|
|
|
the next commit
|
|
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)
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
It's only ever used with a reference to `OwnerInfo` as an argument.
|
|
|
|
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
|
|
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.
|
|
replace `track_errors` usages with bubbling up `ErrorGuaranteed`
more of the same as https://github.com/rust-lang/rust/pull/117449 (removing `track_errors`)
|
|
Special-case Bevy dependents to not error
|
|
|
|
|
|
is immutable
|
|
Small changes w/ `query::Erase<_>`
r? `@cjgillot`
cc `@Zoxc`
|
|
|
|
|
|
All other impls replace type generics with `()` (or a type implementing the necessery traits)
and lifetimes with `'static`, do the same for those impls.
|
|
This doesn't really change anything, but makes the code a bit more explicit/readable.
|
|
|
|
|
|
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
|
|
|
|
|
|
This reverts commit 557359f92512ca88b62a602ebda291f17a953002, reversing
changes made to 1e6c09a803fd543a98bfbe1624d697a55300a786.
|
|
|
|
|
|
|
|
The `FnAbi` is just a pointer, so the error type should not be bigger.
|
|
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's
shrink that.
|
|
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
|
|
|
|
|
|
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.
|
|
this avoids having to rebuild the whole compiler on each commit when
`omit-git-hash = false`.
|
|
type may be registered for an opaque type
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|