File tree 5 files changed +48
-3
lines changed
5 files changed +48
-3
lines changed Original file line number Diff line number Diff line change @@ -153,13 +153,13 @@ pub fn syntax_expander_table() -> SyntaxEnv {
153
153
ext:: deriving:: expand_meta_deriving) ) ) ;
154
154
syntax_expanders. insert ( @~"deriving_eq",
155
155
@SE ( ItemDecorator (
156
- ext:: deriving:: eq:: expand_deriving_eq ) ) ) ;
156
+ ext:: deriving:: eq:: expand_deriving_obsolete ) ) ) ;
157
157
syntax_expanders. insert ( @~"deriving_iter_bytes",
158
158
@SE ( ItemDecorator (
159
- ext:: deriving:: iter_bytes:: expand_deriving_iter_bytes ) ) ) ;
159
+ ext:: deriving:: iter_bytes:: expand_deriving_obsolete ) ) ) ;
160
160
syntax_expanders. insert ( @~"deriving_clone",
161
161
@SE ( ItemDecorator (
162
- ext:: deriving:: clone:: expand_deriving_clone ) ) ) ;
162
+ ext:: deriving:: clone:: expand_deriving_obsolete ) ) ) ;
163
163
164
164
// Quasi-quoting expanders
165
165
syntax_expanders. insert ( @~"quote_tokens",
Original file line number Diff line number Diff line change @@ -39,6 +39,15 @@ pub fn expand_deriving_clone(cx: @ext_ctxt,
39
39
expand_deriving_clone_enum_def )
40
40
}
41
41
42
+ pub fn expand_deriving_obsolete( cx : @ext_ctxt ,
43
+ span : span ,
44
+ _mitem : @meta_item ,
45
+ in_items: ~[ @item] )
46
+ -> ~[ @item] {
47
+ cx. span_err ( span , ~"`#[ deriving_clone] ` is obsolete; use `#[ deriving( Clone ) ] ` instead ") ;
48
+ in_items
49
+ }
50
+
42
51
fn create_derived_clone_impl ( cx : @ext_ctxt ,
43
52
span : span ,
44
53
type_ident : ident ,
Original file line number Diff line number Diff line change @@ -53,6 +53,15 @@ pub fn expand_deriving_eq(cx: @ext_ctxt,
53
53
expand_deriving_eq_enum_def )
54
54
}
55
55
56
+ pub fn expand_deriving_obsolete( cx : @ext_ctxt ,
57
+ span : span ,
58
+ _mitem : @meta_item ,
59
+ in_items: ~[ @item] )
60
+ -> ~[ @item] {
61
+ cx. span_err ( span , ~"`#[ deriving_eq] ` is obsolete; use `#[ deriving( Eq ) ] ` instead ") ;
62
+ in_items
63
+ }
64
+
56
65
/// Creates a method from the given expression, the signature of which
57
66
/// conforms to the `eq` or `ne` method.
58
67
fn create_eq_method ( cx: @ext_ctxt,
Original file line number Diff line number Diff line change @@ -39,6 +39,16 @@ pub fn expand_deriving_iter_bytes(cx: @ext_ctxt,
39
39
expand_deriving_iter_bytes_enum_def )
40
40
}
41
41
42
+ pub fn expand_deriving_obsolete( cx : @ext_ctxt ,
43
+ span : span ,
44
+ _mitem : @meta_item ,
45
+ in_items: ~[ @item] )
46
+ -> ~[ @item] {
47
+ cx. span_err ( span , ~"`#[ deriving_iter_bytes] ` is obsolete; use `#[ deriving( IterBytes ) ] ` \
48
+ instead ") ;
49
+ in_items
50
+ }
51
+
42
52
fn create_derived_iter_bytes_impl ( cx : @ext_ctxt ,
43
53
span : span ,
44
54
type_ident : ident ,
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #[ deriving_clone] //~ ERROR `#[deriving_clone]` is obsolete; use `#[deriving(Clone)]` instead
12
+ #[ deriving_eq] //~ ERROR `#[deriving_eq]` is obsolete; use `#[deriving(Eq)]` instead
13
+ #[ deriving_iter_bytes]
14
+ //~^ ERROR `#[deriving_iter_bytes]` is obsolete; use `#[deriving(IterBytes)]` instead
15
+ struct Foo ;
16
+
17
+ pub fn main ( ) { }
You can’t perform that action at this time.
0 commit comments