- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Open
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-associated_const_equality`#![feature(associated_const_equality)]``#![feature(associated_const_equality)]`F-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
For example, I expected the following code to succeed compilation:
#![feature(generic_const_exprs)]
#![feature(associated_const_equality)]
trait Trait {
    const C: usize;
}
fn f<T: Trait<C = 1>>()
where
    [(); T::C]:
{
    let _: [(); T::C] = [()];
}Since (I'm pretty sure that) the ParamEnv contains the projection predicate <T as Trait>::C == 1, the const projection <T as Trait>::C inside the function body should be able to get normalized to 1. That however doesn't seem to happen:
error[E0308]: mismatched types
  --> src/lib.rs:12:25
   |
12 |     let _: [(); T::C] = [()];
   |                         ^^^^ expected `T::C`, found `1`
   |
   = note: expected constant `T::C`
              found constant `1`
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-associated_const_equality`#![feature(associated_const_equality)]``#![feature(associated_const_equality)]`F-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Projects
Status
To Do