about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-02-16 23:11:09 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-02-19 01:30:52 -0800
commit429ef870f67b02664b6ac35b08f3b36b71e8bd00 (patch)
tree8c8f3e359d1ca2b7cbb6ec24a14deef66af28a2e /src/libstd
parentcac9107f38c1d28ed263759040b5411b0db47824 (diff)
downloadrust-429ef870f67b02664b6ac35b08f3b36b71e8bd00.tar.gz
rust-429ef870f67b02664b6ac35b08f3b36b71e8bd00.zip
rustdoc: Handle links to reexported items
When building up our path cache, we don't plaster over a path which was
previously inserted if we're inserting a non-public-item thing.

Closes #11678
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/macros.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index 49cf10c47cb..34b33003786 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -130,6 +130,7 @@ macro_rules! log_enabled(
 /// # Example
 ///
 /// ```should_fail
+/// # #[allow(unreachable_code)];
 /// fail!();
 /// fail!("this is a terrible mistake!");
 /// fail!(4); // fail with the value of 4 to be collected elsewhere
@@ -228,13 +229,15 @@ macro_rules! assert_eq(
 /// # Example
 ///
 /// ~~~rust
+/// struct Item { weight: uint }
+///
 /// fn choose_weighted_item(v: &[Item]) -> Item {
 ///     assert!(!v.is_empty());
 ///     let mut so_far = 0u;
 ///     for item in v.iter() {
 ///         so_far += item.weight;
 ///         if so_far > 100 {
-///             return item;
+///             return *item;
 ///         }
 ///     }
 ///     // The above loop always returns, so we must hint to the
@@ -336,7 +339,7 @@ macro_rules! println(
 /// local_data_key!(my_integer: int)
 ///
 /// local_data::set(my_integer, 2);
-/// local_data::get(my_integer, |val| println!("{}", val));
+/// local_data::get(my_integer, |val| println!("{}", val.map(|i| *i)));
 /// ```
 #[macro_export]
 macro_rules! local_data_key(