mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-11-03 13:13:18 +00:00 
			
		
		
		
	Fix proc macro ABI version checks
This commit is contained in:
		
							parent
							
								
									64a73dcfba
								
							
						
					
					
						commit
						6196b928a4
					
				@ -69,23 +69,27 @@ impl Abi {
 | 
			
		||||
        symbol_name: String,
 | 
			
		||||
        info: RustCInfo,
 | 
			
		||||
    ) -> Result<Abi, LoadProcMacroDylibError> {
 | 
			
		||||
        if info.version.0 != 1 {
 | 
			
		||||
            Err(LoadProcMacroDylibError::UnsupportedABI)
 | 
			
		||||
        } else if info.version.1 < 47 {
 | 
			
		||||
            Err(LoadProcMacroDylibError::UnsupportedABI)
 | 
			
		||||
        } else if info.version.1 < 54 {
 | 
			
		||||
        // FIXME: this should use exclusive ranges when they're stable
 | 
			
		||||
        // https://github.com/rust-lang/rust/issues/37854
 | 
			
		||||
        match (info.version.0, info.version.1) {
 | 
			
		||||
            (1, 47..=54) => {
 | 
			
		||||
                let inner = unsafe { Abi_1_47::from_lib(lib, symbol_name) }?;
 | 
			
		||||
                Ok(Abi::Abi1_47(inner))
 | 
			
		||||
        } else if info.version.1 < 56 {
 | 
			
		||||
            }
 | 
			
		||||
            (1, 55..=55) => {
 | 
			
		||||
                let inner = unsafe { Abi_1_55::from_lib(lib, symbol_name) }?;
 | 
			
		||||
                Ok(Abi::Abi1_55(inner))
 | 
			
		||||
        } else if info.version.1 < 57 {
 | 
			
		||||
            }
 | 
			
		||||
            (1, 56..=57) => {
 | 
			
		||||
                let inner = unsafe { Abi_1_56::from_lib(lib, symbol_name) }?;
 | 
			
		||||
                Ok(Abi::Abi1_56(inner))
 | 
			
		||||
        } else {
 | 
			
		||||
            }
 | 
			
		||||
            (1, 58..) => {
 | 
			
		||||
                let inner = unsafe { Abi_1_58::from_lib(lib, symbol_name) }?;
 | 
			
		||||
                Ok(Abi::Abi1_58(inner))
 | 
			
		||||
            }
 | 
			
		||||
            _ => Err(LoadProcMacroDylibError::UnsupportedABI),
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pub fn expand(
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user