From cb22c581cd2192a71b8c5b8368981a7afb4d9cec Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 28 Dec 2023 20:06:18 -0500 Subject: [PATCH] Fix typo in unsize docs (#1843) --- src/traits/unsize.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/traits/unsize.md b/src/traits/unsize.md index b11760992088a..4876bfd07dd89 100644 --- a/src/traits/unsize.md +++ b/src/traits/unsize.md @@ -70,10 +70,10 @@ Specifically, the upcasting algorithm involves: For each supertrait of the source dyn trait's principal (including itself)... 1. Unify the super trait ref with the principal of the target (making sure we only ever upcast to a true supertrait, and never [via an impl]). -2. For every auto trait in the source, check that it's present in the principal +2. For every auto trait in the target, check that it's present in the source (allowing us to drop auto traits, but never gain new ones). -3. For every projection in the source, check that it unifies with a single - projection in the target (since there may be more than one given +3. For every projection in the target, check that it unifies with a single + projection in the source (since there may be more than one given `trait Sub: Sup<.., A = i32> + Sup<.., A = u32>`). [via an impl]: https://github.com/rust-lang/rust/blob/f3457dbf84cd86d284454d12705861398ece76c3/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl.rs#L19 @@ -81,4 +81,5 @@ source dyn trait's principal (including itself)... Specifically, (3.) prevents a choice of projection bound to guide inference unnecessarily, though it may guide inference when it is unambiguous. -[^1]: The principal is the one non-auto trait of a `dyn Trait`. \ No newline at end of file +[^1]: The principal is the one non-auto trait of a `dyn Trait`. +