File tree Expand file tree Collapse file tree 4 files changed +86
-0
lines changed
src/test/ui/const-generics/generic_const_exprs Expand file tree Collapse file tree 4 files changed +86
-0
lines changed Original file line number Diff line number Diff line change 1+ // check-pass
2+
3+ #![ feature( adt_const_params, generic_const_exprs) ]
4+ //~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
5+ //~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
6+
7+ pub struct Changes < const CHANGES : & ' static [ & ' static str ] >
8+ where
9+ [ ( ) ; CHANGES . len ( ) ] : ,
10+ {
11+ changes : [ usize ; CHANGES . len ( ) ] ,
12+ }
13+
14+ impl < const CHANGES : & ' static [ & ' static str ] > Changes < CHANGES >
15+ where
16+ [ ( ) ; CHANGES . len ( ) ] : ,
17+ {
18+ pub const fn new ( ) -> Self {
19+ Self {
20+ changes : [ 0 ; CHANGES . len ( ) ] ,
21+ }
22+ }
23+ }
24+
25+ pub fn main ( ) { }
Original file line number Diff line number Diff line change 1+ warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
2+ --> $DIR/issue-97047-ice-1.rs:3:12
3+ |
4+ LL | #![feature(adt_const_params, generic_const_exprs)]
5+ | ^^^^^^^^^^^^^^^^
6+ |
7+ = note: `#[warn(incomplete_features)]` on by default
8+ = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
9+
10+ warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
11+ --> $DIR/issue-97047-ice-1.rs:3:30
12+ |
13+ LL | #![feature(adt_const_params, generic_const_exprs)]
14+ | ^^^^^^^^^^^^^^^^^^^
15+ |
16+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
17+
18+ warning: 2 warnings emitted
19+
Original file line number Diff line number Diff line change 1+ // check-pass
2+
3+ #![ feature( adt_const_params, generic_const_exprs) ]
4+ //~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
5+ //~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
6+
7+ pub struct Changes < const CHANGES : & ' static [ & ' static str ] >
8+ where
9+ [ ( ) ; CHANGES . len ( ) ] : ,
10+ {
11+ changes : [ usize ; CHANGES . len ( ) ] ,
12+ }
13+
14+ impl < const CHANGES : & ' static [ & ' static str ] > Changes < CHANGES >
15+ where
16+ [ ( ) ; CHANGES . len ( ) ] : ,
17+ {
18+ pub fn combine ( & mut self , other : & Self ) {
19+ for _change in & self . changes { }
20+ }
21+ }
22+
23+ pub fn main ( ) { }
Original file line number Diff line number Diff line change 1+ warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
2+ --> $DIR/issue-97047-ice-2.rs:3:12
3+ |
4+ LL | #![feature(adt_const_params, generic_const_exprs)]
5+ | ^^^^^^^^^^^^^^^^
6+ |
7+ = note: `#[warn(incomplete_features)]` on by default
8+ = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
9+
10+ warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
11+ --> $DIR/issue-97047-ice-2.rs:3:30
12+ |
13+ LL | #![feature(adt_const_params, generic_const_exprs)]
14+ | ^^^^^^^^^^^^^^^^^^^
15+ |
16+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
17+
18+ warning: 2 warnings emitted
19+
You can’t perform that action at this time.
0 commit comments