55use arena:: DroplessArena ;
66use rustc_data_structures:: fx:: FxHashMap ;
77use rustc_data_structures:: indexed_vec:: Idx ;
8+ use rustc_data_structures:: newtype_index;
89use serialize:: { Decodable , Decoder , Encodable , Encoder } ;
910
1011use std:: fmt;
1112use std:: str;
1213use std:: cmp:: { PartialEq , Ordering , PartialOrd , Ord } ;
1314use std:: hash:: { Hash , Hasher } ;
1415
15- use hygiene:: SyntaxContext ;
16- use { Span , DUMMY_SP , GLOBALS } ;
16+ use crate :: hygiene:: SyntaxContext ;
17+ use crate :: { Span , DUMMY_SP , GLOBALS } ;
1718
1819#[ derive( Copy , Clone , Eq ) ]
1920pub struct Ident {
@@ -100,13 +101,13 @@ impl Hash for Ident {
100101}
101102
102103impl fmt:: Debug for Ident {
103- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
104+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
104105 write ! ( f, "{}{:?}" , self . name, self . span. ctxt( ) )
105106 }
106107}
107108
108109impl fmt:: Display for Ident {
109- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
110+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
110111 fmt:: Display :: fmt ( & self . name , f)
111112 }
112113}
@@ -181,7 +182,7 @@ impl Symbol {
181182 pub fn as_str ( self ) -> LocalInternedString {
182183 with_interner ( |interner| unsafe {
183184 LocalInternedString {
184- string : :: std:: mem:: transmute :: < & str , & str > ( interner. get ( self ) )
185+ string : std:: mem:: transmute :: < & str , & str > ( interner. get ( self ) )
185186 }
186187 } )
187188 }
@@ -198,7 +199,7 @@ impl Symbol {
198199}
199200
200201impl fmt:: Debug for Symbol {
201- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
202+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
202203 let is_gensymed = with_interner ( |interner| interner. is_gensymed ( * self ) ) ;
203204 if is_gensymed {
204205 write ! ( f, "{}({:?})" , self , self . 0 )
@@ -209,7 +210,7 @@ impl fmt::Debug for Symbol {
209210}
210211
211212impl fmt:: Display for Symbol {
212- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
213+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
213214 fmt:: Display :: fmt ( & self . as_str ( ) , f)
214215 }
215216}
@@ -226,7 +227,7 @@ impl Decodable for Symbol {
226227 }
227228}
228229
229- impl < T : :: std:: ops:: Deref < Target =str > > PartialEq < T > for Symbol {
230+ impl < T : std:: ops:: Deref < Target =str > > PartialEq < T > for Symbol {
230231 fn eq ( & self , other : & T ) -> bool {
231232 self . as_str ( ) == other. deref ( )
232233 }
@@ -335,7 +336,7 @@ macro_rules! declare_keywords {(
335336 } ;
336337 ) *
337338
338- impl :: std:: str :: FromStr for Keyword {
339+ impl std:: str :: FromStr for Keyword {
339340 type Err = ( ) ;
340341
341342 fn from_str( s: & str ) -> Result <Self , ( ) > {
@@ -519,40 +520,40 @@ impl LocalInternedString {
519520 }
520521}
521522
522- impl < U : ?Sized > :: std:: convert:: AsRef < U > for LocalInternedString
523+ impl < U : ?Sized > std:: convert:: AsRef < U > for LocalInternedString
523524where
524- str : :: std:: convert:: AsRef < U >
525+ str : std:: convert:: AsRef < U >
525526{
526527 fn as_ref ( & self ) -> & U {
527528 self . string . as_ref ( )
528529 }
529530}
530531
531- impl < T : :: std:: ops:: Deref < Target = str > > :: std:: cmp:: PartialEq < T > for LocalInternedString {
532+ impl < T : std:: ops:: Deref < Target = str > > std:: cmp:: PartialEq < T > for LocalInternedString {
532533 fn eq ( & self , other : & T ) -> bool {
533534 self . string == other. deref ( )
534535 }
535536}
536537
537- impl :: std:: cmp:: PartialEq < LocalInternedString > for str {
538+ impl std:: cmp:: PartialEq < LocalInternedString > for str {
538539 fn eq ( & self , other : & LocalInternedString ) -> bool {
539540 self == other. string
540541 }
541542}
542543
543- impl < ' a > :: std:: cmp:: PartialEq < LocalInternedString > for & ' a str {
544+ impl < ' a > std:: cmp:: PartialEq < LocalInternedString > for & ' a str {
544545 fn eq ( & self , other : & LocalInternedString ) -> bool {
545546 * self == other. string
546547 }
547548}
548549
549- impl :: std:: cmp:: PartialEq < LocalInternedString > for String {
550+ impl std:: cmp:: PartialEq < LocalInternedString > for String {
550551 fn eq ( & self , other : & LocalInternedString ) -> bool {
551552 self == other. string
552553 }
553554}
554555
555- impl < ' a > :: std:: cmp:: PartialEq < LocalInternedString > for & ' a String {
556+ impl < ' a > std:: cmp:: PartialEq < LocalInternedString > for & ' a String {
556557 fn eq ( & self , other : & LocalInternedString ) -> bool {
557558 * self == other. string
558559 }
@@ -561,19 +562,19 @@ impl<'a> ::std::cmp::PartialEq<LocalInternedString> for &'a String {
561562impl !Send for LocalInternedString { }
562563impl !Sync for LocalInternedString { }
563564
564- impl :: std:: ops:: Deref for LocalInternedString {
565+ impl std:: ops:: Deref for LocalInternedString {
565566 type Target = str ;
566567 fn deref ( & self ) -> & str { self . string }
567568}
568569
569570impl fmt:: Debug for LocalInternedString {
570- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
571+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
571572 fmt:: Debug :: fmt ( self . string , f)
572573 }
573574}
574575
575576impl fmt:: Display for LocalInternedString {
576- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
577+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
577578 fmt:: Display :: fmt ( self . string , f)
578579 }
579580}
@@ -640,7 +641,7 @@ impl Ord for InternedString {
640641 }
641642}
642643
643- impl < T : :: std:: ops:: Deref < Target = str > > PartialEq < T > for InternedString {
644+ impl < T : std:: ops:: Deref < Target = str > > PartialEq < T > for InternedString {
644645 fn eq ( & self , other : & T ) -> bool {
645646 self . with ( |string| string == other. deref ( ) )
646647 }
@@ -676,20 +677,20 @@ impl<'a> PartialEq<InternedString> for &'a String {
676677 }
677678}
678679
679- impl :: std:: convert:: From < InternedString > for String {
680+ impl std:: convert:: From < InternedString > for String {
680681 fn from ( val : InternedString ) -> String {
681682 val. as_symbol ( ) . to_string ( )
682683 }
683684}
684685
685686impl fmt:: Debug for InternedString {
686- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
687+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
687688 self . with ( |str| fmt:: Debug :: fmt ( & str, f) )
688689 }
689690}
690691
691692impl fmt:: Display for InternedString {
692- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
693+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
693694 self . with ( |str| fmt:: Display :: fmt ( & str, f) )
694695 }
695696}
@@ -709,7 +710,7 @@ impl Encodable for InternedString {
709710#[ cfg( test) ]
710711mod tests {
711712 use super :: * ;
712- use Globals ;
713+ use crate :: Globals ;
713714
714715 #[ test]
715716 fn interner_tests ( ) {
0 commit comments