We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
..
1 parent 11f8805 commit 377ae44Copy full SHA for 377ae44
src/libcore/ops.rs
@@ -1463,15 +1463,17 @@ pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
1463
/// # Examples
1464
///
1465
/// ```
1466
-/// fn main() {
1467
-/// assert_eq!((..), std::ops::RangeFull);
+/// assert_eq!((..), std::ops::RangeFull);
1468
1469
-/// let arr = [0, 1, 2, 3];
1470
-/// assert_eq!(arr[ .. ], [0,1,2,3]); // RangeFull
1471
-/// assert_eq!(arr[ ..3], [0,1,2 ]);
1472
-/// assert_eq!(arr[1.. ], [ 1,2,3]);
1473
-/// assert_eq!(arr[1..3], [ 1,2 ]);
1474
-/// }
+/// // for i in .. {
+/// // println!("This errors because .. has no Iterator impl");
+/// // }
+///
+/// let arr = [0, 1, 2, 3];
+/// assert_eq!(arr[ .. ], [0,1,2,3]); // RangeFull
+/// assert_eq!(arr[ ..3], [0,1,2 ]);
1475
+/// assert_eq!(arr[1.. ], [ 1,2,3]);
1476
+/// assert_eq!(arr[1..3], [ 1,2 ]);
1477
1478
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
1479
#[stable(feature = "rust1", since = "1.0.0")]
0 commit comments