Skip to content

Commit cb22c58

Browse files
Fix typo in unsize docs (rust-lang#1843)
1 parent 038010b commit cb22c58

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/traits/unsize.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,16 @@ Specifically, the upcasting algorithm involves: For each supertrait of the
7070
source dyn trait's principal (including itself)...
7171
1. Unify the super trait ref with the principal of the target (making sure
7272
we only ever upcast to a true supertrait, and never [via an impl]).
73-
2. For every auto trait in the source, check that it's present in the principal
73+
2. For every auto trait in the target, check that it's present in the source
7474
(allowing us to drop auto traits, but never gain new ones).
75-
3. For every projection in the source, check that it unifies with a single
76-
projection in the target (since there may be more than one given
75+
3. For every projection in the target, check that it unifies with a single
76+
projection in the source (since there may be more than one given
7777
`trait Sub: Sup<.., A = i32> + Sup<.., A = u32>`).
7878

7979
[via an impl]: https://github.com/rust-lang/rust/blob/f3457dbf84cd86d284454d12705861398ece76c3/tests/ui/traits/trait-upcasting/illegal-upcast-from-impl.rs#L19
8080

8181
Specifically, (3.) prevents a choice of projection bound to guide inference
8282
unnecessarily, though it may guide inference when it is unambiguous.
8383

84-
[^1]: The principal is the one non-auto trait of a `dyn Trait`.
84+
[^1]: The principal is the one non-auto trait of a `dyn Trait`.
85+

0 commit comments

Comments
 (0)