@@ -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}
@@ -78,14 +78,14 @@ impl SyntaxContextData {
7878 fn new (
7979 ( parent, outer_expn, outer_transparency) : SyntaxContextKey ,
8080 opaque : SyntaxContext ,
81- opaque_and_semitransparent : SyntaxContext ,
81+ opaque_and_semiopaque : SyntaxContext ,
8282 ) -> SyntaxContextData {
8383 SyntaxContextData {
8484 outer_expn,
8585 outer_transparency,
8686 parent,
8787 opaque,
88- opaque_and_semitransparent ,
88+ opaque_and_semiopaque ,
8989 dollar_crate_name : kw:: DollarCrate ,
9090 }
9191 }
@@ -96,7 +96,7 @@ impl SyntaxContextData {
9696 outer_transparency : Transparency :: Opaque ,
9797 parent : SyntaxContext :: root ( ) ,
9898 opaque : SyntaxContext :: root ( ) ,
99- opaque_and_semitransparent : SyntaxContext :: root ( ) ,
99+ opaque_and_semiopaque : SyntaxContext :: root ( ) ,
100100 dollar_crate_name : kw:: DollarCrate ,
101101 }
102102 }
@@ -207,21 +207,21 @@ pub enum Transparency {
207207 /// Identifier produced by a transparent expansion is always resolved at call-site.
208208 /// Call-site spans in procedural macros, hygiene opt-out in `macro` should use this.
209209 Transparent ,
210- /// Identifier produced by a semi-transparent expansion may be resolved
210+ /// Identifier produced by a semi-opaque expansion may be resolved
211211 /// either at call-site or at definition-site.
212212 /// If it's a local variable, label or `$crate` then it's resolved at def-site.
213213 /// Otherwise it's resolved at call-site.
214214 /// `macro_rules` macros behave like this, built-in macros currently behave like this too,
215215 /// but that's an implementation detail.
216- SemiTransparent ,
216+ SemiOpaque ,
217217 /// Identifier produced by an opaque expansion is always resolved at definition-site.
218218 /// Def-site spans in procedural macros, identifiers from `macro` by default use this.
219219 Opaque ,
220220}
221221
222222impl Transparency {
223223 pub fn fallback ( macro_rules : bool ) -> Self {
224- if macro_rules { Transparency :: SemiTransparent } else { Transparency :: Opaque }
224+ if macro_rules { Transparency :: SemiOpaque } else { Transparency :: Opaque }
225225 }
226226}
227227
@@ -469,7 +469,7 @@ impl HygieneData {
469469
470470 fn normalize_to_macro_rules ( & self , ctxt : SyntaxContext ) -> SyntaxContext {
471471 debug_assert ! ( !self . syntax_context_data[ ctxt. 0 as usize ] . is_decode_placeholder( ) ) ;
472- self . syntax_context_data [ ctxt. 0 as usize ] . opaque_and_semitransparent
472+ self . syntax_context_data [ ctxt. 0 as usize ] . opaque_and_semiopaque
473473 }
474474
475475 fn outer_expn ( & self , ctxt : SyntaxContext ) -> ExpnId {
@@ -562,7 +562,7 @@ impl HygieneData {
562562 }
563563
564564 let call_site_ctxt = self . expn_data ( expn_id) . call_site . ctxt ( ) ;
565- let mut call_site_ctxt = if transparency == Transparency :: SemiTransparent {
565+ let mut call_site_ctxt = if transparency == Transparency :: SemiOpaque {
566566 self . normalize_to_macros_2_0 ( call_site_ctxt)
567567 } else {
568568 self . normalize_to_macro_rules ( call_site_ctxt)
@@ -608,33 +608,32 @@ impl HygieneData {
608608 self . syntax_context_data . push ( SyntaxContextData :: decode_placeholder ( ) ) ;
609609 self . syntax_context_map . insert ( key, ctxt) ;
610610
611- // Opaque and semi-transparent versions of the parent. Note that they may be equal to the
611+ // Opaque and semi-opaque versions of the parent. Note that they may be equal to the
612612 // parent itself. E.g. `parent_opaque` == `parent` if the expn chain contains only opaques,
613- // and `parent_opaque_and_semitransparent` == `parent` if the expn contains only opaques
614- // and semi-transparents.
613+ // and `parent_opaque_and_semiopaque` == `parent` if the expn contains only (semi-)opaques.
615614 let parent_opaque = self . syntax_context_data [ parent. 0 as usize ] . opaque ;
616- let parent_opaque_and_semitransparent =
617- self . syntax_context_data [ parent. 0 as usize ] . opaque_and_semitransparent ;
615+ let parent_opaque_and_semiopaque =
616+ self . syntax_context_data [ parent. 0 as usize ] . opaque_and_semiopaque ;
618617
619- // Evaluate opaque and semi-transparent versions of the new syntax context.
620- let ( opaque, opaque_and_semitransparent ) = match transparency {
621- Transparency :: Transparent => ( parent_opaque, parent_opaque_and_semitransparent ) ,
622- Transparency :: SemiTransparent => (
618+ // Evaluate opaque and semi-opaque versions of the new syntax context.
619+ let ( opaque, opaque_and_semiopaque ) = match transparency {
620+ Transparency :: Transparent => ( parent_opaque, parent_opaque_and_semiopaque ) ,
621+ Transparency :: SemiOpaque => (
623622 parent_opaque,
624- // Will be the same as `ctxt` if the expn chain contains only opaques and semi-transparents .
625- self . alloc_ctxt ( parent_opaque_and_semitransparent , expn_id, transparency) ,
623+ // Will be the same as `ctxt` if the expn chain contains only ( semi-)opaques .
624+ self . alloc_ctxt ( parent_opaque_and_semiopaque , expn_id, transparency) ,
626625 ) ,
627626 Transparency :: Opaque => (
628627 // Will be the same as `ctxt` if the expn chain contains only opaques.
629628 self . alloc_ctxt ( parent_opaque, expn_id, transparency) ,
630- // Will be the same as `ctxt` if the expn chain contains only opaques and semi-transparents .
631- self . alloc_ctxt ( parent_opaque_and_semitransparent , expn_id, transparency) ,
629+ // Will be the same as `ctxt` if the expn chain contains only ( semi-)opaques .
630+ self . alloc_ctxt ( parent_opaque_and_semiopaque , expn_id, transparency) ,
632631 ) ,
633632 } ;
634633
635634 // Fill the full data, now that we have it.
636635 self . syntax_context_data [ ctxt. as_u32 ( ) as usize ] =
637- SyntaxContextData :: new ( key, opaque, opaque_and_semitransparent ) ;
636+ SyntaxContextData :: new ( key, opaque, opaque_and_semiopaque ) ;
638637 ctxt
639638 }
640639}
0 commit comments