mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-31 03:54:42 +00:00 
			
		
		
		
	fix: Fix env/option_env macro check disregarding macro_rules definitions
				
					
				
			This commit is contained in:
		
							parent
							
								
									fff668052b
								
							
						
					
					
						commit
						acccd4bde6
					
				
					 2 changed files with 41 additions and 35 deletions
				
			
		|  | @ -3046,14 +3046,23 @@ impl Macro { | |||
|             MacroId::Macro2Id(it) => { | ||||
|                 matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltInEager(eager) if eager.is_env_or_option_env()) | ||||
|             } | ||||
|             MacroId::MacroRulesId(_) | MacroId::ProcMacroId(_) => false, | ||||
|             MacroId::MacroRulesId(it) => { | ||||
|                 matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltInEager(eager) if eager.is_env_or_option_env()) | ||||
|             } | ||||
|             MacroId::ProcMacroId(_) => false, | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     pub fn is_asm_or_global_asm(&self, db: &dyn HirDatabase) -> bool { | ||||
|         matches!(self.id, MacroId::Macro2Id(it) if { | ||||
|             matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltIn(m) if m.is_asm()) | ||||
|         }) | ||||
|         match self.id { | ||||
|             MacroId::Macro2Id(it) => { | ||||
|                 matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltIn(m) if m.is_asm()) | ||||
|             } | ||||
|             MacroId::MacroRulesId(it) => { | ||||
|                 matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltIn(m) if m.is_asm()) | ||||
|             } | ||||
|             MacroId::ProcMacroId(_) => false, | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     pub fn is_attr(&self, db: &dyn HirDatabase) -> bool { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lukas Wirth
						Lukas Wirth