diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2022-03-25 23:43:54 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2022-04-30 17:40:27 -0700 |
| commit | e094ee5f102dfea8e99137d3818510cd178e8817 (patch) | |
| tree | 1355dfd0fa0c410199d17a4ea5f8889703a661db /compiler/rustc_span/src | |
| parent | 2c858a7c3f189eb11ad89d9bf9f2e87cac9d2b76 (diff) | |
| download | rust-e094ee5f102dfea8e99137d3818510cd178e8817.tar.gz rust-e094ee5f102dfea8e99137d3818510cd178e8817.zip | |
Add `do yeet` expressions to allow experimentation in nightly
Using an obviously-placeholder syntax. An RFC would still be needed before this could have any chance at stabilization, and it might be removed at any point. But I'd really like to have it in nightly at least to ensure it works well with try_trait_v2, especially as we refactor the traits.
Diffstat (limited to 'compiler/rustc_span/src')
| -rw-r--r-- | compiler/rustc_span/src/hygiene.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/hygiene.rs b/compiler/rustc_span/src/hygiene.rs index 3889639b50f..447b73fa3c3 100644 --- a/compiler/rustc_span/src/hygiene.rs +++ b/compiler/rustc_span/src/hygiene.rs @@ -1132,6 +1132,7 @@ pub enum DesugaringKind { CondTemporary, QuestionMark, TryBlock, + YeetExpr, /// Desugaring of an `impl Trait` in return type position /// to an `type Foo = impl Trait;` and replacing the /// `impl Trait` with `Foo`. @@ -1152,6 +1153,7 @@ impl DesugaringKind { DesugaringKind::Await => "`await` expression", DesugaringKind::QuestionMark => "operator `?`", DesugaringKind::TryBlock => "`try` block", + DesugaringKind::YeetExpr => "`do yeet` expression", DesugaringKind::OpaqueTy => "`impl Trait`", DesugaringKind::ForLoop => "`for` loop", DesugaringKind::LetElse => "`let...else`", diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index e3ce8105a8b..c1299c94c4b 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -101,6 +101,7 @@ symbols! { MacroRules: "macro_rules", Raw: "raw", Union: "union", + Yeet: "yeet", } // Pre-interned symbols that can be referred to with `rustc_span::sym::*`. @@ -714,6 +715,7 @@ symbols! { from_residual, from_size_align_unchecked, from_usize, + from_yeet, fsub_fast, fundamental, future, @@ -1534,6 +1536,8 @@ symbols! { x87_reg, xer, xmm_reg, + yeet_desugar_details, + yeet_expr, ymm_reg, zmm_reg, } |
