about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/feature-gates/feature-gate-derive-from.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-derive-from.stderr13
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/feature-gate-derive-from.rs b/tests/ui/feature-gates/feature-gate-derive-from.rs
new file mode 100644
index 00000000000..12440356ddf
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-derive-from.rs
@@ -0,0 +1,6 @@
+//@ edition: 2021
+
+#[derive(From)] //~ ERROR use of unstable library feature `derive_from`
+struct Foo(u32);
+
+fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-derive-from.stderr b/tests/ui/feature-gates/feature-gate-derive-from.stderr
new file mode 100644
index 00000000000..d58dcdd7541
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-derive-from.stderr
@@ -0,0 +1,13 @@
+error[E0658]: use of unstable library feature `derive_from`
+  --> $DIR/feature-gate-derive-from.rs:3:10
+   |
+LL | #[derive(From)]
+   |          ^^^^
+   |
+   = note: see issue #144889 <https://github.com/rust-lang/rust/issues/144889> for more information
+   = help: add `#![feature(derive_from)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0658`.