From 7a13537f96af4b9b8e3ea296d6e5c3c7ab72ce9f Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 6 Jul 2021 11:08:10 +0900 Subject: [PATCH] Apply review comments --- src/coercions.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/coercions.md b/src/coercions.md index 740de40..ffff83f 100644 --- a/src/coercions.md +++ b/src/coercions.md @@ -6,9 +6,7 @@ They mostly exist to make Rust "just work" in more cases, and are largely harmle For an exhaustive list of all the types of coercions, see the [Coercion types] section on the reference. -## Cases where coercions do not perform - -Note that we do not perform coercions when matching traits (except for receivers, see below). +Note that we do not perform coercions when matching traits (except for receivers, see the [next page][dot-operator]). If there is an `impl` for some type `U` and `T` coerces to `U`, that does not constitute an implementation for `T`. For example, the following will not type check, even though it is OK to coerce `t` to `&T` and there is an `impl` for `&T`: @@ -25,7 +23,7 @@ fn main() { } ``` -which fails like the following: +which fails like as follows: ```text error[E0277]: the trait bound `&mut i32: Trait` is not satisfied @@ -43,3 +41,4 @@ error[E0277]: the trait bound `&mut i32: Trait` is not satisfied ``` [Coercion types]: ../reference/type-coercions.html#coercion-types +[dot-operator]: ./dot-operator.html