forked from libre-chip/fayalite
		
	make FillInDefaultedGenerics work with Sizes and not just Types
				
					
				
			This commit is contained in:
		
							parent
							
								
									bd75fdfefd
								
							
						
					
					
						commit
						2fa0ea6192
					
				
					 1 changed files with 18 additions and 1 deletions
				
			
		|  | @ -11,6 +11,7 @@ use crate::{ | |||
|     intern::{Intern, Interned}, | ||||
|     reset::{AsyncReset, Reset, SyncReset}, | ||||
|     source_location::SourceLocation, | ||||
|     util::ConstUsize, | ||||
| }; | ||||
| use std::{fmt, hash::Hash, iter::FusedIterator, ops::Index}; | ||||
| 
 | ||||
|  | @ -166,7 +167,7 @@ impl<T: 'static + Send + Sync> MatchVariantAndInactiveScope for MatchVariantWith | |||
| } | ||||
| 
 | ||||
| pub trait FillInDefaultedGenerics { | ||||
|     type Type: Type; | ||||
|     type Type; | ||||
|     fn fill_in_defaulted_generics(self) -> Self::Type; | ||||
| } | ||||
| 
 | ||||
|  | @ -178,6 +179,22 @@ impl<T: Type> FillInDefaultedGenerics for T { | |||
|     } | ||||
| } | ||||
| 
 | ||||
| impl FillInDefaultedGenerics for usize { | ||||
|     type Type = usize; | ||||
| 
 | ||||
|     fn fill_in_defaulted_generics(self) -> Self::Type { | ||||
|         self | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl<const V: usize> FillInDefaultedGenerics for ConstUsize<V> { | ||||
|     type Type = ConstUsize<V>; | ||||
| 
 | ||||
|     fn fill_in_defaulted_generics(self) -> Self::Type { | ||||
|         self | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| mod sealed { | ||||
|     pub trait TypeOrDefaultSealed {} | ||||
|     pub trait BaseTypeSealed {} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue