mirror of
				https://github.com/astral-sh/ruff.git
				synced 2025-10-31 12:05:57 +00:00 
			
		
		
		
	Switch to Rust 2024 edition (#18129)
This commit is contained in:
		
							parent
							
								
									e67b35743a
								
							
						
					
					
						commit
						9ae698fe30
					
				
					 1082 changed files with 4211 additions and 3300 deletions
				
			
		|  | @ -5,11 +5,11 @@ use std::sync::Arc; | |||
| 
 | ||||
| use camino::{Utf8Path, Utf8PathBuf}; | ||||
| 
 | ||||
| use ruff_db::files::{system_path_to_file, vendored_path_to_file, File, FileError}; | ||||
| use ruff_db::files::{File, FileError, system_path_to_file, vendored_path_to_file}; | ||||
| use ruff_db::system::{System, SystemPath, SystemPathBuf}; | ||||
| use ruff_db::vendored::{VendoredPath, VendoredPathBuf}; | ||||
| 
 | ||||
| use super::typeshed::{typeshed_versions, TypeshedVersionsParseError, TypeshedVersionsQueryResult}; | ||||
| use super::typeshed::{TypeshedVersionsParseError, TypeshedVersionsQueryResult, typeshed_versions}; | ||||
| use crate::db::Db; | ||||
| use crate::module_name::ModuleName; | ||||
| use crate::module_resolver::resolver::ResolverContext; | ||||
|  | @ -923,10 +923,12 @@ mod tests { | |||
|         assert!(asyncio_regular_package.is_regular_package(&resolver)); | ||||
|         // Paths to directories don't resolve to VfsFiles
 | ||||
|         assert_eq!(asyncio_regular_package.to_file(&resolver), None); | ||||
|         assert!(asyncio_regular_package | ||||
|             .join("__init__.pyi") | ||||
|             .to_file(&resolver) | ||||
|             .is_some()); | ||||
|         assert!( | ||||
|             asyncio_regular_package | ||||
|                 .join("__init__.pyi") | ||||
|                 .to_file(&resolver) | ||||
|                 .is_some() | ||||
|         ); | ||||
| 
 | ||||
|         // The `asyncio` package exists on Python 3.8, but the `asyncio.tasks` submodule does not,
 | ||||
|         // according to the `VERSIONS` file in our typeshed mock:
 | ||||
|  | @ -1056,10 +1058,12 @@ mod tests { | |||
|         assert!(collections_regular_package.is_regular_package(&resolver)); | ||||
|         // (This is still `None`, as directories don't resolve to `Vfs` files)
 | ||||
|         assert_eq!(collections_regular_package.to_file(&resolver), None); | ||||
|         assert!(collections_regular_package | ||||
|             .join("__init__.pyi") | ||||
|             .to_file(&resolver) | ||||
|             .is_some()); | ||||
|         assert!( | ||||
|             collections_regular_package | ||||
|                 .join("__init__.pyi") | ||||
|                 .to_file(&resolver) | ||||
|                 .is_some() | ||||
|         ); | ||||
| 
 | ||||
|         // ...and so should the `asyncio.tasks` submodule (though it's still not a directory):
 | ||||
|         let asyncio_tasks_module = stdlib_path.join("asyncio/tasks.pyi"); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Micha Reiser
						Micha Reiser