@@ -130,7 +130,7 @@ pub struct Values<'a, K: 'a, V: 'a> {
130130
131131#[ stable]
132132/// A view into a single entry in a map, which may either be vacant or occupied.
133- pub enum Entry < ' a , Sized ? Q : ' a , K : ' a , V : ' a > {
133+ pub enum Entry < ' a , Q : ? Sized + ' a , K : ' a , V : ' a > {
134134 /// A vacant Entry
135135 Vacant ( VacantEntry < ' a , Q , K , V > ) ,
136136 /// An occupied Entry
@@ -139,7 +139,7 @@ pub enum Entry<'a, Sized? Q:'a, K:'a, V:'a> {
139139
140140#[ stable]
141141/// A vacant Entry.
142- pub struct VacantEntry < ' a , Sized ? Q : ' a , K : ' a , V : ' a > {
142+ pub struct VacantEntry < ' a , Q : ? Sized + ' a , K : ' a , V : ' a > {
143143 key : & ' a Q ,
144144 stack : stack:: SearchStack < ' a , K , V , node:: handle:: Edge , node:: handle:: Leaf > ,
145145}
@@ -214,7 +214,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
214214 /// assert_eq!(map.get(&2), None);
215215 /// ```
216216 #[ stable]
217- pub fn get < Sized ? Q > ( & self , key : & Q ) -> Option < & V > where Q : BorrowFrom < K > + Ord {
217+ pub fn get < Q : ? Sized > ( & self , key : & Q ) -> Option < & V > where Q : BorrowFrom < K > + Ord {
218218 let mut cur_node = & self . root ;
219219 loop {
220220 match Node :: search ( cur_node, key) {
@@ -246,7 +246,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
246246 /// assert_eq!(map.contains_key(&2), false);
247247 /// ```
248248 #[ stable]
249- pub fn contains_key < Sized ? Q > ( & self , key : & Q ) -> bool where Q : BorrowFrom < K > + Ord {
249+ pub fn contains_key < Q : ? Sized > ( & self , key : & Q ) -> bool where Q : BorrowFrom < K > + Ord {
250250 self . get ( key) . is_some ( )
251251 }
252252
@@ -270,7 +270,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
270270 /// ```
271271 // See `get` for implementation notes, this is basically a copy-paste with mut's added
272272 #[ stable]
273- pub fn get_mut < Sized ? Q > ( & mut self , key : & Q ) -> Option < & mut V > where Q : BorrowFrom < K > + Ord {
273+ pub fn get_mut < Q : ? Sized > ( & mut self , key : & Q ) -> Option < & mut V > where Q : BorrowFrom < K > + Ord {
274274 // temp_node is a Borrowck hack for having a mutable value outlive a loop iteration
275275 let mut temp_node = & mut self . root ;
276276 loop {
@@ -440,7 +440,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
440440 /// assert_eq!(map.remove(&1), None);
441441 /// ```
442442 #[ stable]
443- pub fn remove < Sized ? Q > ( & mut self , key : & Q ) -> Option < V > where Q : BorrowFrom < K > + Ord {
443+ pub fn remove < Q : ? Sized > ( & mut self , key : & Q ) -> Option < V > where Q : BorrowFrom < K > + Ord {
444444 // See `swap` for a more thorough description of the stuff going on in here
445445 let mut stack = stack:: PartialSearchStack :: new ( self ) ;
446446 loop {
@@ -880,7 +880,7 @@ impl<K: Show, V: Show> Show for BTreeMap<K, V> {
880880// NOTE(stage0): remove impl after a snapshot
881881#[ cfg( stage0) ]
882882#[ stable]
883- impl < K : Ord , Sized ? Q , V > Index < Q , V > for BTreeMap < K , V >
883+ impl < K : Ord , Q : ? Sized , V > Index < Q , V > for BTreeMap < K , V >
884884 where Q : BorrowFrom < K > + Ord
885885{
886886 fn index ( & self , key : & Q ) -> & V {
@@ -890,7 +890,7 @@ impl<K: Ord, Sized? Q, V> Index<Q, V> for BTreeMap<K, V>
890890
891891#[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
892892#[ stable]
893- impl < K : Ord , Sized ? Q , V > Index < Q > for BTreeMap < K , V >
893+ impl < K : Ord , Q : ? Sized , V > Index < Q > for BTreeMap < K , V >
894894 where Q : BorrowFrom < K > + Ord
895895{
896896 type Output = V ;
@@ -903,7 +903,7 @@ impl<K: Ord, Sized? Q, V> Index<Q> for BTreeMap<K, V>
903903// NOTE(stage0): remove impl after a snapshot
904904#[ cfg( stage0) ]
905905#[ stable]
906- impl < K : Ord , Sized ? Q , V > IndexMut < Q , V > for BTreeMap < K , V >
906+ impl < K : Ord , Q : ? Sized , V > IndexMut < Q , V > for BTreeMap < K , V >
907907 where Q : BorrowFrom < K > + Ord
908908{
909909 fn index_mut ( & mut self , key : & Q ) -> & mut V {
@@ -913,7 +913,7 @@ impl<K: Ord, Sized? Q, V> IndexMut<Q, V> for BTreeMap<K, V>
913913
914914#[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
915915#[ stable]
916- impl < K : Ord , Sized ? Q , V > IndexMut < Q > for BTreeMap < K , V >
916+ impl < K : Ord , Q : ? Sized , V > IndexMut < Q > for BTreeMap < K , V >
917917 where Q : BorrowFrom < K > + Ord
918918{
919919 type Output = V ;
@@ -1135,7 +1135,7 @@ impl<'a, K, V> DoubleEndedIterator for Values<'a, K, V> {
11351135#[ stable]
11361136impl < ' a , K , V > ExactSizeIterator for Values < ' a , K , V > { }
11371137
1138- impl < ' a , Sized ? Q , K : Ord , V > Entry < ' a , Q , K , V > {
1138+ impl < ' a , Q : ? Sized , K : Ord , V > Entry < ' a , Q , K , V > {
11391139 #[ unstable = "matches collection reform v2 specification, waiting for dust to settle" ]
11401140 /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
11411141 pub fn get ( self ) -> Result < & ' a mut V , VacantEntry < ' a , Q , K , V > > {
@@ -1146,7 +1146,7 @@ impl<'a, Sized? Q, K: Ord, V> Entry<'a, Q, K, V> {
11461146 }
11471147}
11481148
1149- impl < ' a , Sized ? Q : ToOwned < K > , K : Ord , V > VacantEntry < ' a , Q , K , V > {
1149+ impl < ' a , Q : ? Sized + ToOwned < K > , K : Ord , V > VacantEntry < ' a , Q , K , V > {
11501150 #[ stable]
11511151 /// Sets the value of the entry with the VacantEntry's key,
11521152 /// and returns a mutable reference to it.
@@ -1386,7 +1386,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
13861386 /// ```
13871387 /// The key must have the same ordering before or after `.to_owned()` is called.
13881388 #[ stable]
1389- pub fn entry < ' a , Sized ? Q > ( & ' a mut self , mut key : & ' a Q ) -> Entry < ' a , Q , K , V >
1389+ pub fn entry < ' a , Q : ? Sized > ( & ' a mut self , mut key : & ' a Q ) -> Entry < ' a , Q , K , V >
13901390 where Q : Ord + ToOwned < K >
13911391 {
13921392 // same basic logic of `swap` and `pop`, blended together
0 commit comments