Skip to content

Commit c0839ea

Browse files
committed
Add feature gate test
1 parent e935a15 commit c0839ea

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ edition: 2021
2+
3+
#[derive(From)] //~ ERROR use of unstable library feature `derive_from`
4+
struct Foo(u32);
5+
6+
fn main() {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0658]: use of unstable library feature `derive_from`
2+
--> $DIR/feature-gate-derive-from.rs:3:10
3+
|
4+
LL | #[derive(From)]
5+
| ^^^^
6+
|
7+
= note: see issue #144889 <https://github.com/rust-lang/rust/issues/144889> for more information
8+
= help: add `#![feature(derive_from)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error: aborting due to 1 previous error
12+
13+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)