diff --git a/src/behavior-considered-undefined.md b/src/behavior-considered-undefined.md index e810e8c0d..ff3c24367 100644 --- a/src/behavior-considered-undefined.md +++ b/src/behavior-considered-undefined.md @@ -34,6 +34,7 @@ code. * Invoking undefined behavior via compiler intrinsics. * Executing code compiled with platform features that the current platform does not support (see [`target_feature`]), *except* if the platform explicitly documents this to be safe. +* Performing non-nop coercion on a dangling or unaligned raw pointer. * Calling a function with the wrong call ABI or unwinding from a function with the wrong unwind ABI. * Producing an invalid value, even in private fields and locals. "Producing" a value happens any time a value is assigned to or read from a place, passed to diff --git a/src/type-coercions.md b/src/type-coercions.md index 45d81d386..4841d5c2c 100644 --- a/src/type-coercions.md +++ b/src/type-coercions.md @@ -159,7 +159,7 @@ Coercion is allowed between the following types: ### Unsized Coercions The following coercions are called `unsized coercions`, since they -relate to converting sized types to unsized types, and are permitted in a few +relate to converting types to unsized types, and are permitted in a few cases where other coercions are not, as described above. They can still happen anywhere else a coercion can occur. @@ -172,6 +172,8 @@ an implementation of `Unsize` for `T` will be provided: * `T` to `dyn U`, when `T` implements `U + Sized`, and `U` is [object safe]. +* `dyn T` to `dyn U`, when `U` is one of `T`'s supertraits. + * `Foo<..., T, ...>` to `Foo<..., U, ...>`, when: * `Foo` is a struct. * `T` implements `Unsize`.