-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Closed
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`F-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`requires-incomplete-featuresThis issue requires the use of incomplete features.This issue requires the use of incomplete features.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
#![feature(const_trait_impl, generic_const_exprs)]
#[const_trait]
pub trait Tr {
fn a() -> usize;
}
impl Tr for () {
fn a() -> usize {
1
}
}
const fn foo<T: ~const Tr>() -> [u8; T::a()] {
[0; T::a()]
}
fn huh() {
foo::<()>();
}
If we remove the huh
definition, it compiles. This fix would involve treating caller bounds differently and would probably come with the addition of "always const
" bounds.
This is an interaction with generic_const_exprs
and const_trait_impl
, but does not block the stabilization of generic_const_exprs
as this is only allowed if someone enables the feature const_trait_impl
.
workingjubilee and lilasta
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]``#![feature(const_trait_impl)]`F-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`requires-incomplete-featuresThis issue requires the use of incomplete features.This issue requires the use of incomplete features.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.