about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-04-07 13:07:14 +0200
committerGitHub <noreply@github.com>2021-04-07 13:07:14 +0200
commitb81c6cdb570957b5d6d4261b908f7e0364a67d81 (patch)
tree17747b2dc011502d4905a95c80e921c85fc5e05e /compiler/rustc_parse/src/parser
parent4d5bb1ca222143627674a0da99c5b3f7bd7be77d (diff)
parent32be124e306e537590cedcb56e6c16db7f9d8ce7 (diff)
downloadrust-b81c6cdb570957b5d6d4261b908f7e0364a67d81.tar.gz
rust-b81c6cdb570957b5d6d4261b908f7e0364a67d81.zip
Rollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkov
Use AnonConst for asm! constants

This replaces the old system which used explicit promotion. See #83169 for more background.

The syntax for `const` operands is still the same as before: `const <expr>`.

Fixes #83169

Because the implementation is heavily based on inline consts, we suffer from the same issues:
- We lose the ability to use expressions derived from generics. See the deleted tests in `src/test/ui/asm/const.rs`.
- We are hitting the same ICEs as inline consts, for example #78174. It is unlikely that we will be able to stabilize this before inline consts are stabilized.
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index fe190bfe9d9..02ee268b88c 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -107,7 +107,7 @@ impl<'a> Parser<'a> {
         }
     }
 
-    pub(super) fn parse_anon_const_expr(&mut self) -> PResult<'a, AnonConst> {
+    pub fn parse_anon_const_expr(&mut self) -> PResult<'a, AnonConst> {
         self.parse_expr().map(|value| AnonConst { id: DUMMY_NODE_ID, value })
     }