From 750d0bccde18d4b1c626883720570ec530edca88 Mon Sep 17 00:00:00 2001 From: Alexis Beingessner Date: Mon, 20 Jul 2015 16:18:52 -0700 Subject: [PATCH] remove subtyping from coercions, it's something else --- coercions.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/coercions.md b/coercions.md index 0eb03d2..8bb8284 100644 --- a/coercions.md +++ b/coercions.md @@ -1,16 +1,16 @@ % Coercions Types can implicitly be coerced to change in certain contexts. These changes are -generally just *weakening* of types, largely focused around pointers and lifetimes. -They mostly exist to make Rust "just work" in more cases, and are largely harmless. +generally just *weakening* of types, largely focused around pointers and +lifetimes. They mostly exist to make Rust "just work" in more cases, and are +largely harmless. Here's all the kinds of coercion: - Coercion is allowed between the following types: -* Subtyping: `T` to `U` if `T` is a [subtype][] of `U` -* Transitivity: `T_1` to `T_3` where `T_1` coerces to `T_2` and `T_2` coerces to `T_3` +* Transitivity: `T_1` to `T_3` where `T_1` coerces to `T_2` and `T_2` coerces to + `T_3` * Pointer Weakening: * `&mut T` to `&T` * `*mut T` to `*const T` @@ -68,5 +68,3 @@ fn main() { :10 foo(t); ^~~ ``` - -[subtype]: subtyping.html