Michael Goulet
a208bae00e
Support async gen fn
2023-12-08 17:23:26 +00:00
Michael Goulet
2806c2df7b
coro_kind -> coroutine_kind
2023-12-08 17:23:25 +00:00
Eric Holk
f9d1f922dc
Option<CoroutineKind>
2023-12-04 13:03:37 -08:00
Eric Holk
48d5f1f0f2
Merge Async and Gen into CoroutineKind
2023-12-04 12:48:01 -08:00
Eric Holk
c104f3b629
Lower return types for gen fn to impl Iterator
2023-12-04 11:23:05 -08:00
Vadim Petrochenkov
17e799c270
rustc: Harmonize DefKind
and DefPathData
...
`DefPathData::(ClosureExpr,ImplTrait)` are renamed to match `DefKind::(Closure,OpaqueTy)`.
`DefPathData::ImplTraitAssocTy` is replaced with `DefPathData::TypeNS(kw::Empty)` because both correspond to `DefKind::AssocTy`.
It's possible that introducing `(DefKind,DefPathData)::AssocOpaqueTy` could be a better solution, but that would be a much more invasive change.
Const generic parameters introduced for effects are moved from `DefPathData::TypeNS` to `DefPathData::ValueNS`, because constants are values.
`DefPathData` is no longer passed to `create_def` functions to avoid redundancy.
2023-12-03 16:24:56 +03:00
Vadim Petrochenkov
84de641484
def collector: Set correct namespace in DefPathData
for foreign types
2023-11-28 16:17:52 +03:00
Vadim Petrochenkov
f0dc906319
resolve: Feed the def_kind
query immediately on DefId
creation
2023-11-28 15:39:31 +03:00
Jake Goulding
87380cbc0c
Address unused tuple struct fields in the compiler
2023-11-27 13:54:50 -05:00
Vadim Petrochenkov
ad0770eeee
resolve: Avoid clones of MacroData
...
And move declarative macro compilation to an earlier point in def collector, which is required for #118188 .
2023-11-25 02:32:33 +03:00
Oli Scherer
621494382d
Add gen blocks to ast and do some broken ast lowering
2023-10-27 13:05:48 +00:00
Arpad Borsos
c8ead2e693
Remove the NodeId
of ast::ExprKind::Async
2023-03-19 19:01:31 +01:00
Oli Scherer
43a5cc383d
Separate the lifetime of the session and the arena in the resolver
2023-02-14 10:01:25 +00:00
Vadim Petrochenkov
b32a4edb20
rustc_ast_lowering: Stop lowering imports into multiple items
...
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-01 18:51:20 +03:00
bors
66ccf36f16
Auto merge of #104711 - Dylan-DPC:rollup-gkw1qr8, r=Dylan-DPC
...
Rollup of 6 pull requests
Successful merges:
- #104295 (Check generics parity before collecting return-position `impl Trait`s in trait)
- #104464 (Reduce exceptions overallocation on non Windows x86_64)
- #104615 (Create def_id for async fns during lowering)
- #104669 (Only declare bindings for if-let guards once per arm)
- #104701 (Remove a lifetime resolution hack from `compare_predicate_entailment`)
- #104710 (disable strict-provenance-violating doctests in Miri)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-22 13:18:45 +00:00
Dylan DPC
88542a3150
Rollup merge of #104615 - spastorino:create-async-def-id-in-lowering, r=compiler-errors
...
Create def_id for async fns during lowering
r? `@compiler-errors`
2022-11-22 16:36:37 +05:30
Vadim Petrochenkov
7a5376d23c
Unreserve braced enum variants in value namespace
2022-11-21 22:40:06 +03:00
Santiago Pastorino
520fafe5c2
Create def_id for async fns during lowering
2022-11-19 19:17:14 -03:00
Nicholas Nethercote
6b7ca2fcf2
Box ExprKind::{Closure,MethodCall}
, and QSelf
in expressions, types, and patterns.
2022-11-17 13:45:59 +11:00
Michael Goulet
d3bd6beb97
Rename AssocItemKind::TyAlias to AssocItemKind::Type
2022-10-10 02:31:37 +00:00
Santiago Pastorino
b2bef02bcd
create def ids for impl traits during ast lowering
2022-09-30 15:12:01 -03:00
Michael Goulet
730ead8047
Only generate closure def id for async fns with body
2022-09-25 23:03:15 +00:00
Nicholas Nethercote
925363f13d
Remove unused span argument from walk_fn
.
2022-09-12 13:24:27 +10:00
Oli Scherer
ee3c835018
Always import all tracing macros for the entire crate instead of piecemeal by module
2022-09-01 14:54:27 +00:00
Maybe Waffle
40ae7b5b8e
Parse closure binders
...
This is first step in implementing RFC 3216.
- Parse `for<'a>` before closures in ast
- Error in lowering
- Add `closure_lifetime_binder` feature
2022-07-12 16:25:16 +04:00
Camille GILLOT
603746a35e
Make ResolverAstLowering a struct.
2022-06-14 22:44:27 +02:00
Jacob Pratt
49c82f31a8
Remove crate
visibility usage in compiler
2022-05-20 20:04:54 -04:00
Camille GILLOT
dde7bff574
Replace DefPathData::Misc by two appropriately-named variants.
2022-05-12 20:12:35 +02:00
Camille GILLOT
e47f66dc0d
Visit generics inside visit_fn.
2022-04-17 11:03:33 +02:00
Vadim Petrochenkov
55595c5616
ast: Always keep a NodeId
in ast::Crate
...
This makes it more uniform with other expanded nodes
2022-01-05 17:09:37 +08:00
Vadim Petrochenkov
0d61852cc5
hir: Do not introduce dummy type names for extern
blocks in def paths
...
Use a separate nameless `DefPathData` variant instead
2021-12-18 16:30:17 +08:00
Vadim Petrochenkov
141c6cc78e
expand: Turn ast::Crate
into a first class expansion target
...
And stop creating a fake `mod` item for the crate root when expanding a crate.
2021-11-28 15:48:55 +08:00
Camille GILLOT
2e37ed87fc
Record call_site parent for macros.
2021-09-10 20:19:25 +02:00
Camille GILLOT
078dd37f88
Use LocalExpnId where possible.
2021-07-17 19:41:02 +02:00
Vadim Petrochenkov
b25d3ba781
ast/hir: Rename field-related structures
...
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.
2021-03-16 11:41:24 +03:00
Camille GILLOT
445b4e379c
Make def_key and HIR parenting consistent.
2021-03-12 22:48:32 +01:00
Vadim Petrochenkov
d81c1946c6
resolve/expand: Improve attribute expansion on macro definitions and calls
2021-01-09 18:43:01 +03:00
Joshua Nelson
edeac1778c
Rename kw::Invalid -> kw::Empty
...
See 220054471
for context.
2020-12-30 09:50:02 -05:00
Vadim Petrochenkov
19dbb02a89
Expand NtExpr
tokens only in key-value attributes
2020-11-03 00:53:43 +03:00
bors
3e0dd24a6c
Auto merge of #77546 - lcnr:impl-trait-closure, r=eddyb
...
fix def collector for impl trait
fixes #77329
We now consistently make `impl Trait` a hir owner, requiring some special casing for synthetic generic params.
r? `@eddyb`
2020-10-25 07:03:58 +00:00
Vadim Petrochenkov
cee5521a03
Calculate visibilities once in resolve
...
Then use them through a query based on resolver outputs
2020-10-19 11:57:50 +03:00
Bastian Kauschke
8f13705e3b
fix def collector for impl trait
2020-10-07 10:19:04 +02:00
mark
9e5f7d5631
mv compiler to compiler/
2020-08-30 18:45:07 +03:00