File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
tests/ui/type-alias-impl-trait Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #![ allow( incomplete_features) ]
2+ #![ feature( const_trait_impl) ]
3+ #![ feature( const_closures) ]
4+ #![ feature( const_refs_to_cell) ]
5+ #![ feature( type_alias_impl_trait) ]
6+
7+ pub type Diff = impl ~const std:: marker:: Destruct + ~const Fn ( usize ) -> usize ;
8+ //~^ ERROR: ~const can only be applied to `#[const_trait]` traits
9+
10+ pub const fn lift ( n : usize ) -> Diff {
11+ const move |m : usize | m + n
12+ }
13+
14+ pub const fn reify ( n : Diff ) -> usize {
15+ n ( 0 )
16+ }
17+
18+ pub const fn add (
19+ n : Diff ,
20+ m : Diff ,
21+ ) -> Diff {
22+ const move |x : usize | m ( n ( x) )
23+ }
24+
25+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error: ~const can only be applied to `#[const_trait]` traits
2+ --> $DIR/issue-113326.rs:7:60
3+ |
4+ LL | pub type Diff = impl ~const std::marker::Destruct + ~const Fn(usize) -> usize;
5+ | ^^^^^^^^^^^^^^^^^^
6+
7+ error: aborting due to previous error
8+
You can’t perform that action at this time.
0 commit comments