summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/item.rs
AgeCommit message (Collapse)AuthorLines
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2023-01-12parse const closuresDeadbeef-1/+1
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-1/+1
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).
2022-12-27Rollup merge of #106064 - lukas-code:outlives-macro, r=cjgillotMichael Goulet-15/+15
Partially fix `explicit_outlives_requirements` lint in macros Show the suggestion if and only if the bounds are from the same source context. fixes https://github.com/rust-lang/rust/issues/106044 fixes https://github.com/rust-lang/rust/issues/106063
2022-12-26address review comments + better testsLukas Markeffsky-2/+15
2022-12-25fix more clippy::style findingsMatthias Krüger-8/+8
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-12-22Fix `explicit_outlives_requirements` lint in macrosLukas Markeffsky-15/+2
Show the suggestion if and only if the bounds are from the same source context.
2022-12-18Revert "Introduce lowering_arena to avoid creating AST nodes on the fly"Nilstrieb-3/+1
This reverts commit d9a1faaa9cff6eab069ea8e5cd7862d0ae48e231. This was originally part of a larger PR that has now been closed as a different approach is taken now.
2022-12-08Support `#[track_caller]` on async closuresGary Guo-1/+1
2022-12-06Simplify attribute handling in rustc_ast_loweringGary Guo-11/+5
Given that attributes is stored in a separate BTreeMap, it's not necessary to pass it in when constructing `hir::Expr`. We can just construct `hir::Expr` and then call `self.lower_attrs` later if it needs attributes. As most desugaring code don't use attributes, this allows some code cleanup.
2022-12-05Rollup merge of #105180 - nbdd0121:async_track_caller, r=compiler-errorsMatthias Krüger-8/+20
Use proper HirId for async track_caller attribute check Fix #105134
2022-12-02Fix async track caller for assoc fn and trait impl fnGary Guo-2/+2
2022-12-02Use proper HirId for async track_caller attribute checkGary Guo-6/+18
2022-12-01rustc_ast_lowering: Stop lowering imports into multiple itemsVadim Petrochenkov-74/+10
Lower them into a single item with multiple resolutions instead. This also allows to remove additional `NodId`s and `DefId`s related to those additional items.
2022-12-01rustc_hir: Change representation of import paths to support multiple resolutionsVadim Petrochenkov-11/+10
2022-11-24Record in HIR whether lifetime elision was succesful.Camille GILLOT-3/+3
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-2/+1
2022-11-22`rustc_ast_lowering`: remove `ref` patternsMaybe Waffle-102/+79
2022-11-22Split `MacArgs` in two.Nicholas Nethercote-1/+1
`MacArgs` is an enum with three variants: `Empty`, `Delimited`, and `Eq`. It's used in two ways: - For representing attribute macro arguments (e.g. in `AttrItem`), where all three variants are used. - For representing function-like macros (e.g. in `MacCall` and `MacroDef`), where only the `Delimited` variant is used. In other words, `MacArgs` is used in two quite different places due to them having partial overlap. I find this makes the code hard to read. It also leads to various unreachable code paths, and allows invalid values (such as accidentally using `MacArgs::Empty` in a `MacCall`). This commit splits `MacArgs` in two: - `DelimArgs` is a new struct just for the "delimited arguments" case. It is now used in `MacCall` and `MacroDef`. - `AttrArgs` is a renaming of the old `MacArgs` enum for the attribute macro case. Its `Delimited` variant now contains a `DelimArgs`. Various other related things are renamed as well. These changes make the code clearer, avoids several unreachable paths, and disallows the invalid values.
2022-11-18Auto merge of #101562 - nnethercote:shrink-ast-Expr-harder, r=petrochenkovbors-2/+2
Shrink `ast::Expr` harder r? `@ghost`
2022-11-18Auto merge of #104330 - CastilloDel:ast_lowering, r=cjgillotbors-5/+4
Remove allow(rustc::potential_query_instability) from rustc_ast_lowering Related to https://github.com/rust-lang/rust/issues/84447. `@cjgillot` Thanks for helping me!
2022-11-17Auto merge of #104219 - bryangarza:async-track-caller-dup, r=eholkbors-1/+1
Support `#[track_caller]` on async fns Adds `#[track_caller]` to the generator that is created when we desugar the async fn. Fixes #78840 Open questions: - What is the performance impact of adding `#[track_caller]` to every `GenFuture`'s `poll(...)` function, even if it's unused (i.e., the parent span does not set `#[track_caller]`)? We might need to set it only conditionally, if the indirection causes overhead we don't want.
2022-11-17Use `ThinVec` in `ast::Path`.Nicholas Nethercote-2/+2
2022-11-15Update compiler/rustc_ast_lowering/src/item.rsDaniel del Castillo-7/+1
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2022-11-15Change LoweringContext.children to VecCastilloDel-6/+11
2022-11-13Store a LocalDefId in hir::Variant & hir::Field.Camille GILLOT-5/+8
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-13/+13
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-15Auto merge of #99292 - Aaron1011:stability-use-tree, r=cjgillotbors-2/+10
Correctly handle path stability for 'use tree' items PR #95956 started checking the stability of path segments. However, this was not applied to 'use tree' items (e.g. 'use some::path::{ItemOne, ItemTwo}') due to the way that we desugar these items in HIR lowering. This PR modifies 'use tree' lowering to preserve resolution information, which is needed by stability checking.
2022-10-11wip: trying to enable #[track_caller] on async fnEric Holk-1/+1
2022-10-11rustc_hir: Less error-prone methods for accessing `PartialRes` resolutionVadim Petrochenkov-3/+6
2022-10-10Rename AssocItemKind::TyAlias to AssocItemKind::TypeMichael Goulet-4/+4
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-2/+2
2022-09-27Do not overwrite binders for another HirId.Camille GILLOT-0/+2
2022-09-25Only lower async fn body if it actually has a bodyMichael Goulet-7/+6
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-9/+14
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-22Improve the help message for an invalid calling conventionkhyperia-4/+14
2022-09-14Pass ImplTraitContext as &, there's no need for that to be &mutSantiago Pastorino-48/+35
2022-09-09Address rebase issues, make async fn in trait workMichael Goulet-2/+8
2022-09-09Make async fn in traits workMichael Goulet-4/+10
2022-09-08Rollup merge of #101499 - spastorino:add-lowering-arena, r=oli-obkMichael Goulet-1/+3
Introduce lowering_arena to avoid creating AST nodes on the fly `@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller. r? `@oli-obk` `@cjgillot`
2022-09-08Introduce lowering_arena to avoid creating AST nodes on the flySantiago Pastorino-1/+3
2022-09-06Pass ImplTraitContext as &mut to avoid the need of ↵Santiago Pastorino-43/+56
ImplTraitContext::reborrow later on
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-7/+4
`BindingAnnotation` refactor * `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`) * `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)` * Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}` One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`. I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.
2022-09-06Rollup merge of #101447 - cjgillot:no-remap-resolver, r=spastorinoYuki Okushi-0/+1
Remove generics_def_id_map from the resolver. This is internal state for lowering. This does not belong in the resolver. r? ``@spastorino``
2022-09-05Auto merge of #101228 - nnethercote:simplify-hir-PathSegment, r=petrochenkovbors-2/+6
Simplify `hir::PathSegment` r? `@petrochenkov`
2022-09-05Remove generics_def_id_map from the resolver.Camille GILLOT-0/+1
2022-09-05Address review comments.Nicholas Nethercote-1/+1
2022-09-05Make `hir::PathSegment::hir_id` non-optional.Nicholas Nethercote-1/+2
2022-09-05Make `hir::PathSegment::res` non-optional.Nicholas Nethercote-2/+5
2022-09-02Refactor and re-use BindingAnnotationCameron Steffen-7/+4