about summary refs log tree commit diff
path: root/compiler/rustc_passes/src/hir_stats.rs
AgeCommit message (Collapse)AuthorLines
2024-11-15Merge `-Zhir-stats` into `-Zinput-stats`Sam Estep-704/+0
2024-11-15Print total node count in `-Z hir-stats`Sam Estep-1/+8
2024-11-03remove attribute ids from hir stats (they're simply not needed)Jonathan Dönszelmann-80/+76
2024-10-20Stop relying on hashmap iteration for hir stat printingNoratrieb-1/+3
Just because the code says it's OK does not mean that it actually is OK. Nodes with the same total size were not sorted, their order relied on hashmap iteration.
2024-10-15Rollup merge of #130635 - eholk:pin-reborrow-sugar, r=compiler-errorsMatthias Krüger-0/+1
Add `&pin (mut|const) T` type position sugar This adds parser support for `&pin mut T` and `&pin const T` references. These are desugared to `Pin<&mut T>` and `Pin<&T>` in the AST lowering phases. This PR currently includes #130526 since that one is in the commit queue. Only the most recent commits (bd450027eb4a94b814a7dd9c0fa29102e6361149 and following) are new. Tracking: - #130494 r? `@compiler-errors`
2024-10-11Auto merge of #131045 - compiler-errors:remove-unnamed_fields, r=wesleywiserbors-2/+0
Retire the `unnamed_fields` feature for now `#![feature(unnamed_fields)]` was implemented in part in #115131 and #115367, however work on that feature has (afaict) stalled and in the mean time there have been some concerns raised (e.g.[^1][^2]) about whether `unnamed_fields` is worthwhile to have in the language, especially in its current desugaring. Because it represents a compiler implementation burden including a new kind of anonymous ADT and additional complication to field selection, and is quite prone to bugs today, I'm choosing to remove the feature. However, since I'm not one to really write a bunch of words, I'm specifically *not* going to de-RFC this feature. This PR essentially *rolls back* the state of this feature to "RFC accepted but not yet implemented"; however if anyone wants to formally unapprove the RFC from the t-lang side, then please be my guest. I'm just not totally willing to summarize the various language-facing reasons for why this feature is or is not worthwhile, since I'm coming from the compiler side mostly. Fixes #117942 Fixes #121161 Fixes #121263 Fixes #121299 Fixes #121722 Fixes #121799 Fixes #126969 Fixes #131041 Tracking: * https://github.com/rust-lang/rust/issues/49804 [^1]: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Unnamed.20struct.2Funion.20fields [^2]: https://github.com/rust-lang/rust/issues/49804#issuecomment-1972619108
2024-10-07Fix clippy and rustfmt compilationEric Holk-27/+24
2024-10-07Add sugar for &pin (const|mut) typesEric Holk-23/+27
2024-10-04rm `ItemKind::OpaqueTy`Noah Lev-1/+0
This introduce an additional collection of opaques on HIR, as they can no longer be listed using the free item list.
2024-10-01Remove anon struct and union typesMichael Goulet-2/+0
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-192/+170
2024-07-29Reformat `use` declarations.Nicholas Nethercote-4/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-16hir: Create `hir::ConstArgKind` enumNoah Lev-1/+1
This will allow lowering const params to a dedicated enum variant, rather than to an `AnonConst` that is later examined during `ty` lowering.
2024-06-28Change RTN to use .. againMichael Goulet-1/+1
2024-06-17Rework precise capturing syntaxMichael Goulet-2/+2
2024-05-31Rollup merge of #125635 - fmease:mv-type-binding-assoc-item-constraint, ↵Matthias Krüger-4/+4
r=compiler-errors Rename HIR `TypeBinding` to `AssocItemConstraint` and related cleanup Rename `hir::TypeBinding` and `ast::AssocConstraint` to `AssocItemConstraint` and update all items and locals using the old terminology. Motivation: The terminology *type binding* is extremely outdated. "Type bindings" not only include constraints on associated *types* but also on associated *constants* (feature `associated_const_equality`) and on RPITITs of associated *functions* (feature `return_type_notation`). Hence the word *item* in the new name. Furthermore, the word *binding* commonly refers to a mapping from a binder/identifier to a "value" for some definition of "value". Its use in "type binding" made sense when equality constraints (e.g., `AssocTy = Ty`) were the only kind of associated item constraint. Nowadays however, we also have *associated type bounds* (e.g., `AssocTy: Bound`) for which the term *binding* doesn't make sense. --- Old terminology (HIR, rustdoc): ``` `TypeBinding`: (associated) type binding ├── `Constraint`: associated type bound └── `Equality`: (associated) equality constraint (?) ├── `Ty`: (associated) type binding └── `Const`: associated const equality (constraint) ``` Old terminology (AST, abbrev.): ``` `AssocConstraint` ├── `Bound` └── `Equality` ├── `Ty` └── `Const` ``` New terminology (AST, HIR, rustdoc): ``` `AssocItemConstraint`: associated item constraint ├── `Bound`: associated type bound └── `Equality`: associated item equality constraint OR associated item binding (for short) ├── `Ty`: associated type equality constraint OR associated type binding (for short) └── `Const`: associated const equality constraint OR associated const binding (for short) ``` r? compiler-errors
2024-05-30Rename HIR `TypeBinding` to `AssocItemConstraint` and related cleanupLeón Orell Valerian Liehr-4/+4
2024-05-29Don't require `visit_body` to take a lifetime that must outlive the function ↵Oli Scherer-1/+1
call
2024-05-15delegation: Implement list delegationVadim Petrochenkov-2/+3
```rust reuse prefix::{a, b, c} ```
2024-04-25ast: Generalize item kind visitingVadim Petrochenkov-1/+1
And avoid duplicating logic for visiting `Item`s with different kinds (regular, associated, foreign).
2024-04-16Avoid lots of `hir::HirId{,Map,Set}` qualifiers.Nicholas Nethercote-2/+2
Because they're a bit redundant.
2024-04-08Thread pattern types through the HIROli Scherer-0/+1
2024-04-08Add pattern types to astOli Scherer-0/+1
2024-03-22Rename `hir::Local` into `hir::LetStmt`Guillaume Gomez-1/+1
2024-03-21Implement macro-based deref!() syntax for deref patternsMichael Goulet-0/+2
Stop using `box PAT` syntax for deref patterns, as it's misleading and also causes their semantics being tangled up.
2024-03-14Rename `hir::StmtKind::Local` into `hir::StmtKind::Let`Guillaume Gomez-1/+1
2024-03-14Rename `ast::StmtKind::Local` into `ast::StmtKind::Let`Guillaume Gomez-1/+1
2024-02-25Add `ast::ExprKind::Dummy`Lieselotte-1/+1
2024-02-15Add an `ErrorGuaranteed` to `ast::TyKind::Err`.Nicholas Nethercote-2/+3
This makes it more like `hir::TyKind::Err`, and avoids a `span_delayed_bug` call in `LoweringContext::lower_ty_direct`. It also requires adding `ast::TyKind::Dummy`, now that `ast::TyKind::Err` can't be used for that purpose in the absence of an error emission. There are a couple of cases that aren't as neat as I would have liked, marked with `FIXME` comments.
2024-02-12Lower anonymous structs or unions to HIRFrank King-0/+1
2024-01-28hir: Remove unnecessary `HirId` from `hir::Let`Vadim Petrochenkov-5/+0
It has 1-to-1 correspondence to its expression id. Also remove mostly useless `visit_let_expr`.
2024-01-17Add `PatKind::Err`Lieselotte-2/+4
2024-01-12Delegation implementation: step 1Bryanskiy-2/+4
2023-12-15banish hir::GenericBound::LangItemTraitMichael Goulet-1/+1
2023-12-12rustc_passes: Enforce `rustc::potential_query_instability` lintMartin Nordholts-0/+4
Stop allowing `rustc::potential_query_instability` in all of `rustc_passes` and instead allow it on a case-by-case basis if it is safe. In this case, all instances of the lint are safe to allow.
2023-11-29Add `never_patterns` feature gateNadrieril-1/+16
2023-10-27Add gen blocks to ast and do some broken ast loweringOli Scherer-2/+2
2023-08-24Parse unnamed fields and anonymous structs or unionsFrank King-0/+2
Anonymous structs or unions are only allowed in struct field definitions. Co-authored-by: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com>
2023-07-25inline format!() args from rustc_codegen_llvm to the end (4)Matthias Krüger-4/+4
r? @WaffleLapkin
2023-06-26`hir`: Add `Become` expression kindMaybe Waffle-2/+2
2023-06-19Syntatically accept `become` expressionsMaybe Waffle-1/+2
2023-04-21offset_ofDrMeepster-2/+3
2023-04-10Remove `..` from return type notationMichael Goulet-1/+1
2023-03-28Add `(..)` syntax for RTNMichael Goulet-1/+1
2023-03-14Remove box expressions from HIRclubby789-1/+1
2023-03-12Remove `box_syntax` from AST and use in toolsclubby789-1/+1
2023-03-03Match unmatched backticks in comments in compiler/est31-1/+1
2023-01-28Take a LocalDefId in hir::Visitor::visit_fn.Camille GILLOT-1/+2
2023-01-12Expand format_args!() in rust_ast_lowering.Mara Bos-1/+1
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-2/+2
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.