-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Erase regions in new abstract consts
- Loading branch information
1 parent
e02d645
commit 1e40200
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// check-pass | ||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
struct Num<const N: usize>; | ||
|
||
trait NumT { | ||
const VALUE: usize; | ||
} | ||
|
||
impl<const N: usize> NumT for Num<N> { | ||
const VALUE: usize = N; | ||
} | ||
|
||
struct Foo<'a, N: NumT>(&'a [u32; N::VALUE]) where [(); N::VALUE]:; | ||
|
||
trait Bar { | ||
type Size: NumT; | ||
|
||
fn bar<'a>(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: { | ||
todo!(); | ||
} | ||
} | ||
|
||
trait Baz<'a> { | ||
type Size: NumT; | ||
|
||
fn baz(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: { | ||
todo!(); | ||
} | ||
} | ||
|
||
fn main() {} |