Skip to content

Commit 5676879

Browse files
committed
Fix stuff
1 parent 308a970 commit 5676879

4 files changed

Lines changed: 13 additions & 35 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()?))

tests/ui/const-generics/associated-const-bindings/dyn-compat-self-const-projections-in-assoc-const-ty.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@
44
// to the rest of the compiler and by extension the user via diagnostics.
55
//@ known-bug: unknown
66

7-
#![feature(adt_const_params, min_generic_const_args, unsized_const_params, generic_const_parameter_types)]
7+
#![feature(
8+
adt_const_params,
9+
min_generic_const_args,
10+
unsized_const_params,
11+
generic_const_parameter_types
12+
)]
813
#![expect(incomplete_features)]
914

1015
trait A {
1116
type Ty: std::marker::ConstParamTy_;
12-
#[type_const] const CT: Self::Ty;
17+
#[type_const]
18+
const CT: Self::Ty;
1319
}
1420

1521
impl A for () {
1622
type Ty = i32;
17-
#[type_const] const CT: i32 = 0;
23+
#[type_const]
24+
const CT: i32 = 0;
1825
}
1926

2027
fn main() {

tests/ui/const-generics/ogca/coherence-ambiguous.stderr

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)