Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing urls in some macros doc #40327

Merged
merged 1 commit into from
Mar 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ macro_rules! panic {

/// Ensure that a boolean expression is `true` at runtime.
///
/// This will invoke the `panic!` macro if the provided expression cannot be
/// This will invoke the [`panic!`] macro if the provided expression cannot be
/// evaluated to `true` at runtime.
///
/// Assertions are always checked in both debug and release builds, and cannot
/// be disabled. See `debug_assert!` for assertions that are not enabled in
/// be disabled. See [`debug_assert!`] for assertions that are not enabled in
/// release builds by default.
///
/// Unsafe code relies on `assert!` to enforce run-time invariants that, if
Expand All @@ -48,6 +48,8 @@ macro_rules! panic {
/// This macro has a second version, where a custom panic message can
/// be provided with or without arguments for formatting.
///
/// [`panic!`]: macro.panic.html
/// [`debug_assert!`]: macro.debug_assert.html
/// [testing]: ../book/testing.html
///
/// # Examples
Expand Down Expand Up @@ -88,9 +90,11 @@ macro_rules! assert {
/// On panic, this macro will print the values of the expressions with their
/// debug representations.
///
/// Like `assert!()`, this macro has a second version, where a custom
/// Like [`assert!()`], this macro has a second version, where a custom
/// panic message can be provided.
///
/// [`assert!()`]: macro.assert.html
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -134,6 +138,8 @@ macro_rules! assert_eq {
/// Like `assert!()`, this macro has a second version, where a custom
/// panic message can be provided.
///
/// [`assert!`]: macro.assert.html
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -171,13 +177,13 @@ macro_rules! assert_ne {

/// Ensure that a boolean expression is `true` at runtime.
///
/// This will invoke the `panic!` macro if the provided expression cannot be
/// This will invoke the [`panic!`] macro if the provided expression cannot be
/// evaluated to `true` at runtime.
///
/// Like `assert!`, this macro also has a second version, where a custom panic
/// Like [`assert!`], this macro also has a second version, where a custom panic
/// message can be provided.
///
/// Unlike `assert!`, `debug_assert!` statements are only enabled in non
/// Unlike [`assert!`], `debug_assert!` statements are only enabled in non
/// optimized builds by default. An optimized build will omit all
/// `debug_assert!` statements unless `-C debug-assertions` is passed to the
/// compiler. This makes `debug_assert!` useful for checks that are too
Expand All @@ -187,10 +193,13 @@ macro_rules! assert_ne {
/// An unchecked assertion allows a program in an inconsistent state to keep
/// running, which might have unexpected consequences but does not introduce
/// unsafety as long as this only happens in safe code. The performance cost
/// of assertions, is however, not measurable in general. Replacing `assert!`
/// of assertions, is however, not measurable in general. Replacing [`assert!`]
/// with `debug_assert!` is thus only encouraged after thorough profiling, and
/// more importantly, only in safe code!
///
/// [`panic!`]: macro.panic.html
/// [`assert!`]: macro.assert.html
///
/// # Examples
///
/// ```
Expand Down