Skip to content

Commit

Permalink
Tweak newtype coercions, remove ?Sized requirement.
Browse files Browse the repository at this point in the history
  • Loading branch information
nrc committed Mar 16, 2015
1 parent 943816d commit cfb6e6c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions text/0000-dst-coercion.md
Expand Up @@ -66,9 +66,8 @@ coerced to the `Target` type. E.g., the above implementation means that
## Newtype coercions

We also add a new built-in coercion for 'newtype's. If `Foo<T>` is a tuple
struct with a single field with type `T` and `T` has at least the `?Sized`
bound, then coerce_inner(`Foo<T>`) = `Foo<U>` holds for any `T` and `U` where
`T` coerces to `U`.
struct with a single field with type `T`, then coerce_inner(`Foo<T>`) = `Foo<U>`
holds for any `T` and `U` where `T` coerces to `U`.

This coercion is not opt-in. It is best thought of as an extension to the
coercion rule for structs with an unsized field, the extension is that here the
Expand Down Expand Up @@ -121,7 +120,7 @@ adjustment.
### Adjustment types

We add `AdjustCustom(usize, Box<AutoAdjustment>)` and
`AdjustNewtype(Box<AutoAdjustment>)` to the `AutoAdjustment` enum. These
`AdjustNewtype(Box<AutoDerefRef>)` to the `AutoAdjustment` enum. These
represent the new custom and newtype coercions, respectively. We add
`UnsizePlaceHolder(Ty, Ty)` to the `UnsizeKind` enum to represent a placeholder
adjustment due to an `Unsize` bound.
Expand Down

0 comments on commit cfb6e6c

Please sign in to comment.