| Age | Commit message (Collapse) | Author | Lines |
|
|
|
GenericParam does not need to be a HIR owner.
The special case is not required.
Universal impl traits design to regular generic parameters, and their content is owned by the enclosing item.
Existential (and opaque) impl traits generate their own enclosing item, and are collected through it.
|
|
|
|
This currently creates a field which is always false on GenericParamDefKind for future use when
consts are permitted to have defaults
Update const_generics:default locations
Previously just ignored them, now actually do something about them.
Fix using type check instead of value
Add parsing
This adds all the necessary changes to lower const-generics defaults from parsing.
Change P<Expr> to AnonConst
This matches the arguments passed to instantiations of const generics, and makes it specific to
just anonymous constants.
Attempt to fix lowering bugs
|
|
|
|
|
|
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.
|