diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-08-27 21:46:52 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-08-27 21:46:52 -0400 |
| commit | 1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f (patch) | |
| tree | 552fabade603ab0d148a49ae3cf1abd3f399740a /src/libstd/collections | |
| parent | 3ee047ae1ffab454270bc1859b3beef3556ef8f9 (diff) | |
| download | rust-1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f.tar.gz rust-1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f.zip | |
Implement generalized object and type parameter bounds (Fixes #16462)
Diffstat (limited to 'src/libstd/collections')
| -rw-r--r-- | src/libstd/collections/hashmap.rs | 22 |
1 files changed, 20 insertions, 2 deletions
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::<SafeHash>(), size_of::<u64>()) } - /// 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<K, V>, 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<K, V>, + idx: uint, + elems_seen: uint, + } + + /// Note: stage0-specific version that lacks bound. + #[cfg(stage0)] pub struct MutEntries<'a, K, V> { table: &'a mut RawTable<K, V>, 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<K, V>, + idx: uint, + elems_seen: uint, + } + /// Iterator over the entries in a table, consuming the table. pub struct MoveEntries<K, V> { table: RawTable<K, V>, |
