File tree 2 files changed +10
-11
lines changed
src/test/ui/consts/min_const_fn
2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change 1
1
struct AlanTuring < T > ( T ) ;
2
- const fn no_rpit2 ( ) -> AlanTuring < impl std:: fmt:: Debug > {
3
- //~^ ERROR `impl Trait` in const fn is unstable
2
+ const fn no_rpit2 ( ) -> AlanTuring < impl std:: fmt:: Debug > { //~ `impl Trait`
4
3
AlanTuring ( 0 )
5
4
}
6
5
7
- const fn no_rpit ( ) -> impl std:: fmt:: Debug { } //~ ERROR `impl Trait` in const fn is unstable
6
+ const fn no_rpit ( ) -> impl std:: fmt:: Debug { } //~ `impl Trait`
8
7
9
8
fn main ( ) { }
Original file line number Diff line number Diff line change 1
- error[E0723 ]: `impl Trait` in const fn is unstable
1
+ error[E0658 ]: `impl Trait` is not allowed in constant functions
2
2
--> $DIR/min_const_fn_impl_trait.rs:2:24
3
3
|
4
4
LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> {
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
|
7
- = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563 > for more information
8
- = help: add `#![feature(const_fn )]` to the crate attributes to enable
7
+ = note: see issue #77463 <https://github.com/rust-lang/rust/issues/77463 > for more information
8
+ = help: add `#![feature(const_fn_impl_trait )]` to the crate attributes to enable
9
9
10
- error[E0723 ]: `impl Trait` in const fn is unstable
11
- --> $DIR/min_const_fn_impl_trait.rs:7 :23
10
+ error[E0658 ]: `impl Trait` is not allowed in constant functions
11
+ --> $DIR/min_const_fn_impl_trait.rs:6 :23
12
12
|
13
13
LL | const fn no_rpit() -> impl std::fmt::Debug {}
14
14
| ^^^^^^^^^^^^^^^^^^^^
15
15
|
16
- = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563 > for more information
17
- = help: add `#![feature(const_fn )]` to the crate attributes to enable
16
+ = note: see issue #77463 <https://github.com/rust-lang/rust/issues/77463 > for more information
17
+ = help: add `#![feature(const_fn_impl_trait )]` to the crate attributes to enable
18
18
19
19
error: aborting due to 2 previous errors
20
20
21
- For more information about this error, try `rustc --explain E0723 `.
21
+ For more information about this error, try `rustc --explain E0658 `.
You can’t perform that action at this time.
0 commit comments