From 4b692919853993fba90d06507be2b6ea43fe6044 Mon Sep 17 00:00:00 2001 From: Kenny Goodin Date: Mon, 9 Sep 2019 20:01:17 -0400 Subject: [PATCH 1/2] Expand upper bounds on RangeBounds impls --- src/libcore/ops/range.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcore/ops/range.rs b/src/libcore/ops/range.rs index 1b4c4218cc15b..9995b4f9ef54a 100644 --- a/src/libcore/ops/range.rs +++ b/src/libcore/ops/range.rs @@ -884,7 +884,7 @@ impl<'a, T: ?Sized + 'a> RangeBounds for (Bound<&'a T>, Bound<&'a T>) { } #[stable(feature = "collections_range", since = "1.28.0")] -impl RangeBounds for RangeFrom<&T> { +impl RangeBounds for RangeFrom<&T> { fn start_bound(&self) -> Bound<&T> { Included(self.start) } @@ -894,7 +894,7 @@ impl RangeBounds for RangeFrom<&T> { } #[stable(feature = "collections_range", since = "1.28.0")] -impl RangeBounds for RangeTo<&T> { +impl RangeBounds for RangeTo<&T> { fn start_bound(&self) -> Bound<&T> { Unbounded } @@ -904,7 +904,7 @@ impl RangeBounds for RangeTo<&T> { } #[stable(feature = "collections_range", since = "1.28.0")] -impl RangeBounds for Range<&T> { +impl RangeBounds for Range<&T> { fn start_bound(&self) -> Bound<&T> { Included(self.start) } From c1539abef880f11765a179148edec12d73b16f42 Mon Sep 17 00:00:00 2001 From: Kenny Goodin Date: Tue, 10 Sep 2019 20:49:48 -0400 Subject: [PATCH 2/2] Fix doctest, add now-needed turbofish --- src/liballoc/collections/btree/map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liballoc/collections/btree/map.rs b/src/liballoc/collections/btree/map.rs index 1683b8105567f..b71a9035c19e5 100644 --- a/src/liballoc/collections/btree/map.rs +++ b/src/liballoc/collections/btree/map.rs @@ -845,7 +845,7 @@ impl BTreeMap { /// .iter() /// .map(|&s| (s, 0)) /// .collect(); - /// for (_, balance) in map.range_mut("B".."Cheryl") { + /// for (_, balance) in map.range_mut::("B".."Cheryl") { /// *balance += 100; /// } /// for (name, balance) in &map {