| Age | Commit message (Collapse) | Author | Lines |
|
This is a reintroduction of the remaining parts from
https://github.com/rust-lang/rust/pull/65244 that have not been relanded
yet.
Issues GH-67644, GH-67982
|
|
Arenas cleanup
I was looking closely at the arenas code and here are some small improvement to readability.
|
|
This function parameter attribute was introduced in https://github.com/rust-lang/rust/pull/44866 as an intermediate step in implementing `impl Trait`, it's not necessary or used anywhere by itself.
|
|
Because it's always `'tcx`. In fact, some of them use a mixture of
passed-in `$tcx` and hard-coded `'tcx`, so no other lifetime would even
work.
This makes the code easier to read.
|
|
Revert "Add rustc lint, warning when iterating over hashmaps"
Fixes perf regressions introduced in https://github.com/rust-lang/rust/pull/90235 by temporarily reverting the relevant PR.
|
|
|
|
Use SortedMap in HIR.
Closes https://github.com/rust-lang/rust/issues/89788
r? `@ghost`
|
|
Add rustc lint, warning when iterating over hashmaps
r? rust-lang/wg-incr-comp
|
|
|
|
Index and hash HIR as part of lowering
Part of https://github.com/rust-lang/rust/pull/88186
~Based on https://github.com/rust-lang/rust/pull/88880 (see merge commit).~
Once HIR is lowered, it is later indexed by the `index_hir` query and hashed for `crate_hash`. This PR moves those post-processing steps to lowering itself. As a side objective, the HIR crate data structure is refactored as an `IndexVec<LocalDefId, Option<OwnerInfo<'hir>>>` where `OwnerInfo` stores all the relevant information for an HIR owner.
r? `@michaelwoerister`
cc `@petrochenkov`
|
|
The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s.
|
|
|
|
|
|
|
|
|
|
Do not access DefId<->HirId maps before they are initialized.
|
|
|
|
|
|
|
|
|
|
Cleanup lower_generics_mut and make span be the bound itself
Closes #86298 (supersedes those changes)
r? `@cjgillot` since you reviewed the other PR
(Used wrong branch for #89338)
|
|
|
|
|
|
|
|
|
|
Gather module items after lowering.
This avoids having a non-local analysis inside lowering.
By implementing `hir_module_items` using a visitor, we make sure that iterations and visitors are consistent.
|
|
Do not preallocate HirIds
Part of https://github.com/rust-lang/rust/pull/87234
r? `@petrochenkov`
|
|
|
|
|
|
Revert anon union parsing
Revert PR #84571 and #85515, which implemented anonymous union parsing in a manner that broke the context-sensitivity for the `union` keyword and thus broke stable Rust code.
Fix #88583.
|
|
|
|
We only do this operation when incremental compilation is enabled. This
avoids pessimizing the span handling for non-incremental compilation.
|
|
We force the relative span's parent to be absolute. This avoids having to
handle long dependency chains.
|
|
|
|
This reverts commit 059b68dd677808e14e560802d235ad40beeba71e.
Note that this was manually adjusted to retain some of the refactoring
introduced by commit 059b68dd677808e14e560802d235ad40beeba71e, so that it could
likewise retain the correction introduced in commit
5b4bc05fa57be19bb5962f4b7c0f165e194e3151
|
|
|
|
|
|
|
|
Move global analyses from lowering to resolution
Split off https://github.com/rust-lang/rust/pull/87234
r? `@petrochenkov`
|
|
Lint missing Abi in ast validation instead of lowering.
|
|
|
|
|
|
|
|
The definition order is already close to the span order, and only differs
in corner cases.
|
|
Introduce `let...else`
Tracking issue: #87335
The trickiest part for me was enforcing the diverging else block with clear diagnostics. Perhaps the obvious solution is to expand to `let _: ! = ..`, but I decided against this because, when a "mismatched type" error is found in typeck, there is no way to trace where in the HIR the expected type originated, AFAICT. In order to pass down this information, I believe we should introduce `Expectation::LetElseNever(HirId)` or maybe add `HirId` to `Expectation::HasType`, but I left that as a future enhancement. For now, I simply assert that the block is `!` with a custom `ObligationCauseCode`, and I think this is clear enough, at least to start. The downside here is that the error points at the entire block rather than the specific expression with the wrong type. I left a todo to this effect.
Overall, I believe this PR is feature-complete with regard to the RFC.
|
|
|
|
|
|
|
|
|
|
|