summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2021-12-23implement `generic_arg_infer` for array lengthslcnr-1/+22
2021-12-18Rollup merge of #89090 - cjgillot:bare-dyn, r=jackh726Matthias Krüger-45/+3
Lint bare traits in AstConv. Removing the lint from lowering allows to: - make lowering querification easier; - have the lint implementation in only one place. r? `@estebank`
2021-12-15Rollup merge of #91888 - BoxyUwU:generic_arg_infer_aaaa, r=lcnrMatthias Krüger-2/+1
Handle unordered const/ty generics for object lifetime defaults *feel like I should have a PR description but cant think of what to put here* r? ```@lcnr```
2021-12-15Rollup merge of #91881 - Patrick-Poitras:stabilize-iter-zip, r=scottmcmMatthias Krüger-1/+0
Stabilize `iter::zip` Hello all! As the tracking issue (#83574) for `iter::zip` completed the final commenting period without any concerns being raised, I hereby submit this stabilization PR on the issue. As the pull request that introduced the feature (#82917) states, the `iter::zip` function is a shorter way to zip two iterators. As it's generally a quality-of-life/ergonomic improvement, it has been integrated into the codebase without any trouble, and has been used in many places across the rust compiler and standard library since March without any issues. For more details, I would refer to `@cuviper's` original PR, or the [function's documentation](https://doc.rust-lang.org/std/iter/fn.zip.html).
2021-12-14Stabilize iter::zip.PFPoitras-1/+0
2021-12-14awdawdawdEllen-2/+1
2021-12-13Keep info on pre-desugaring expression for better "incorrect `.await`" ↵Esteban Kuber-5/+6
suggestion Keep the `HirId` of `.await`ed expressions so in the case of a `fn` call on on a sync `fn`, we can suggest maybe turning it into an `async fn`.
2021-12-07Store impl_trait_fn inside OpaqueTyOrigin.Camille GILLOT-16/+9
2021-12-07Use collect_in_band_defs for async lifetime captures.Camille GILLOT-54/+44
2021-12-07Simplify collect_in_band_defs.Camille GILLOT-36/+35
2021-12-04Lint bare traits in AstConv.Camille GILLOT-45/+3
2021-12-04Use IntoIterator for array impl everywhere.Mara Bos-4/+3
2021-12-03Auto merge of #90737 - eholk:intofuture, r=tmandrybors-0/+2
Reintroduce `into_future` in `.await` desugaring This is a reintroduction of the remaining parts from https://github.com/rust-lang/rust/pull/65244 that have not been relanded yet. This isn't quite ready to merge yet. The last attempt was reverting due to performance regressions, so we need to make sure this does not introduce those issues again. Issues #67644, #67982 /cc `@yoshuawuyts`
2021-11-30Merge Implicit and ImplicitMissing.Camille GILLOT-15/+7
2021-11-30Lint elided lifetimes in path during lifetime resolution.Camille GILLOT-4/+13
2021-11-22Reintroduce `into_future` in `.await` desugaringEric Holk-0/+2
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
2021-11-19Rollup merge of #90990 - nnethercote:arenas-cleanup, r=oli-obkYuki Okushi-1/+1
Arenas cleanup I was looking closely at the arenas code and here are some small improvement to readability.
2021-11-18rustc: Remove `#[rustc_synthetic]`Vadim Petrochenkov-10/+2
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.
2021-11-17Remove unnecessary lifetime argument from arena macros.Nicholas Nethercote-1/+1
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.
2021-10-29Auto merge of #90380 - Mark-Simulacrum:revert-89558-query-stable-lint, r=lcnrbors-1/+0
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.
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-1/+0
2021-10-28Auto merge of #90145 - cjgillot:sorted-map, r=michaelwoeristerbors-8/+10
Use SortedMap in HIR. Closes https://github.com/rust-lang/rust/issues/89788 r? `@ghost`
2021-10-24Rollup merge of #89558 - lcnr:query-stable-lint, r=estebankMatthias Krüger-0/+1
Add rustc lint, warning when iterating over hashmaps r? rust-lang/wg-incr-comp
2021-10-21Use SortedMap in HIR.Camille GILLOT-8/+10
2021-10-18Auto merge of #89124 - cjgillot:owner-info, r=michaelwoeristerbors-73/+123
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`
2021-10-17rustc_span: `Ident::invalid` -> `Ident::empty`Vadim Petrochenkov-1/+1
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.
2021-10-15allow `potential_query_instability` everywherelcnr-0/+1
2021-10-11Make naming more explicit.Camille GILLOT-6/+10
2021-10-10Compute full HIR hash during lowering.Camille GILLOT-1/+22
2021-10-10Directly use AttributeMap inside OwnerInfo.Camille GILLOT-0/+7
2021-10-09Perform indexing during lowering.Camille GILLOT-1/+7
Do not access DefId<->HirId maps before they are initialized.
2021-10-09Hash during lowering.Camille GILLOT-1/+26
2021-10-09Forbid hashing HIR outside of indexing.Camille GILLOT-40/+5
2021-10-09Use an IndexVec for bodies.Camille GILLOT-2/+2
2021-10-09Store lowering outputs per owner.Camille GILLOT-35/+57
2021-09-30Rollup merge of #89344 - jackh726:maybe-bound-eror, r=cjgillotManish Goregaokar-1/+1
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)
2021-09-29Cleanup lower_generics_mut and make span be the bound itself, not the typejackh726-1/+1
2021-09-22rustc_index: Add some map-like APIs to `IndexVec`Vadim Petrochenkov-15/+7
2021-09-20Make with_hir_id_owner responsible for registering the item.Camille GILLOT-97/+48
2021-09-20Remove lower_node_id_with_owner.Camille GILLOT-63/+34
2021-09-19Auto merge of #88703 - cjgillot:lazymod, r=petrochenkovbors-17/+2
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.
2021-09-19Auto merge of #88627 - cjgillot:noallocuse, r=petrochenkovbors-60/+5
Do not preallocate HirIds Part of https://github.com/rust-lang/rust/pull/87234 r? `@petrochenkov`
2021-09-18Do not preallocate UseTree HirIds.Camille GILLOT-40/+1
2021-09-18Do not preallocate item HirIds.Camille GILLOT-21/+5
2021-09-15Rollup merge of #88775 - pnkfelix:revert-anon-union-parsing, r=davidtwcoManish Goregaokar-9/+0
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.
2021-09-12Gather module items after lowering.Camille GILLOT-17/+2
2021-09-10Give spans their parent item during lowering.Camille GILLOT-2/+7
We only do this operation when incremental compilation is enabled. This avoids pessimizing the span handling for non-incremental compilation.
2021-09-10Add sanity check.Camille GILLOT-2/+2
We force the relative span's parent to be absolute. This avoids having to handle long dependency chains.
2021-09-10Encode spans relative to their parent.Camille GILLOT-0/+7
2021-09-09Revert "Implement Anonymous{Struct, Union} in the AST"Felix S. Klock II-9/+0
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