Auto merge of #43812 - steveklabnik:rustdoc-doc-tests, r=QuietMisdreavus
Auto merge of #43812 - steveklabnik:rustdoc-doc-tests, r=QuietMisdreavus

rustdoc doc tests

This is mostly adapted from the book v1's chapter.

cc https://github.com/rust-lang/rust/issues/42322

r? @rust-lang/docs

GBGamer/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust