File tree Expand file tree Collapse file tree 3 files changed +30
-56
lines changed Expand file tree Collapse file tree 3 files changed +30
-56
lines changed Original file line number Diff line number Diff line change
1
+ //! This file showcases a few error messages emitted by `auto_impl`. You have
2
+ //! to add specific lines to see the error. Then simply compile with:
3
+ //!
4
+ //! ```
5
+ //! cargo build --example error_messages
6
+ //! ```
7
+ //!
8
+ //! If you want to see nicer error messages, add `--features=nightly`.
9
+ #![ allow( unused_imports, dead_code) ]
10
+
11
+ use auto_impl:: auto_impl;
12
+
13
+
14
+ // Shows the error message for the case that `#[auto_impl]` was used with
15
+ // incorrect proxy types. Only proxy types like `&` and `Box` are allowed. Add
16
+ // this next line to see the error!
17
+ //#[auto_impl(Boxxi)]
18
+ trait Foo {
19
+ fn foo ( & self ) -> u32 ;
20
+ }
21
+
22
+ // Shows the error message for the case the `#[auto_impl]` wasn't applied to a
23
+ // valid trait (in this case a struct). Add this next line to see the error!
24
+ //#[auto_impl(&, Box)]
25
+ struct Bar {
26
+ x : u32 ,
27
+ }
28
+
29
+
30
+ fn main ( ) { }
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments