diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2025-08-04 17:32:22 +0200 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2025-08-15 12:06:20 +0200 |
| commit | c0839ea7d242f077cec567af1e4489951efb6570 (patch) | |
| tree | e95938969d3f6ec31004674a7736b0f8c88af106 | |
| parent | e935a155c2078185f0705bb972a38953e770e393 (diff) | |
| download | rust-c0839ea7d242f077cec567af1e4489951efb6570.tar.gz rust-c0839ea7d242f077cec567af1e4489951efb6570.zip | |
Add feature gate test
| -rw-r--r-- | tests/ui/feature-gates/feature-gate-derive-from.rs | 6 | ||||
| -rw-r--r-- | tests/ui/feature-gates/feature-gate-derive-from.stderr | 13 |
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`. |
