Skip to content

Commit af03b11

Browse files
Make min_const_fn impl Trait test into a gate test
1 parent 2e412fc commit af03b11

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/test/ui/consts/min_const_fn/min_const_fn_impl_trait.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// gate-test-const_fn_impl_trait
2+
13
struct AlanTuring<T>(T);
24
const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { //~ `impl Trait`
35
AlanTuring(0)

src/test/ui/consts/min_const_fn/min_const_fn_impl_trait.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: `impl Trait` is not allowed in constant functions
2-
--> $DIR/min_const_fn_impl_trait.rs:2:24
2+
--> $DIR/min_const_fn_impl_trait.rs:4:24
33
|
44
LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> {
88
= help: add `#![feature(const_fn_impl_trait)]` to the crate attributes to enable
99

1010
error[E0658]: `impl Trait` is not allowed in constant functions
11-
--> $DIR/min_const_fn_impl_trait.rs:6:23
11+
--> $DIR/min_const_fn_impl_trait.rs:8:23
1212
|
1313
LL | const fn no_rpit() -> impl std::fmt::Debug {}
1414
| ^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)