@@ -66,10 +66,10 @@ pub struct SyntaxContextData {
6666 outer_expn : ExpnId ,
6767 outer_transparency : Transparency ,
6868 parent : SyntaxContext ,
69- /// This context, but with all transparent and semi-transparent expansions filtered away.
69+ /// This context, but with all transparent and semi-opaque expansions filtered away.
7070 opaque : SyntaxContext ,
7171 /// This context, but with all transparent expansions filtered away.
72- opaque_and_semitransparent : SyntaxContext ,
72+ opaque_and_semiopaque : SyntaxContext ,
7373 /// Name of the crate to which `$crate` with this context would resolve.
7474 dollar_crate_name : Symbol ,
7575}
@@ -81,7 +81,7 @@ impl SyntaxContextData {
8181 outer_transparency : Transparency :: Opaque ,
8282 parent : SyntaxContext :: root ( ) ,
8383 opaque : SyntaxContext :: root ( ) ,
84- opaque_and_semitransparent : SyntaxContext :: root ( ) ,
84+ opaque_and_semiopaque : SyntaxContext :: root ( ) ,
8585 dollar_crate_name : kw:: DollarCrate ,
8686 }
8787 }
@@ -192,21 +192,21 @@ pub enum Transparency {
192192 /// Identifier produced by a transparent expansion is always resolved at call-site.
193193 /// Call-site spans in procedural macros, hygiene opt-out in `macro` should use this.
194194 Transparent ,
195- /// Identifier produced by a semi-transparent expansion may be resolved
195+ /// Identifier produced by a semi-opaque expansion may be resolved
196196 /// either at call-site or at definition-site.
197197 /// If it's a local variable, label or `$crate` then it's resolved at def-site.
198198 /// Otherwise it's resolved at call-site.
199199 /// `macro_rules` macros behave like this, built-in macros currently behave like this too,
200200 /// but that's an implementation detail.
201- SemiTransparent ,
201+ SemiOpaque ,
202202 /// Identifier produced by an opaque expansion is always resolved at definition-site.
203203 /// Def-site spans in procedural macros, identifiers from `macro` by default use this.
204204 Opaque ,
205205}
206206
207207impl Transparency {
208208 pub fn fallback ( macro_rules : bool ) -> Self {
209- if macro_rules { Transparency :: SemiTransparent } else { Transparency :: Opaque }
209+ if macro_rules { Transparency :: SemiOpaque } else { Transparency :: Opaque }
210210 }
211211}
212212
@@ -454,7 +454,7 @@ impl HygieneData {
454454
455455 fn normalize_to_macro_rules ( & self , ctxt : SyntaxContext ) -> SyntaxContext {
456456 debug_assert ! ( !self . syntax_context_data[ ctxt. 0 as usize ] . is_decode_placeholder( ) ) ;
457- self . syntax_context_data [ ctxt. 0 as usize ] . opaque_and_semitransparent
457+ self . syntax_context_data [ ctxt. 0 as usize ] . opaque_and_semiopaque
458458 }
459459
460460 fn outer_expn ( & self , ctxt : SyntaxContext ) -> ExpnId {
@@ -547,7 +547,7 @@ impl HygieneData {
547547 }
548548
549549 let call_site_ctxt = self . expn_data ( expn_id) . call_site . ctxt ( ) ;
550- let mut call_site_ctxt = if transparency == Transparency :: SemiTransparent {
550+ let mut call_site_ctxt = if transparency == Transparency :: SemiOpaque {
551551 self . normalize_to_macros_2_0 ( call_site_ctxt)
552552 } else {
553553 self . normalize_to_macro_rules ( call_site_ctxt)
@@ -581,8 +581,7 @@ impl HygieneData {
581581 let syntax_context_data = & mut self . syntax_context_data ;
582582 debug_assert ! ( !syntax_context_data[ ctxt. 0 as usize ] . is_decode_placeholder( ) ) ;
583583 let mut opaque = syntax_context_data[ ctxt. 0 as usize ] . opaque ;
584- let mut opaque_and_semitransparent =
585- syntax_context_data[ ctxt. 0 as usize ] . opaque_and_semitransparent ;
584+ let mut opaque_and_semiopaque = syntax_context_data[ ctxt. 0 as usize ] . opaque_and_semiopaque ;
586585
587586 if transparency >= Transparency :: Opaque {
588587 let parent = opaque;
@@ -596,30 +595,30 @@ impl HygieneData {
596595 outer_transparency : transparency,
597596 parent,
598597 opaque : new_opaque,
599- opaque_and_semitransparent : new_opaque,
598+ opaque_and_semiopaque : new_opaque,
600599 dollar_crate_name : kw:: DollarCrate ,
601600 } ) ;
602601 new_opaque
603602 } ) ;
604603 }
605604
606- if transparency >= Transparency :: SemiTransparent {
607- let parent = opaque_and_semitransparent ;
608- opaque_and_semitransparent = * self
605+ if transparency >= Transparency :: SemiOpaque {
606+ let parent = opaque_and_semiopaque ;
607+ opaque_and_semiopaque = * self
609608 . syntax_context_map
610609 . entry ( ( parent, expn_id, transparency) )
611610 . or_insert_with ( || {
612- let new_opaque_and_semitransparent =
611+ let new_opaque_and_semiopaque =
613612 SyntaxContext :: from_usize ( syntax_context_data. len ( ) ) ;
614613 syntax_context_data. push ( SyntaxContextData {
615614 outer_expn : expn_id,
616615 outer_transparency : transparency,
617616 parent,
618617 opaque,
619- opaque_and_semitransparent : new_opaque_and_semitransparent ,
618+ opaque_and_semiopaque : new_opaque_and_semiopaque ,
620619 dollar_crate_name : kw:: DollarCrate ,
621620 } ) ;
622- new_opaque_and_semitransparent
621+ new_opaque_and_semiopaque
623622 } ) ;
624623 }
625624
@@ -630,7 +629,7 @@ impl HygieneData {
630629 outer_transparency : transparency,
631630 parent,
632631 opaque,
633- opaque_and_semitransparent ,
632+ opaque_and_semiopaque ,
634633 dollar_crate_name : kw:: DollarCrate ,
635634 } ) ;
636635 SyntaxContext :: from_usize ( syntax_context_data. len ( ) - 1 )
0 commit comments