diff options
| author | varkor <github@varkor.com> | 2018-01-18 17:49:32 +0000 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2018-01-18 17:49:32 +0000 |
| commit | 91668fbf230b388330da9591ba310c7e35ef9611 (patch) | |
| tree | 762e24924cf1132af290d89ed5fd90250d4fd596 /src/libcore | |
| parent | fdfb964a821a2f61353146629977eecafc0aa947 (diff) | |
Make example no_run
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/iter/iterator.rs | 2 | ||||
| -rw-r--r-- | src/libcore/iter/mod.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index 209a22d534a..da9af214207 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -24,7 +24,7 @@ fn _assert_is_object_safe(_: &Iterator<Item=()>) {} /// This is the main iterator trait. For more about the concept of iterators /// generally, please see the [module-level documentation]. In particular, you /// may want to know how to [implement `Iterator`][impl]. -/// +/// /// Note: Methods on infinite iterators that generally require traversing every /// element to produce a result may not terminate, even on traits for which a /// result is determinable in finite time. diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs index 3a5a72d1b87..ae10ac385ab 100644 --- a/src/libcore/iter/mod.rs +++ b/src/libcore/iter/mod.rs @@ -297,14 +297,14 @@ //! ``` //! //! This will print the numbers `0` through `4`, each on their own line. -//! +//! //! Bear in mind that methods on infinite iterators, even those for which a //! result can be computed in finite time, may not terminate. Specifically, //! methods such as [`min`], which in the general case require traversing //! every element in the iterator, are likely never to terminate for any //! infinite iterators. -//! -//! ``` +//! +//! ```no_run //! let positives = 1..; //! let least = positives.min().unwrap(); // Oh no! An infinite loop! //! // `positives.min` causes an infinite loop, so we won't reach this point! |
