about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering
AgeCommit message (Collapse)AuthorLines
2023-11-15Bump cfg(bootstrap)sMark Rousskov-3/+3
2023-11-14Rollup merge of #117858 - compiler-errors:span, r=lcnrTakayuki Maeda-2/+5
Compute layout with spans for better cycle errors in coroutines Split out from #117703, this PR at least gives us a nicer span to point at when we hit a cycle error in coroutine layout cycles.
2023-11-13Compute layout with spans for better cycle errors in coroutinesMichael Goulet-2/+5
2023-11-10Remove `-Zkeep-hygiene-data`.Nicholas Nethercote-5/+0
It was added way back in #28585 under the name `-Zkeep-mtwt-tables`. The justification was: > This is so that the resolution results can be used after analysis, > potentially for tool support. There are no uses of significance in the code base, and various Google searches for both option names (and variants) found nothing of interest. @petrochenkov says removing this part (and it's only part) of the hygiene data is dubious. It doesn't seem that big, so let's just keep it around.
2023-11-04Fix remaining uses of `CaptureBy::Value`Dinu Blanovschi-1/+1
2023-11-03compiler: use `copied` instead of manual `map`DaniPopes-4/+3
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-5/+4
Most notably, this commit changes the `pub use crate::*;` in that file to `use crate::*;`. This requires a lot of `use` items in other crates to be adjusted, because everything defined within `rustc_span::*` was also available via `rustc_span::source_map::*`, which is bizarre. The commit also removes `SourceMap::span_to_relative_line_string`, which is unused.
2023-10-30Some more coroutine renamingsMichael Goulet-6/+6
2023-10-30Rollup merge of #117068 - nnethercote:clean-up-Cargo-toml, r=wesleywiserGuillaume Gomez-2/+4
Clean up `compiler/rustc*/Cargo.toml` Mostly by sorting dependencies, plus some other minor things. r? ``@wesleywiser``
2023-10-30Rollup merge of #117147 - DaniPopes:pphir-fn-variadic, r=compiler-errorsLeón Orell Valerian Liehr-8/+1
Print variadic argument pattern in HIR pretty printer Variadic argument name/pattern was ignored during HIR pretty printing. Could not figure out why it only works on normal functions (`va2`) and not in foreign ones (`va1`).
2023-10-30Clean up `rustc_*/Cargo.toml`.Nicholas Nethercote-2/+4
- Sort dependencies and features sections. - Add `tidy` markers to the sorted sections so they stay sorted. - Remove empty `[lib`] sections. - Remove "See more keys..." comments. Excluded files: - rustc_codegen_{cranelift,gcc}, because they're external. - rustc_lexer, because it has external use. - stable_mir, because it has external use.
2023-10-29Auto merge of #116447 - oli-obk:gen_fn, r=compiler-errorsbors-6/+76
Implement `gen` blocks in the 2024 edition Coroutines tracking issue https://github.com/rust-lang/rust/issues/43122 `gen` block tracking issue https://github.com/rust-lang/rust/issues/117078 This PR implements `gen` blocks that implement `Iterator`. Most of the logic with `async` blocks is shared, and thus I renamed various types that were referring to `async` specifically. An example usage of `gen` blocks is ```rust fn foo() -> impl Iterator<Item = i32> { gen { yield 42; for i in 5..18 { if i.is_even() { continue } yield i * 2; } } } ``` The limitations (to be resolved) of the implementation are listed in the tracking issue
2023-10-27Prevent generators from being movableOli Scherer-1/+1
2023-10-27Feature gate coroutine `yield` usageOli Scherer-2/+12
2023-10-27Add gen blocks to ast and do some broken ast loweringOli Scherer-1/+60
2023-10-26Auto merge of #117171 - fee1-dead-contrib:deny-explicit-effect-params, r=oli-obkbors-1/+7
Deny providing explicit effect params r? `@oli-obk` cc https://github.com/rust-lang/rust/issues/110395
2023-10-26Deny providing explicit effect paramsDeadbeef-1/+7
2023-10-26Add hir::GeneratorKind::GenOli Scherer-3/+4
2023-10-25Rename `AsyncCoroutineKind` to `CoroutineSource`Oli Scherer-4/+4
similar to how we have `MatchSource`, it explains where the desugaring came from.
2023-10-25Remove unnecessary CVarArgs name skipping logicDaniPopes-8/+1
2023-10-20Rename `CoroutineKind::Gen` to `::Coroutine`Oli Scherer-4/+4
2023-10-20s/generator/coroutine/Oli Scherer-29/+29
2023-10-20s/Generator/Coroutine/Oli Scherer-22/+22
2023-10-16docs: add Rust logo to more compiler cratesMichael Howell-0/+3
c6e6ecb1afea9695a42d0f148ce153536b279eb5 added it to some of the compiler's crates, but avoided adding it to all of them to reduce bit-rot. This commit adds to more.
2023-10-15Auto merge of #116688 - compiler-errors:rustfmt-up, r=WaffleLapkin,Nilstriebbors-14/+35
Format all the let-chains in compiler crates Since rust-lang/rustfmt#5910 has landed, soon we will have support for formatting let-chains (as soon as rustfmt syncs and beta gets bumped). This PR applies the changes [from master rustfmt to rust-lang/rust eagerly](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/out.20formatting.20of.20prs/near/374997516), so that the next beta bump does not have to deal with a 200+ file diff and can remain concerned with other things like `cfg(bootstrap)` -- #113637 was a pain to land, for example, because of let-else. I will also add this commit to the ignore list after it has landed. The commands that were run -- I'm not great at bash-foo, but this applies rustfmt to every compiler crate, and then reverts the two crates that should probably be formatted out-of-tree. ``` ~/rustfmt $ ls -1d ~/rust/compiler/* | xargs -I@ cargo run --bin rustfmt -- `@/src/lib.rs` --config-path ~/rust --edition=2021 # format all of the compiler crates ~/rust $ git checkout HEAD -- compiler/rustc_codegen_{gcc,cranelift} # revert changes to cg-gcc and cg-clif ``` cc `@rust-lang/rustfmt` r? `@WaffleLapkin` or `@Nilstrieb` who said they may be able to review this purely mechanical PR :> cc `@Mark-Simulacrum` and `@petrochenkov,` who had some thoughts on the order of operations with big formatting changes in https://github.com/rust-lang/rust/pull/95262#issue-1178993801. I think the situation has changed since then, given that let-chains support exists on master rustfmt now, and I'm fairly confident that this formatting PR should land even if *bootstrap* rustfmt doesn't yet format let-chains in order to lessen the burden of the next beta bump.
2023-10-13Deprecate E0706Michael Goulet-30/+2
2023-10-13Stabilize AFIT and RPITITMichael Goulet-53/+17
2023-10-13Format all the let chains in compilerMichael Goulet-14/+35
2023-10-11Rollup merge of #116627 - fee1-dead-contrib:cleanup, r=spastorinoMatthias Krüger-6/+4
small cleanup this is exactly the same as the `lower_param_bounds` function, so use that instead
2023-10-11small cleanupDeadbeef-6/+4
2023-10-05Rollup merge of #116431 - estebank:issue-80476, r=compiler-errorsJubilee-1/+1
Tweak wording of E0562 Fix #80476.
2023-10-04Auto merge of #116370 - nnethercote:more-arena-stuff, r=cjgillotbors-29/+18
Remove the `TypedArena::alloc_from_iter` specialization. It was added in #78569. It's complicated and doesn't actually help performance. r? `@cjgillot`
2023-10-04Tweak wording of E0562Esteban Küber-1/+1
Fix #80476.
2023-10-03Optimize some `alloc_from_iter` call sites.Nicholas Nethercote-29/+18
There's no need to collect an iterator into a `Vec`, or to call `into_iter` at the call sites.
2023-10-03Point to full async fn for futureMichael Goulet-2/+3
2023-09-26subst -> instantiatelcnr-1/+1
2023-09-21Record asyncness span in HIRMichael Goulet-1/+1
2023-09-19Auto merge of #113955 - cjgillot:name-apit, r=WaffleLapkinbors-6/+6
Pretty-print argument-position impl trait to name it. This removes a corner case. RPIT and TAIT keep having no name, and it would be wrong to use the one in HIR (Ident::empty), so I make this case ICE.
2023-09-14Auto merge of #115677 - matthewjasper:let-expr-recovery, r=b-naberbors-2/+4
Improve invalid let expression handling - Move all of the checks for valid let expression positions to parsing. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress some later errors and MIR construction for invalid let expressions. - Fix a (drop) scope issue that was also responsible for #104172. Fixes #104172 Fixes #104868
2023-09-12cleanup on messagesyukang-4/+0
2023-09-11Move let expression checking to parsingMatthew Jasper-2/+4
There was an incomplete version of the check in parsing and a second version in AST validation. This meant that some, but not all, invalid uses were allowed inside macros/disabled cfgs. It also means that later passes have a hard time knowing when the let expression is in a valid location, sometimes causing ICEs. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress later errors and MIR construction for invalid let expressions.
2023-09-07Enable incremental-relative-spans by default.Camille GILLOT-1/+1
2023-09-02Don't hold the definitions' lock across `index_hir`John Kåre Alsaker-17/+16
2023-08-30Pretty-print impl trait to name it.Camille GILLOT-6/+6
2023-08-30Capture lifetimes for associated type bounds destined to be lowered to opaquesMichael Goulet-0/+11
2023-08-28RPITITs capture all their lifetimesMichael Goulet-22/+31
2023-08-24Auto merge of #115131 - frank-king:feature/unnamed-fields-lite, r=petrochenkovbors-0/+12
Parse unnamed fields and anonymous structs or unions (no-recovery) It is part of #114782 which implements #49804. Only parse anonymous structs or unions in struct field definition positions. r? `@petrochenkov`
2023-08-24Parse unnamed fields and anonymous structs or unionsFrank King-0/+12
Anonymous structs or unions are only allowed in struct field definitions. Co-authored-by: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com>
2023-08-14Move scrutinee `HirId` into `MatchSource::TryDesugar`Esteban Küber-1/+1
2023-08-14Remove constness from `ImplSource::Param`Deadbeef-27/+23