@@ -9,10 +9,9 @@ use syntax::ast::{MetaItem, NestedMetaItem};
99use syntax:: attr;
1010use syntax:: symbol:: { Symbol , kw, sym} ;
1111use syntax_pos:: Span ;
12- use syntax_pos:: symbol:: LocalInternedString ;
1312
1413#[ derive( Clone , Debug ) ]
15- pub struct OnUnimplementedFormatString ( LocalInternedString ) ;
14+ pub struct OnUnimplementedFormatString ( Symbol ) ;
1615
1716#[ derive( Debug ) ]
1817pub struct OnUnimplementedDirective {
@@ -89,19 +88,19 @@ impl<'tcx> OnUnimplementedDirective {
8988 if item. check_name ( sym:: message) && message. is_none ( ) {
9089 if let Some ( message_) = item. value_str ( ) {
9190 message = Some ( OnUnimplementedFormatString :: try_parse (
92- tcx, trait_def_id, message_. as_str ( ) , span) ?) ;
91+ tcx, trait_def_id, message_, span) ?) ;
9392 continue ;
9493 }
9594 } else if item. check_name ( sym:: label) && label. is_none ( ) {
9695 if let Some ( label_) = item. value_str ( ) {
9796 label = Some ( OnUnimplementedFormatString :: try_parse (
98- tcx, trait_def_id, label_. as_str ( ) , span) ?) ;
97+ tcx, trait_def_id, label_, span) ?) ;
9998 continue ;
10099 }
101100 } else if item. check_name ( sym:: note) && note. is_none ( ) {
102101 if let Some ( note_) = item. value_str ( ) {
103102 note = Some ( OnUnimplementedFormatString :: try_parse (
104- tcx, trait_def_id, note_. as_str ( ) , span) ?) ;
103+ tcx, trait_def_id, note_, span) ?) ;
105104 continue ;
106105 }
107106 } else if item. check_name ( sym:: on) && is_root &&
@@ -154,7 +153,7 @@ impl<'tcx> OnUnimplementedDirective {
154153 message : None ,
155154 subcommands : vec ! [ ] ,
156155 label : Some ( OnUnimplementedFormatString :: try_parse (
157- tcx, trait_def_id, value. as_str ( ) , attr. span ) ?) ,
156+ tcx, trait_def_id, value, attr. span ) ?) ,
158157 note : None ,
159158 } ) )
160159 } else {
@@ -218,7 +217,7 @@ impl<'tcx> OnUnimplementedFormatString {
218217 fn try_parse (
219218 tcx : TyCtxt < ' tcx > ,
220219 trait_def_id : DefId ,
221- from : LocalInternedString ,
220+ from : Symbol ,
222221 err_sp : Span ,
223222 ) -> Result < Self , ErrorReported > {
224223 let result = OnUnimplementedFormatString ( from) ;
@@ -234,7 +233,8 @@ impl<'tcx> OnUnimplementedFormatString {
234233 ) -> Result < ( ) , ErrorReported > {
235234 let name = tcx. item_name ( trait_def_id) ;
236235 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 ) ;
238238 let mut result = Ok ( ( ) ) ;
239239 for token in parser {
240240 match token {
@@ -294,7 +294,8 @@ impl<'tcx> OnUnimplementedFormatString {
294294 } ) . collect :: < FxHashMap < Symbol , String > > ( ) ;
295295 let empty_string = String :: new ( ) ;
296296
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 ) ;
298299 parser. map ( |p|
299300 match p {
300301 Piece :: String ( s) => s,
0 commit comments