1
Fork 0

Rollup merge of #75927 - camelid:intra-doc-links-for-core-macros, r=jyn514

Use intra-doc links in `core::macros`

Part of #75080.

Also cleaned up some things.

@rustbot modify labels: A-intra-doc-links T-doc T-rustdoc
This commit is contained in:
Pietro Albini 2020-08-28 10:23:55 +02:00 committed by GitHub
commit 521b2054b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 13 deletions

View file

@ -333,16 +333,16 @@ macro_rules! r#try {
/// This macro accepts a format string, a list of arguments, and a 'writer'. Arguments will be /// This macro accepts a format string, a list of arguments, and a 'writer'. Arguments will be
/// formatted according to the specified format string and the result will be passed to the writer. /// formatted according to the specified format string and the result will be passed to the writer.
/// The writer may be any value with a `write_fmt` method; generally this comes from an /// The writer may be any value with a `write_fmt` method; generally this comes from an
/// implementation of either the [`std::fmt::Write`] or the [`std::io::Write`] trait. The macro /// implementation of either the [`fmt::Write`] or the [`io::Write`] trait. The macro
/// returns whatever the `write_fmt` method returns; commonly a [`std::fmt::Result`], or an /// returns whatever the `write_fmt` method returns; commonly a [`fmt::Result`], or an
/// [`io::Result`]. /// [`io::Result`].
/// ///
/// See [`std::fmt`] for more information on the format string syntax. /// See [`std::fmt`] for more information on the format string syntax.
/// ///
/// [`std::fmt`]: crate::fmt /// [`std::fmt`]: crate::fmt
/// [`std::fmt::Write`]: crate::fmt::Write /// [`fmt::Write`]: crate::fmt::Write
/// [`std::io::Write`]: ../std/io/trait.Write.html /// [`io::Write`]: ../std/io/trait.Write.html
/// [`std::fmt::Result`]: crate::fmt::Result /// [`fmt::Result`]: crate::fmt::Result
/// [`io::Result`]: ../std/io/type.Result.html /// [`io::Result`]: ../std/io/type.Result.html
/// ///
/// # Examples /// # Examples

View file

@ -5,12 +5,12 @@ to the caller of the program. `panic!` should be used when a program reaches
an unrecoverable state. an unrecoverable state.
This macro is the perfect way to assert conditions in example code and in This macro is the perfect way to assert conditions in example code and in
tests. `panic!` is closely tied with the `unwrap` method of both [`Option`] tests. `panic!` is closely tied with the `unwrap` method of both
and [`Result`][runwrap] enums. Both implementations call `panic!` when they are set [`Option`][ounwrap] and [`Result`][runwrap] enums. Both implementations call
to None or Err variants. `panic!` when they are set to [`None`] or [`Err`] variants.
This macro is used to inject panic into a Rust thread, causing the thread to This macro is used to inject panic into a Rust thread, causing the thread to
panic entirely. Each thread's panic can be reaped as the `Box<Any>` type, panic entirely. Each thread's panic can be reaped as the [`Box`]`<`[`Any`]`>` type,
and the single-argument form of the `panic!` macro will be the value which and the single-argument form of the `panic!` macro will be the value which
is transmitted. is transmitted.
@ -24,11 +24,11 @@ The multi-argument form of this macro panics with a string and has the
See also the macro [`compile_error!`], for raising errors during compilation. See also the macro [`compile_error!`], for raising errors during compilation.
[runwrap]: ../std/result/enum.Result.html#method.unwrap [ounwrap]: Option::unwrap
[`Option`]: ../std/option/enum.Option.html#method.unwrap [runwrap]: Result::unwrap
[`Result`]: ../std/result/enum.Result.html [`Box`]: ../std/boxed/struct.Box.html
[`Any`]: crate::any::Any
[`format!`]: ../std/macro.format.html [`format!`]: ../std/macro.format.html
[`compile_error!`]: ../std/macro.compile_error.html
[book]: ../book/ch09-00-error-handling.html [book]: ../book/ch09-00-error-handling.html
# Current implementation # Current implementation