From 1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 27 Aug 2014 21:46:52 -0400 Subject: Implement generalized object and type parameter bounds (Fixes #16462) --- src/libstd/collections/hashmap.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/libstd/collections') diff --git a/src/libstd/collections/hashmap.rs b/src/libstd/collections/hashmap.rs index b8f8bd41a2d..714712d9eba 100644 --- a/src/libstd/collections/hashmap.rs +++ b/src/libstd/collections/hashmap.rs @@ -409,20 +409,38 @@ mod table { assert_eq!(size_of::(), size_of::()) } - /// Iterator over shared references to entries in a table. + /// Note: stage0-specific version that lacks bound. + #[cfg(stage0)] pub struct Entries<'a, K, V> { table: &'a RawTable, idx: uint, elems_seen: uint, } - /// Iterator over mutable references to entries in a table. + /// Iterator over shared references to entries in a table. + #[cfg(not(stage0))] + pub struct Entries<'a, K:'a, V:'a> { + table: &'a RawTable, + idx: uint, + elems_seen: uint, + } + + /// Note: stage0-specific version that lacks bound. + #[cfg(stage0)] pub struct MutEntries<'a, K, V> { table: &'a mut RawTable, idx: uint, elems_seen: uint, } + /// Iterator over mutable references to entries in a table. + #[cfg(not(stage0))] + pub struct MutEntries<'a, K:'a, V:'a> { + table: &'a mut RawTable, + idx: uint, + elems_seen: uint, + } + /// Iterator over the entries in a table, consuming the table. pub struct MoveEntries { table: RawTable, -- cgit 1.4.1-3-g733a5