about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-09-07 01:17:50 +0200
committerGitHub <noreply@github.com>2020-09-07 01:17:50 +0200
commit3d834bc0d36276d96e02c4eca5e6d58594d3806c (patch)
tree2d924d083e7db50801d3477437ae6a34dd889c41 /src/test
parent7ad2b3ab29446480e0409c87bdcd04f0b1ddaf8d (diff)
parent8f2d9069a8c19c5471c4f3490ce21eb910cf3074 (diff)
downloadrust-3d834bc0d36276d96e02c4eca5e6d58594d3806c.tar.gz
rust-3d834bc0d36276d96e02c4eca5e6d58594d3806c.zip
Rollup merge of #76293 - Amjad50:incompatible_features_error, r=lcnr
Implementation of incompatible features error

Proposal of a new error: Incompatible features

This error should happen if two features which are not compatible are used together.

For now the only incompatible features are `const_generics` and `min_const_generics`

fixes #76280
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/const-generics/min-and-full-same-time.rs7
-rw-r--r--src/test/ui/const-generics/min-and-full-same-time.stderr13
2 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/min-and-full-same-time.rs b/src/test/ui/const-generics/min-and-full-same-time.rs
new file mode 100644
index 00000000000..2365adc3a86
--- /dev/null
+++ b/src/test/ui/const-generics/min-and-full-same-time.rs
@@ -0,0 +1,7 @@
+#![feature(const_generics)]
+//~^ ERROR features `const_generics` and `min_const_generics` are incompatible
+#![allow(incomplete_features)]
+#![feature(min_const_generics)]
+
+
+fn main() {}
diff --git a/src/test/ui/const-generics/min-and-full-same-time.stderr b/src/test/ui/const-generics/min-and-full-same-time.stderr
new file mode 100644
index 00000000000..907fec9bbe1
--- /dev/null
+++ b/src/test/ui/const-generics/min-and-full-same-time.stderr
@@ -0,0 +1,13 @@
+error: features `const_generics` and `min_const_generics` are incompatible, using them at the same time is not allowed
+  --> $DIR/min-and-full-same-time.rs:1:12
+   |
+LL | #![feature(const_generics)]
+   |            ^^^^^^^^^^^^^^
+...
+LL | #![feature(min_const_generics)]
+   |            ^^^^^^^^^^^^^^^^^^
+   |
+   = help: remove one of these features
+
+error: aborting due to previous error
+