Skip to content

Commit f0fb7ab

Browse files
Add missing link in fmt::format function
1 parent e5938ef commit f0fb7ab

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

src/liballoc/fmt.rs

+22-20
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
//!
150150
//! Additionally, the return value of this function is [`fmt::Result`] which is a
151151
//! type alias of [`Result`]`<(), `[`std::fmt::Error`]`>`. Formatting implementations
152-
//! should ensure that they propagate errors from the [`Formatter`] (e.g., when
152+
//! should ensure that they propagate errors from the [`Formatter`][`Formatter`] (e.g., when
153153
//! calling [`write!`]) however, they should never return errors spuriously. That
154154
//! is, a formatting implementation must and may only return an error if the
155155
//! passed-in [`Formatter`] returns an error. This is because, contrary to what
@@ -209,7 +209,7 @@
209209
//!
210210
//! These two formatting traits have distinct purposes:
211211
//!
212-
//! - [`fmt::Display`][`Display] implementations assert that the type can be faithfully
212+
//! - [`fmt::Display`][`Display`] implementations assert that the type can be faithfully
213213
//! represented as a UTF-8 string at all times. It is **not** expected that
214214
//! all types implement the `Display` trait.
215215
//! - [`fmt::Debug`][`Debug`] implementations should be implemented for **all** public types.
@@ -357,7 +357,7 @@
357357
//! * `-` - Currently not used
358358
//! * `#` - This flag is indicates that the "alternate" form of printing should
359359
//! be used. The alternate forms are:
360-
//! * `#?` - pretty-print the `Debug` formatting
360+
//! * `#?` - pretty-print the [`Debug`] formatting
361361
//! * `#x` - precedes the argument with a `0x`
362362
//! * `#X` - precedes the argument with a `0x`
363363
//! * `#b` - precedes the argument with a `0b`
@@ -475,25 +475,25 @@
475475
//! them with the same character. For example, the `{` character is escaped with
476476
//! `{{` and the `}` character is escaped with `}}`.
477477
//!
478-
//! [`format!`]: ../macro.format.html
479-
//! [`usize`]: ../primitive.usize.html
480-
//! [`isize`]: ../primitive.isize.html
481-
//! [`i8`]: ../primitive.i8.html
478+
//! [`format!`]: ../../macro.format.html
479+
//! [`usize`]: ../../std/primitive.usize.html
480+
//! [`isize`]: ../../std/primitive.isize.html
481+
//! [`i8`]: ../../std/primitive.i8.html
482482
//! [`Display`]: trait.Display.html
483483
//! [`Binary`]: trait.Binary.html
484484
//! [`fmt::Result`]: type.Result.html
485-
//! [`Result`]: ../result/enum.Result.html
485+
//! [`Result`]: ../../std/result/enum.Result.html
486486
//! [`std::fmt::Error`]: struct.Error.html
487487
//! [`Formatter`]: struct.Formatter.html
488-
//! [`write!`]: ../macro.write.html
488+
//! [`write!`]: ../../std/macro.write.html
489489
//! [`Debug`]: trait.Debug.html
490-
//! [`format!`]: ../macro.format.html
491-
//! [`writeln!`]: ../macro.writeln.html
492-
//! [`write_fmt`]: ../io/trait.Write.html#method.write_fmt
493-
//! [`std::io::Write`]: ../io/trait.Write.html
494-
//! [`println!`]: ../macro.println.html
495-
//! [`write!`]: ../macro.write.html
496-
//! [`format_args!`]: ../macro.format_args.html
490+
//! [`format!`]: ../../std/macro.format.html
491+
//! [`writeln!`]: ../../std/macro.writeln.html
492+
//! [`write_fmt`]: ../../std/io/trait.Write.html#method.write_fmt
493+
//! [`std::io::Write`]: ../../std/io/trait.Write.html
494+
//! [`println!`]: ../../std/macro.println.html
495+
//! [`write!`]: ../../std/macro.write.html
496+
//! [`format_args!`]: ../../std/macro.format_args.html
497497
//! [`fmt::Arguments`]: struct.Arguments.html
498498
//! [`write`]: fn.write.html
499499
//! [`format`]: fn.format.html
@@ -521,10 +521,10 @@ pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
521521

522522
use string;
523523

524-
/// The `format` function takes an `Arguments` struct and returns the resulting
524+
/// The `format` function takes an [`Arguments`] struct and returns the resulting
525525
/// formatted string.
526526
///
527-
/// The `Arguments` instance can be created with the `format_args!` macro.
527+
/// The [`Arguments`] instance can be created with the [`format_args!`] macro.
528528
///
529529
/// # Examples
530530
///
@@ -537,15 +537,17 @@ use string;
537537
/// assert_eq!(s, "Hello, world!");
538538
/// ```
539539
///
540-
/// Please note that using [`format!`][format!] might be preferrable.
540+
/// Please note that using [`format!`] might be preferrable.
541541
/// Example:
542542
///
543543
/// ```
544544
/// let s = format!("Hello, {}!", "world");
545545
/// assert_eq!(s, "Hello, world!");
546546
/// ```
547547
///
548-
/// [format!]: ../macro.format.html
548+
/// [`Arguments`]: struct.Arguments.html
549+
/// [`format_args!`]: ../../std/macro.format_args.html
550+
/// [`format!`]: ../../std/macro.format.html
549551
#[stable(feature = "rust1", since = "1.0.0")]
550552
pub fn format(args: Arguments) -> string::String {
551553
let capacity = args.estimated_capacity();

src/librustc_typeck/check/demand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
6767
Ok(InferOk { obligations, value: () }) => {
6868
self.register_predicates(obligations);
6969
None
70-
},
70+
}
7171
Err(e) => {
7272
Some(self.report_mismatched_types(cause, expected, actual, e))
7373
}
@@ -82,7 +82,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
8282

8383
// Checks that the type of `expr` can be coerced to `expected`.
8484
//
85-
// NB: This code relies on `self.diverges` to be accurate. In
85+
// NB: This code relies on `self.diverges` to be accurate. In
8686
// particular, assignments to `!` will be permitted if the
8787
// diverges flag is currently "always".
8888
pub fn demand_coerce_diag(&self,

0 commit comments

Comments
 (0)