diff options
| author | Ariel Ben-Yehuda <arielb1@mail.tau.ac.il> | 2017-03-08 20:54:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-08 20:54:07 +0200 |
| commit | e8eb05cddd71f008300442a95140ee46fb9ed8ea (patch) | |
| tree | b30511b8886b54117b7704e53e477236a248e26b /src/libcore | |
| parent | 5ad3f092166d9e500a2087e08c0de1f6ecedd71c (diff) | |
| parent | 65ac1e92fe0f77ce5d64960c32c6fa074e1442ce (diff) | |
| download | rust-e8eb05cddd71f008300442a95140ee46fb9ed8ea.tar.gz rust-e8eb05cddd71f008300442a95140ee46fb9ed8ea.zip | |
Rollup merge of #40327 - GuillaumeGomez:macros-urls, r=frewsxcv
Add missing urls in some macros doc r? @frewsxcv
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/macros.rs | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 66a923f8e58..b22f7fa1707 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -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 @@ -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 @@ -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 /// /// ``` @@ -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 /// /// ``` @@ -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 @@ -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 /// /// ``` |
