mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			634 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			634 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use rustc_hir::def::DefKind;
 | |
| use rustc_query_system::query::SimpleDefKind;
 | |
| 
 | |
| /// Convert a [`DefKind`] to a [`SimpleDefKind`].
 | |
| ///
 | |
| /// *See [`SimpleDefKind`]'s docs for more information.*
 | |
| pub(crate) fn def_kind_to_simple_def_kind(def_kind: DefKind) -> SimpleDefKind {
 | |
|     match def_kind {
 | |
|         DefKind::Struct => SimpleDefKind::Struct,
 | |
|         DefKind::Enum => SimpleDefKind::Enum,
 | |
|         DefKind::Union => SimpleDefKind::Union,
 | |
|         DefKind::Trait => SimpleDefKind::Trait,
 | |
|         DefKind::TyAlias => SimpleDefKind::TyAlias,
 | |
|         DefKind::TraitAlias => SimpleDefKind::TraitAlias,
 | |
| 
 | |
|         _ => SimpleDefKind::Other,
 | |
|     }
 | |
| }
 | 
