Skip to content

Commit

Permalink
Make min_const_fn impl Trait test into a gate test
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Oct 6, 2020
1 parent 2e412fc commit af03b11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/test/ui/consts/min_const_fn/min_const_fn_impl_trait.rs
@@ -1,3 +1,5 @@
// gate-test-const_fn_impl_trait

struct AlanTuring<T>(T);
const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { //~ `impl Trait`
AlanTuring(0)
Expand Down
@@ -1,5 +1,5 @@
error[E0658]: `impl Trait` is not allowed in constant functions
--> $DIR/min_const_fn_impl_trait.rs:2:24
--> $DIR/min_const_fn_impl_trait.rs:4:24
|
LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -8,7 +8,7 @@ LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> {
= help: add `#![feature(const_fn_impl_trait)]` to the crate attributes to enable

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

0 comments on commit af03b11

Please sign in to comment.