rust/library/core/src
Jubilee 95b50eb662
Rollup merge of #87904 - kpreid:unsize, r=jyn514
Reword description of automatic impls of `Unsize`.

The existing documentation felt a little unhelpfully concise, so this change tries to improve it by using longer sentences, each of which specifies which kinds of types it applies to as early as possible. In particular, the third item starts with “Structs ...” instead of saying “Foo is a struct” later.

Also, the previous list items “Only the last field has a type involving `T`” and “`T` is not part of the type of any other fields” are, as far as I see, redundant with each other, so I removed the latter.

I have no particular knowledge of `Unsize`; I have attempted to leave the meaning entirely unchanged but may have missed a nuance.

Markdown preview of the edited documentation:

> All implementations of `Unsize` are provided automatically by the compiler.
> Those implementations are:
>
> - Arrays `[T; N]` implement `Unsize<[T]>`.
> - Types implementing a trait `Trait` also implement `Unsize<dyn Trait>`.
> - Structs `Foo<..., T, ...>` implement `Unsize<Foo<..., U, ...>>` if all of these conditions
>   are met:
>   - `T: Unsize<U>`.
>   - Only the last field of `Foo` has a type involving `T`.
>   - `Bar<T>: Unsize<Bar<U>>`, where `Bar<T>` stands for the actual type of that last field.
2021-09-11 08:23:38 -07:00
..
alloc Consistent spelling of "adapter" in the standard library 2021-07-30 17:23:07 +02:00
array Auto merge of #88469 - patrick-gu:master, r=dtolnay 2021-09-05 01:56:25 +00:00
char Add a missing backtick 2021-09-03 17:11:57 -07:00
convert impl const From<num> for num 2021-08-07 19:03:08 +02:00
fmt Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
future Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
hash Suggest deriving traits if possible 2021-09-06 13:18:05 +02:00
iter Stabilize Iterator::intersperse() 2021-08-31 14:50:18 -07:00
macros Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
mem Fix typos “an”→“a” and a few different ones that appeared in the same search 2021-08-22 18:15:49 +02:00
num Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
ops Add "!" doc alias for std::ops::Not 2021-09-02 17:19:43 +02:00
panic Fix unused sync::atomic import on targets without atomics 2021-07-31 17:27:29 -07:00
prelude Move asm! and global_asm! to core::arch 2021-07-18 18:30:58 -04:00
ptr remove redundant / misplaced sentence from docs 2021-09-01 20:52:30 -07:00
slice Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
str Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
stream Add core::stream::from_iter 2021-06-23 17:49:26 +02:00
sync Constified Default implementations 2021-08-17 07:15:54 +00:00
task Remove the TryV2 alias 2021-08-21 15:09:03 -07:00
unicode Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
any.rs Added diagnostic items to structs and traits for Clippy 2021-07-15 23:57:02 +02:00
ascii.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
bool.rs Fix accidentally deleted part 2021-09-03 17:13:42 -07:00
borrow.rs Fix borrow and deref 2021-03-03 11:23:29 +01:00
cell.rs Stabilize UnsafeCell::raw_get() 2021-08-31 14:44:13 -07:00
clone.rs Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
cmp.rs Suggest deriving traits if possible 2021-09-06 13:18:05 +02:00
default.rs Constified Default implementations 2021-08-17 07:15:54 +00:00
ffi.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
hint.rs Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
internal_macros.rs Remove unnecessary #[unstable] from internal macro. 2021-08-05 12:55:35 +02:00
intrinsics.rs Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
lazy.rs Capitalize safety comments 2020-09-08 22:26:44 -04:00
lib.rs Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
marker.rs Rollup merge of #87904 - kpreid:unsize, r=jyn514 2021-09-11 08:23:38 -07:00
option.rs Clarify what “a container” is in FromIterator<Option<A>> for Option<V> doc. 2021-09-04 11:30:14 -07:00
panic.rs Move UnwindSafe, RefUnwindSafe, AssertUnwindSafe to core 2021-07-30 10:42:15 -07:00
panicking.rs Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
pin.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
primitive.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
result.rs Remove the TryV2 alias 2021-08-21 15:09:03 -07:00
time.rs Adding examples to docs of std::time module 2021-08-29 23:59:35 -03:00
tuple.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
unit.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00