File tree 2 files changed +25
-3
lines changed
2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -333,11 +333,11 @@ pub enum InlineAttr {
333
333
pub fn find_inline_attr ( diagnostic : Option < & Handler > , attrs : & [ Attribute ] ) -> InlineAttr {
334
334
attrs. iter ( ) . fold ( InlineAttr :: None , |ia, attr| {
335
335
match attr. node . value . node {
336
- MetaItemKind :: Word ( ref n) if * n == "inline" => {
336
+ MetaItemKind :: Word ( ref n) if n == "inline" => {
337
337
mark_used ( attr) ;
338
338
InlineAttr :: Hint
339
339
}
340
- MetaItemKind :: List ( ref n, ref items) if * n == "inline" => {
340
+ MetaItemKind :: List ( ref n, ref items) if n == "inline" => {
341
341
mark_used ( attr) ;
342
342
if items. len ( ) != 1 {
343
343
diagnostic. map ( |d|{ d. span_err ( attr. span , "expected one argument" ) ; } ) ;
@@ -711,7 +711,7 @@ pub fn require_unique_names(diagnostic: &Handler, metas: &[P<MetaItem>]) {
711
711
pub fn find_repr_attrs ( diagnostic : & Handler , attr : & Attribute ) -> Vec < ReprAttr > {
712
712
let mut acc = Vec :: new ( ) ;
713
713
match attr. node . value . node {
714
- ast:: MetaItemKind :: List ( ref s, ref items) if * s == "repr" => {
714
+ ast:: MetaItemKind :: List ( ref s, ref items) if s == "repr" => {
715
715
mark_used ( attr) ;
716
716
for item in items {
717
717
match item. node {
Original file line number Diff line number Diff line change @@ -566,6 +566,28 @@ impl<'a> PartialEq<InternedString> for &'a str {
566
566
}
567
567
}
568
568
569
+ impl PartialEq < str > for InternedString {
570
+ #[ inline( always) ]
571
+ fn eq ( & self , other : & str ) -> bool {
572
+ PartialEq :: eq ( & self . string [ ..] , other)
573
+ }
574
+ #[ inline( always) ]
575
+ fn ne ( & self , other : & str ) -> bool {
576
+ PartialEq :: ne ( & self . string [ ..] , other)
577
+ }
578
+ }
579
+
580
+ impl PartialEq < InternedString > for str {
581
+ #[ inline( always) ]
582
+ fn eq ( & self , other : & InternedString ) -> bool {
583
+ PartialEq :: eq ( self , & other. string [ ..] )
584
+ }
585
+ #[ inline( always) ]
586
+ fn ne ( & self , other : & InternedString ) -> bool {
587
+ PartialEq :: ne ( self , & other. string [ ..] )
588
+ }
589
+ }
590
+
569
591
impl Decodable for InternedString {
570
592
fn decode < D : Decoder > ( d : & mut D ) -> Result < InternedString , D :: Error > {
571
593
Ok ( intern ( d. read_str ( ) ?. as_ref ( ) ) . as_str ( ) )
You can’t perform that action at this time.
0 commit comments