Skip to content

Commit 45e716e

Browse files
committed
test #[derive(FromPrimitive)] triggers custom-derive error
1 parent f6e22e5 commit 45e716e

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed
+4-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,27 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::num::FromPrimitive;
12-
use std::isize;
11+
#[derive(FromPrimitive)] //~ERROR `#[derive]` for custom traits is not stable
12+
enum Foo {}
1313

14-
#[derive(FromPrimitive)]
15-
struct A { x: isize }
16-
//~^^ ERROR `FromPrimitive` cannot be derived for structs
17-
//~^^^ ERROR `FromPrimitive` cannot be derived for structs
14+
fn main() {}
1815

19-
#[derive(FromPrimitive)]
20-
struct B(isize);
21-
//~^^ ERROR `FromPrimitive` cannot be derived for structs
22-
//~^^^ ERROR `FromPrimitive` cannot be derived for structs
23-
24-
#[derive(FromPrimitive)]
25-
enum C { Foo(isize), Bar(usize) }
26-
//~^^ ERROR `FromPrimitive` cannot be derived for enums with non-unit variants
27-
//~^^^ ERROR `FromPrimitive` cannot be derived for enums with non-unit variants
28-
29-
#[derive(FromPrimitive)]
30-
enum D { Baz { x: isize } }
31-
//~^^ ERROR `FromPrimitive` cannot be derived for enums with non-unit variants
32-
//~^^^ ERROR `FromPrimitive` cannot be derived for enums with non-unit variants
33-
34-
pub fn main() {}

0 commit comments

Comments
 (0)