about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorHameer Abbasi <einstein.edison@gmail.com>2020-11-04 15:32:18 +0000
committerHameer Abbasi <einstein.edison@gmail.com>2020-11-04 16:04:32 +0000
commita70e0c20c356d99f04a8e05acc402a4148615a38 (patch)
tree8b26f527d669fa9704497ae183928daef563c25c /src/test/ui
parent601c13c6fda6a7db423c974797e36c79a9a0c0ac (diff)
downloadrust-a70e0c20c356d99f04a8e05acc402a4148615a38.tar.gz
rust-a70e0c20c356d99f04a8e05acc402a4148615a38.zip
Fix issue 78654.
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/async-await/issues/issue-78654.full.stderr19
-rw-r--r--src/test/ui/async-await/issues/issue-78654.min.stderr19
-rw-r--r--src/test/ui/async-await/issues/issue-78654.rs16
3 files changed, 54 insertions, 0 deletions
diff --git a/src/test/ui/async-await/issues/issue-78654.full.stderr b/src/test/ui/async-await/issues/issue-78654.full.stderr
new file mode 100644
index 00000000000..ff0260523db
--- /dev/null
+++ b/src/test/ui/async-await/issues/issue-78654.full.stderr
@@ -0,0 +1,19 @@
+error[E0573]: expected type, found built-in attribute `feature`
+  --> $DIR/issue-78654.rs:10:15
+   |
+LL | impl<const H: feature> Foo {
+   |               ^^^^^^^ not a type
+
+error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates
+  --> $DIR/issue-78654.rs:10:12
+   |
+LL | impl<const H: feature> Foo {
+   |            ^ unconstrained const parameter
+   |
+   = note: expressions using a const parameter must map each value to a distinct output value
+   = note: proving the result of expressions other than the parameter are unique is not supported
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0207, E0573.
+For more information about an error, try `rustc --explain E0207`.
diff --git a/src/test/ui/async-await/issues/issue-78654.min.stderr b/src/test/ui/async-await/issues/issue-78654.min.stderr
new file mode 100644
index 00000000000..ff0260523db
--- /dev/null
+++ b/src/test/ui/async-await/issues/issue-78654.min.stderr
@@ -0,0 +1,19 @@
+error[E0573]: expected type, found built-in attribute `feature`
+  --> $DIR/issue-78654.rs:10:15
+   |
+LL | impl<const H: feature> Foo {
+   |               ^^^^^^^ not a type
+
+error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates
+  --> $DIR/issue-78654.rs:10:12
+   |
+LL | impl<const H: feature> Foo {
+   |            ^ unconstrained const parameter
+   |
+   = note: expressions using a const parameter must map each value to a distinct output value
+   = note: proving the result of expressions other than the parameter are unique is not supported
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0207, E0573.
+For more information about an error, try `rustc --explain E0207`.
diff --git a/src/test/ui/async-await/issues/issue-78654.rs b/src/test/ui/async-await/issues/issue-78654.rs
new file mode 100644
index 00000000000..b57ed35f8e3
--- /dev/null
+++ b/src/test/ui/async-await/issues/issue-78654.rs
@@ -0,0 +1,16 @@
+// edition:2018
+// revisions: full min
+
+#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, allow(incomplete_features))]
+#![cfg_attr(min, feature(min_const_generics))]
+
+struct Foo;
+
+impl<const H: feature> Foo {
+//~^ ERROR: expected type, found built-in attribute `feature`
+//~^^ ERROR: the const parameter `H` is not constrained by the impl trait, self type, or predicates
+    async fn biz() {}
+}
+
+fn main() {}