summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/expr.rs
AgeCommit message (Collapse)AuthorLines
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-1/+2
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-4/+4
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-26Add hir::GeneratorKind::GenOli Scherer-3/+4
2023-10-25Rename `AsyncCoroutineKind` to `CoroutineSource`Oli Scherer-3/+3
similar to how we have `MatchSource`, it explains where the desugaring came from.
2023-10-20Rename `CoroutineKind::Gen` to `::Coroutine`Oli Scherer-4/+4
2023-10-20s/generator/coroutine/Oli Scherer-16/+16
2023-10-20s/Generator/Coroutine/Oli Scherer-18/+18
2023-10-13Format all the let chains in compilerMichael Goulet-5/+15
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-08-14Move scrutinee `HirId` into `MatchSource::TryDesugar`Esteban Küber-1/+1
2023-08-08Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obkbors-0/+6
correctly lower `impl const` to bind to host effect param r? `@oli-obk`
2023-08-06lower impl const to bind to host effect paramDeadbeef-0/+6
2023-08-04Auto merge of #112117 - bryangarza:track-caller-feature-gate, r=compiler-errorsbors-2/+2
Add separate feature gate for async fn track caller This patch adds a feature gate `async_fn_track_caller` that is separate from `closure_track_caller`. This is to allow enabling `async_fn_track_caller` separately. Fixes #110009
2023-08-04Improve spans for indexing expressionsNilstrieb-2/+2
Indexing is similar to method calls in having an arbitrary left-hand-side and then something on the right, which is the main part of the expression. Method calls already have a span for that right part, but indexing does not. This means that long method chains that use indexing have really bad spans, especially when the indexing panics and that span in coverted into a panic location. This does the same thing as method calls for the AST and HIR, storing an extra span which is then put into the `fn_span` field in THIR.
2023-08-02Add separate feature gate for async fn track callerBryan Garza-2/+2
This patch adds a feature gate `async_fn_track_caller` that is separate from `closure_track_caller`. This is to allow enabling `async_fn_track_caller` separately. Fixes #110009
2023-07-23more clippy::style fixes:Matthias Krüger-1/+1
get_first single_char_add_str unnecessary_mut_passed manual_map manual_is_ascii_check
2023-07-04Add effects during lowering for `~const` boundsDeadbeef-8/+1
2023-06-26`hir`: Add `Become` expression kindMaybe Waffle-3/+1
2023-06-19Syntatically accept `become` expressionsMaybe Waffle-0/+6
2023-06-02Separate AnonConst from ConstBlock in HIR.Camille GILLOT-3/+7
2023-04-27Make async removal span more resilient to macro expansionsMichael Goulet-10/+2
2023-04-27Tweak await spanMichael Goulet-14/+8
2023-04-26IntoFuture::into_future is no longer unstableMichael Goulet-6/+1
2023-04-21offset_ofDrMeepster-0/+7
2023-04-16Alloc `hir::Lit` in an arena to remove the destructor from `Expr`Nilstrieb-30/+25
This allows allocating `Expr`s into a dropless arena, which is useful for using length prefixed thing slices in HIR, since these can only be allocated in the dropless arena and not in a typed arena. This is something I'm working on.
2023-04-10Fix typos in compilerDaniPopes-3/+3
2023-03-19Remove the `NodeId` of `ast::ExprKind::Async`Arpad Borsos-40/+37
2023-03-14Auto merge of #104833 - Swatinem:async-identity-future, r=compiler-errorsbors-37/+27
Remove `identity_future` indirection This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm. Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]`annotation. Fixes https://github.com/rust-lang/rust/issues/104826.
2023-03-12Remove `box_syntax` from AST and use in toolsclubby789-1/+0
2023-03-08Remove `identity_future` indirectionArpad Borsos-37/+27
This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm. Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]` annotation.
2023-03-02Restrict `#[rustc_box]` to `Box::new` callsclubby789-10/+2
2023-02-25Add ErrorGuaranteed to HIR ExprKind::ErrMichael Goulet-8/+11
2023-02-21Use `ThinVec` in `ast::AngleBracketedArgs`.Nicholas Nethercote-1/+1
2023-02-21Use `ThinVec` in various AST types.Nicholas Nethercote-2/+2
This commit changes the sequence parsers to produce `ThinVec`, which triggers numerous conversions.
2023-02-14Better label for illegal impl trait typesMichael Goulet-2/+2
2023-01-26Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obkbors-6/+82
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-12parse const closuresDeadbeef-0/+6
2023-01-12Expand format_args!() in rust_ast_lowering.Mara Bos-0/+1
2023-01-11Expose some LoweringContext methods.Mara Bos-5/+9
2023-01-11Add some helper functions to LoweringContext.Mara Bos-1/+72
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-2/+2
2022-12-21Update track_caller tests; run fmtBryan Garza-5/+2
2022-12-21Improve code based on feedback.Bryan Garza-22/+20
This patch improves the readability of some of the code by using if-let-chains. Also, make use of the `add_feature_diagnostics` function.
2022-12-21Update track_caller logic/lint after rebaseBryan Garza-26/+27
2022-12-19Revert "Replace usage of `ResumeTy` in async lowering with `Context`"Andrew Pollack-36/+21
2022-12-13Rollup merge of #105464 - nbdd0121:hir, r=compiler-errorsMatthias Krüger-37/+48
Support #[track_caller] on async closures Follow up on #105180 r? ```@compiler-errors``` cc ```@cjgillot```
2022-12-12Auto merge of #105160 - nnethercote:rm-Lit-token_lit, r=petrochenkovbors-1/+1
Remove `token::Lit` from `ast::MetaItemLit`. Currently `ast::MetaItemLit` represents the literal kind twice. This PR removes that redundancy. Best reviewed one commit at a time. r? `@petrochenkov`