about summary refs log tree commit diff
path: root/compiler/rustc_ast/src
AgeCommit message (Collapse)AuthorLines
2023-03-19Remove the `NodeId` of `ast::ExprKind::Async`Arpad Borsos-10/+5
2023-03-17Rollup merge of #108958 - clubby789:unbox-the-hir, r=compiler-errorsMatthias Krüger-3/+1
Remove box expressions from HIR After #108516, `#[rustc_box]` is used at HIR->THIR lowering and this is no longer emitted, so it can be removed. This is based on top of #108471 to help with conflicts, so 43490488ccacd1a822e9c621f5ed6fca99959a0b is the only relevant commit (sorry for all the duplicated pings!) ````@rustbot```` label +S-blocked
2023-03-16Support flattening/inlining format_args through & and ().Mara Bos-0/+9
E.g. format_args!("{}", &(format_args!("abc"))).
2023-03-16Flatten nested format_args!() into one.Mara Bos-2/+2
2023-03-14Remove box expressions from HIRclubby789-3/+1
2023-03-12Remove `box_syntax` from AST and use in toolsclubby789-8/+1
2023-03-08Rename `MapInPlace` as `FlatMapInPlace`.Nicholas Nethercote-1/+1
After removing the `map_in_place` method, which isn't much use because modifying every element in a collection such as a `Vec` can be done trivially with iteration.
2023-03-03Match unmatched backticks in comments in compiler/est31-1/+1
2023-02-21Use `ThinVec` in a few more AST types.Nicholas Nethercote-6/+6
2023-02-21Use `ThinVec` in `ast::ExprKind::Match`.Nicholas Nethercote-1/+1
2023-02-21Use `ThinVec` in `ast::PatKind::Struct`.Nicholas Nethercote-3/+3
2023-02-21Use `ThinVec` in `ast::AngleBracketedArgs`.Nicholas Nethercote-2/+2
2023-02-21Use `ThinVec` in `ast::Block`.Nicholas Nethercote-2/+2
2023-02-21Use `ThinVec` in various AST types.Nicholas Nethercote-33/+38
This commit changes the sequence parsers to produce `ThinVec`, which triggers numerous conversions.
2023-02-21Use `ThinVec` in `ast::Impl` and related types.Nicholas Nethercote-4/+4
2023-02-21Use `ThinVec` in `ast::WhereClause`.Nicholas Nethercote-9/+20
2023-02-21Use `ThinVec` in `ast::Generics` and related types.Nicholas Nethercote-17/+15
2023-02-11rustc_ast: Merge impls and reorder methods for attributes and meta itemsVadim Petrochenkov-311/+307
2023-02-03Rollup merge of #107544 - nnethercote:improve-TokenCursor, r=petrochenkovDylan DPC-15/+27
Improve `TokenCursor`. Some small improvements, for things that were bugging me. Best reviewed one commit at a time. r? ``@petrochenkov``
2023-02-03Auto merge of #107569 - petrochenkov:optattr, r=nnethercotebors-23/+50
ast: Optimize list and value extraction primitives for attributes It's not necessary to convert the whole attribute into a meta item to extract something specific.
2023-02-03Rename `Cursor`/`CursorRef` as `TokenTreeCursor`/`RefTokenTreeCursor`.Nicholas Nethercote-14/+16
This makes it clear they return token trees, and makes for a nice comparison against `TokenCursor` which returns tokens.
2023-02-03Make clear that `TokenTree::Token` shouldn't contain a delimiter.Nicholas Nethercote-1/+2
2023-02-03Improve doc comment desugaring.Nicholas Nethercote-0/+9
Sometimes the parser needs to desugar a doc comment into `#[doc = r"foo"]`. Currently it does this in a hacky way: by pushing a "fake" new frame (one without a delimiter) onto the `TokenCursor` stack. This commit changes things so that the token stream itself is modified in place. The nice thing about this is that it means `TokenCursorFrame::delim_sp` is now only `None` for the outermost frame.
2023-02-02Revert "Teach parser to understand fake anonymous enum syntax" and related ↵Michael Goulet-2/+2
commits Revert "review comment: Remove AST AnonTy" This reverts commit 020cca8d36cb678e3ddc2ead41364be314d19e93. Revert "Ensure macros are not affected" This reverts commit 12d18e403139eeeeb339e8611b2bed4910864edb. Revert "Emit fewer errors on patterns with possible type ascription" This reverts commit c847a01a3b1f620c4fdb98c75805033e768975d1. Revert "Teach parser to understand fake anonymous enum syntax" This reverts commit 2d824206655bfb26cb5eed43490ee396542b153e.
2023-02-01ast: Optimize list and value extraction primitives for attributesVadim Petrochenkov-23/+50
It's not necessary to convert the whole attribute into a meta item to extract something specific
2023-01-30Replace enum `==`s with `match`es where it makes senseMaybe Waffle-16/+17
2023-01-28Rollup merge of #107194 - ↵Yuki Okushi-2/+1
xfix:remove-slice-internals-dependency-in-rustc-ast, r=Nilstrieb Remove dependency on slice_internals feature in rustc_ast This reduces dependency on unstable features by the compiler.
2023-01-27Replace format flags u32 by enums and bools.Mara Bos-2/+24
2023-01-26Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obkbors-1/+287
Move format_args!() into AST (and expand it during AST lowering) Implements https://github.com/rust-lang/compiler-team/issues/541 This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier. This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`. This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
2023-01-26Rollup merge of #106960 - estebank:parse-anon-enums, r=cjgillotMatthias Krüger-2/+2
Teach parser to understand fake anonymous enum syntax Parse `Ty | OtherTy` in function argument and return types. Parse type ascription in top level patterns. Minimally address #100741.
2023-01-24Work around issue 106930.Mara Bos-0/+6
2023-01-23review comment: Remove AST AnonTyEsteban Küber-5/+2
2023-01-22Remove dependency on slice_internals feature in rustc_astKonrad Borowski-2/+1
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-1/+1
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2023-01-17Teach parser to understand fake anonymous enum syntaxEsteban Küber-3/+6
Parse `-> Ty | OtherTy`. Parse type ascription in top level patterns.
2023-01-15make error emitted on `impl &Trait` nicerEzra Shaw-1/+2
2023-01-12parse const closuresDeadbeef-0/+4
2023-01-12Expand format_args!() in rust_ast_lowering.Mara Bos-1/+281
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-20/+19
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2023-01-04Rollup merge of #106361 - clubby789:int-literal-too-large, r=estebankMatthias Krüger-2/+2
Note maximum integer literal for `IntLiteralTooLarge` Closes #105908 `@rustbot` label +A-diagnostics
2023-01-02Rollup merge of #106383 - Manishearth:ast-docs, r=compiler-errorsMichael Goulet-0/+15
Document some of the AST nodes Someone was confused about some of this on Zulip, added some docs We probably should make sure every last field/variant in the AST/HIR is documented at some point `@bors` rollup
2023-01-02Document rustc_ast::FnHeader fieldsManish Goregaokar-0/+4
2023-01-02Document rustc_ast::Extern variantsManish Goregaokar-0/+11
2023-01-02Print correct base for too-large literalsclubby789-2/+2
Also update tests
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-10/+10
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-25Auto merge of #105701 - RedDocMD:bug-105634, r=cjgillotbors-0/+4
Allow .. to be parsed as let initializer .. and ..= are valid expressions, however when used in a let statement it is not parsed. Fixes #105634
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-4/+2
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18Make `#[debug_format]` an attribute in `newtype_index`Nilstrieb-2/+2
This removes the `custom` format functionality as its only user was trivially migrated to using a normal format. If a new use case for a custom formatting impl pops up, you can add it back.