From 3709bcd0fd8c3c44aab4de8c4bac1703c55c00a1 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 29 Aug 2020 21:19:49 -0400 Subject: [PATCH] Orphan rule --- _posts/2020-08-05-static-polymorphism.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/_posts/2020-08-05-static-polymorphism.md b/_posts/2020-08-05-static-polymorphism.md index 7daff0e..52ceb48 100644 --- a/_posts/2020-08-05-static-polymorphism.md +++ b/_posts/2020-08-05-static-polymorphism.md @@ -266,13 +266,16 @@ auto some_func(MyConcept auto value) -> void { } void some_func(LocalImpl value) { - // NOTE: This is actually a recursive call because `LocalImpl` is more specific than `auto`, - // so will overflow the stack. + // NOTE: Because `LocalImpl` is more specific than `auto`, this is a recursive call and + // will overflow the stack. // We use `some_func_` above to uniquely name the function we actually want to call. 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 With concepts, you find out that there's an issue only when you attempt to use it. Traits in Rust