Skip to content

Commit 37aaac8

Browse files
committed
Fix stuff
1 parent 308a970 commit 37aaac8

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

compiler/rustc_feature/src/unstable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,7 @@ declare_features! (
606606
/// Allows using fields with slice type in offset_of!
607607
(unstable, offset_of_slice, "1.81.0", Some(126151)),
608608
/// Allows using generics in more complex const expressions, based on definitional equality.
609-
// TODO: create tracking issue
610-
(unstable, opaque_generic_const_args, "CURRENT_RUSTC_VERSION", None),
609+
(unstable, opaque_generic_const_args, "CURRENT_RUSTC_VERSION", Some(151972)),
611610
/// Allows using `#[optimize(X)]`.
612611
(unstable, optimize_attribute, "1.34.0", Some(54882)),
613612
/// Allows specifying nop padding on functions for dynamic patching.

compiler/rustc_parse/src/parser/item.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,16 +1551,8 @@ impl<'a> Parser<'a> {
15511551

15521552
let rhs = if self.eat(exp!(Eq)) {
15531553
if attr::contains_name(attrs, sym::type_const) {
1554-
let ct = if self.eat_keyword(exp!(Const)) {
1555-
// While we could just disambiguate `Direct` from `AnonConst` by
1556-
// treating all const block exprs as `AnonConst`, that would
1557-
// complicate the DefCollector and likely all other visitors.
1558-
// So we strip the const blockiness and just store it as a block
1559-
// in the AST with the extra disambiguator on the AnonConst
1560-
self.parse_mgca_const_block(false)?
1561-
} else {
1562-
self.parse_expr_anon_const(|this, expr| this.mgca_direct_lit_hack(expr))?
1563-
};
1554+
let ct =
1555+
self.parse_expr_anon_const(|this, expr| this.mgca_direct_lit_hack(expr))?;
15641556
Some(ConstItemRhs::TypeConst(ct))
15651557
} else {
15661558
Some(ConstItemRhs::Body(self.parse_expr()?))

0 commit comments

Comments
 (0)