| Age | Commit message (Collapse) | Author | Lines |
|
|
|
ast/hir: Rename field-related structures
I always forget what `ast::Field` and `ast::StructField` mean despite working with AST for long time, so this PR changes the naming to less confusing and more consistent.
- `StructField` -> `FieldDef` ("field definition")
- `Field` -> `ExprField` ("expression field", not "field expression")
- `FieldPat` -> `PatField` ("pattern field", not "field pattern")
Various visiting and other methods working with the fields are renamed correspondingly too.
The second commit reduces the size of `ExprKind` by boxing fields of `ExprKind::Struct` in preparation for https://github.com/rust-lang/rust/pull/80080.
|
|
Do not insert impl_trait_in_bindings opaque definitions twice.
The reference to the item already appears inside the `OpaqueDef`. It does not need to be repeated as a statement.
|
|
StructField -> FieldDef ("field definition")
Field -> ExprField ("expression field", not "field expression")
FieldPat -> PatField ("pattern field", not "field pattern")
Also rename visiting and other methods working on them.
|
|
|
|
|
|
Make def_key and HIR parenting consistent.
r? `@petrochenkov`
|
|
|
|
|
|
|
|
The attributes for statements and those of the statements' content.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes some punctuation and formatting; also makes some small wording changes.
|
|
|
|
|
|
|
|
|
|
Crate root is sufficiently different from `mod` items, at least at syntactic level.
Also remove customization point for "`mod` item or crate root" from AST visitors.
|
|
|
|
|
|
Items are guaranteed to be HIR owner.
|
|
|
|
|
|
Box the biggest ast::ItemKind variants
This PR is a different approach on https://github.com/rust-lang/rust/pull/81400, aiming to save memory in humongous ASTs.
The three affected item kind enums are:
- `ast::ItemKind` (208 -> 112 bytes)
- `ast::AssocItemKind` (176 -> 72 bytes)
- `ast::ForeignItemKind` (176 -> 72 bytes)
|
|
Also switches on formatting of the mir build module
|
|
|
|
Stabilize by-value `[T; N]` iterator `core::array::IntoIter`
Tracking issue: https://github.com/rust-lang/rust/issues/65798
This is unblocked now that `min_const_generics` has been stabilized in https://github.com/rust-lang/rust/pull/79135.
This PR does *not* include the corresponding `IntoIterator` impl, which is https://github.com/rust-lang/rust/pull/65819. Instead, an iterator can be constructed through the `new` method.
`new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
|
|
|
|
|
|
|
|
|
|
These fields are only used by hygiene serialized, and should not be
accessed by anything outside of `rustc_span`.
|
|
- Adds optional default values to const generic parameters in the AST
and HIR
- Parses these optional default values
- Adds a `const_generics_defaults` feature gate
|
|
Rename kw::Invalid -> kw::Empty
See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471
for context.
r? `@petrochenkov`
|
|
See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471
for context.
|
|
Rollup of 13 pull requests
Successful merges:
- #79812 (Lint on redundant trailing semicolon after item)
- #80348 (remove redundant clones (clippy::redundant_clone))
- #80358 (Edit rustc_span documentation)
- #80457 (Add missing commas to `rustc_ast_pretty::pp` docs)
- #80461 (Add llvm-libunwind change to bootstrap CHANGELOG)
- #80464 (Use Option::map_or instead of open coding it)
- #80465 (Fix typo in ffi-pure.md)
- #80467 (More uses of the matches! macro)
- #80469 (Fix small typo in time comment)
- #80472 (Use sans-serif font for the "all items" page links)
- #80477 (Make forget intrinsic safe)
- #80482 (don't clone copy types)
- #80487 (don't redundantly repeat field names)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
Tracking issue: https://github.com/rust-lang/rust/issues/65798
This is unblocked now that `min_const_generics` has been stabilized
in https://github.com/rust-lang/rust/pull/79135.
This PR does *not* include the corresponding `IntoIterator` impl,
which is https://github.com/rust-lang/rust/pull/65819.
Instead, an iterator can be constructed through the `new` method.
`new` would become unnecessary when `IntoIterator` is implemented
and might be deprecated then, although it will stay stable.
|
|
Store HIR ForeignItem in a side table
In a similar fashion to Item, ImplItem and TraitItem.
|
|
Generic Associated Types in Trait Paths - Ast part
The Ast part of https://github.com/rust-lang/rust/pull/78978
r? `@petrochenkov`
|
|
|
|
|
|
AssocTyConstraints haven't been fully implemented
|