mirror of
				https://github.com/bspeice/speice.io
				synced 2025-11-03 18:10:32 -05:00 
			
		
		
		
	Orphan rule
This commit is contained in:
		@ -266,13 +266,16 @@ auto some_func(MyConcept auto value) -> void {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void some_func(LocalImpl value) {
 | 
					void some_func(LocalImpl value) {
 | 
				
			||||||
    // NOTE: This is actually a recursive call because `LocalImpl` is more specific than `auto`,
 | 
					    // NOTE: Because `LocalImpl` is more specific than `auto`, this is a recursive call and
 | 
				
			||||||
    // so will overflow the stack.
 | 
					    // will overflow the stack.
 | 
				
			||||||
    // We use `some_func_` above to uniquely name the function we actually want to call.
 | 
					    // We use `some_func_` above to uniquely name the function we actually want to call.
 | 
				
			||||||
    some_func(value);
 | 
					    some_func(value);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Potentially worth mentioning orphan rule in Rust as limit to extension methods - can't implement
 | 
				
			||||||
 | 
					remote traits for remote types.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Checking a type fulfills the concept
 | 
					# Checking a type fulfills the concept
 | 
				
			||||||
 | 
					
 | 
				
			||||||
With concepts, you find out that there's an issue only when you attempt to use it. Traits in Rust
 | 
					With concepts, you find out that there's an issue only when you attempt to use it. Traits in Rust
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user