From 24a1876e339b3880acb0431d190fc8c65500ae34 Mon Sep 17 00:00:00 2001 From: Sede Soukossi <4968379+styvane@users.noreply.github.com> Date: Wed, 30 Jul 2025 10:39:13 +0200 Subject: [PATCH 1/2] fixed typo --- posts/sizedness-in-rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/sizedness-in-rust.md b/posts/sizedness-in-rust.md index 399c0b0..5d49c95 100644 --- a/posts/sizedness-in-rust.md +++ b/posts/sizedness-in-rust.md @@ -485,7 +485,7 @@ We'll get into why traits are `?Sized` by default soon but first let's ask ourse trait Trait where Self: ?Sized {} ``` -Okay, so by default traits allow `self` to possibly be an unsized type. As we learned earlier we can't pass unsized types around by value, so that limits us in the kind of methods we can define in the trait. It should be impossible to write a method the takes or returns `self` by value and yet this surprisingly compiles: +Okay, so by default traits allow `self` to possibly be an unsized type. As we learned earlier we can't pass unsized types around by value, so that limits us in the kind of methods we can define in the trait. It should be impossible to write a method that takes or returns `self` by value and yet this surprisingly compiles: ```rust trait Trait { From 6f5d935c879075f5ccbf1f3e15d90ee50390900b Mon Sep 17 00:00:00 2001 From: Sede Soukossi <4968379+styvane@users.noreply.github.com> Date: Wed, 30 Jul 2025 10:42:33 +0200 Subject: [PATCH 2/2] Upcasting is supported starting from rustc 1.86 --- posts/sizedness-in-rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/sizedness-in-rust.md b/posts/sizedness-in-rust.md index 5d49c95..62360ce 100644 --- a/posts/sizedness-in-rust.md +++ b/posts/sizedness-in-rust.md @@ -778,7 +778,7 @@ fn function(t: &dyn Trait3) { } ``` -One downside of this workaround is that Rust does not support supertrait upcasting. What this means is that if we have a `dyn Trait3` we can't use it where we need a `dyn Trait` or a `dyn Trait2`. This program does not compile: +One downside of this workaround is that Rust did not support supertrait upcasting until 1.86. What this means is that if we have a `dyn Trait3` we can't use it where we need a `dyn Trait` or a `dyn Trait2` in version prior to 1.86. This program does not compile: ```rust trait Trait {