@@ -9,10 +9,9 @@ use syntax::ast::{MetaItem, NestedMetaItem};
9
9
use syntax:: attr;
10
10
use syntax:: symbol:: { Symbol , kw, sym} ;
11
11
use syntax_pos:: Span ;
12
- use syntax_pos:: symbol:: LocalInternedString ;
13
12
14
13
#[ derive( Clone , Debug ) ]
15
- pub struct OnUnimplementedFormatString ( LocalInternedString ) ;
14
+ pub struct OnUnimplementedFormatString ( Symbol ) ;
16
15
17
16
#[ derive( Debug ) ]
18
17
pub struct OnUnimplementedDirective {
@@ -89,19 +88,19 @@ impl<'tcx> OnUnimplementedDirective {
89
88
if item. check_name ( sym:: message) && message. is_none ( ) {
90
89
if let Some ( message_) = item. value_str ( ) {
91
90
message = Some ( OnUnimplementedFormatString :: try_parse (
92
- tcx, trait_def_id, message_. as_str ( ) , span) ?) ;
91
+ tcx, trait_def_id, message_, span) ?) ;
93
92
continue ;
94
93
}
95
94
} else if item. check_name ( sym:: label) && label. is_none ( ) {
96
95
if let Some ( label_) = item. value_str ( ) {
97
96
label = Some ( OnUnimplementedFormatString :: try_parse (
98
- tcx, trait_def_id, label_. as_str ( ) , span) ?) ;
97
+ tcx, trait_def_id, label_, span) ?) ;
99
98
continue ;
100
99
}
101
100
} else if item. check_name ( sym:: note) && note. is_none ( ) {
102
101
if let Some ( note_) = item. value_str ( ) {
103
102
note = Some ( OnUnimplementedFormatString :: try_parse (
104
- tcx, trait_def_id, note_. as_str ( ) , span) ?) ;
103
+ tcx, trait_def_id, note_, span) ?) ;
105
104
continue ;
106
105
}
107
106
} else if item. check_name ( sym:: on) && is_root &&
@@ -154,7 +153,7 @@ impl<'tcx> OnUnimplementedDirective {
154
153
message : None ,
155
154
subcommands : vec ! [ ] ,
156
155
label : Some ( OnUnimplementedFormatString :: try_parse (
157
- tcx, trait_def_id, value. as_str ( ) , attr. span ) ?) ,
156
+ tcx, trait_def_id, value, attr. span ) ?) ,
158
157
note : None ,
159
158
} ) )
160
159
} else {
@@ -218,7 +217,7 @@ impl<'tcx> OnUnimplementedFormatString {
218
217
fn try_parse (
219
218
tcx : TyCtxt < ' tcx > ,
220
219
trait_def_id : DefId ,
221
- from : LocalInternedString ,
220
+ from : Symbol ,
222
221
err_sp : Span ,
223
222
) -> Result < Self , ErrorReported > {
224
223
let result = OnUnimplementedFormatString ( from) ;
@@ -234,7 +233,8 @@ impl<'tcx> OnUnimplementedFormatString {
234
233
) -> Result < ( ) , ErrorReported > {
235
234
let name = tcx. item_name ( trait_def_id) ;
236
235
let generics = tcx. generics_of ( trait_def_id) ;
237
- let parser = Parser :: new ( & self . 0 , None , vec ! [ ] , false ) ;
236
+ let s = self . 0 . as_str ( ) ;
237
+ let parser = Parser :: new ( & s, None , vec ! [ ] , false ) ;
238
238
let mut result = Ok ( ( ) ) ;
239
239
for token in parser {
240
240
match token {
@@ -294,7 +294,8 @@ impl<'tcx> OnUnimplementedFormatString {
294
294
} ) . collect :: < FxHashMap < Symbol , String > > ( ) ;
295
295
let empty_string = String :: new ( ) ;
296
296
297
- let parser = Parser :: new ( & self . 0 , None , vec ! [ ] , false ) ;
297
+ let s = self . 0 . as_str ( ) ;
298
+ let parser = Parser :: new ( & s, None , vec ! [ ] , false ) ;
298
299
parser. map ( |p|
299
300
match p {
300
301
Piece :: String ( s) => s,
0 commit comments