Skip to content

Commit ef0a52c

Browse files
committed
---
yaml --- r: 161019 b: refs/heads/try c: 61e53c9 h: refs/heads/master i: 161017: 356fd62 161015: 4c97b3e v: v3
1 parent c2fe3f8 commit ef0a52c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+363
-741
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c9f6d696420107f82304b992cf623b806995fe18
5-
refs/heads/try: 2f8da7bbd0cd6cab726a6658d5d7293f428b9dd3
5+
refs/heads/try: 61e53c94f26af678205fdf8b3fda1e466998a689
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/mk/cfg/arm-apple-ios

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CFG_LIB_NAME_arm-apple-ios = lib$(1).a
1313
CFG_LIB_GLOB_arm-apple-ios = lib$(1)-*.a
1414
CFG_STATIC_LIB_NAME_arm-apple-ios=lib$(1).a
1515
CFG_LIB_DSYM_GLOB_arm-apple-ios = lib$(1)-*.a.dSYM
16-
CFG_CFLAGS_arm-apple-ios := -arch armv7 -mfpu=vfp3 $(CFG_IOS_FLAGS)
16+
CFG_JEMALLOC_CFLAGS_arm-apple-ios := -arch armv7 -mfpu=vfp3 $(CFG_IOS_FLAGS)
1717
CFG_GCCISH_CFLAGS_arm-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS) -mfpu=vfp3 -arch armv7
1818
CFG_GCCISH_CXXFLAGS_arm-apple-ios := -fno-rtti $(CFG_IOS_FLAGS) -I$(CFG_IOS_SDK)/usr/include/c++/4.2.1
1919
CFG_GCCISH_LINK_FLAGS_arm-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK) -Wl,-no_compact_unwind

branches/try/mk/cfg/arm-linux-androideabi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_LIB_NAME_arm-linux-androideabi=lib$(1).so
77
CFG_STATIC_LIB_NAME_arm-linux-androideabi=lib$(1).a
88
CFG_LIB_GLOB_arm-linux-androideabi=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_arm-linux-androideabi=lib$(1)-*.dylib.dSYM
10-
CFG_CFLAGS_arm-linux-androideabi := -D__arm__ -DANDROID -D__ANDROID__ $(CFLAGS)
10+
CFG_JEMALLOC_CFLAGS_arm-linux-androideabi := -D__arm__ -DANDROID -D__ANDROID__ $(CFLAGS)
1111
CFG_GCCISH_CFLAGS_arm-linux-androideabi := -Wall -g -fPIC -D__arm__ -DANDROID -D__ANDROID__ $(CFLAGS)
1212
CFG_GCCISH_CXXFLAGS_arm-linux-androideabi := -fno-rtti $(CXXFLAGS)
1313
CFG_GCCISH_LINK_FLAGS_arm-linux-androideabi := -shared -fPIC -ldl -g -lm -lsupc++

branches/try/mk/cfg/arm-unknown-linux-gnueabi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CFG_LIB_NAME_arm-unknown-linux-gnueabi=lib$(1).so
88
CFG_STATIC_LIB_NAME_arm-unknown-linux-gnueabi=lib$(1).a
99
CFG_LIB_GLOB_arm-unknown-linux-gnueabi=lib$(1)-*.so
1010
CFG_LIB_DSYM_GLOB_arm-unknown-linux-gnueabi=lib$(1)-*.dylib.dSYM
11-
CFG_CFLAGS_arm-unknown-linux-gnueabi := -D__arm__ -mfpu=vfp $(CFLAGS)
11+
CFG_JEMALLOC_CFLAGS_arm-unknown-linux-gnueabi := -D__arm__ -mfpu=vfp $(CFLAGS)
1212
CFG_GCCISH_CFLAGS_arm-unknown-linux-gnueabi := -Wall -g -fPIC -D__arm__ -mfpu=vfp $(CFLAGS)
1313
CFG_GCCISH_CXXFLAGS_arm-unknown-linux-gnueabi := -fno-rtti $(CXXFLAGS)
1414
CFG_GCCISH_LINK_FLAGS_arm-unknown-linux-gnueabi := -shared -fPIC -g

branches/try/mk/cfg/arm-unknown-linux-gnueabihf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CFG_LIB_NAME_arm-unknown-linux-gnueabihf=lib$(1).so
88
CFG_STATIC_LIB_NAME_arm-unknown-linux-gnueabihf=lib$(1).a
99
CFG_LIB_GLOB_arm-unknown-linux-gnueabihf=lib$(1)-*.so
1010
CFG_LIB_DSYM_GLOB_arm-unknown-linux-gnueabihf=lib$(1)-*.dylib.dSYM
11-
CFG_CFLAGS_arm-unknown-linux-gnueabihf := -D__arm__ $(CFLAGS)
11+
CFG_JEMALLOC_CFLAGS_arm-unknown-linux-gnueabihf := -D__arm__ $(CFLAGS)
1212
CFG_GCCISH_CFLAGS_arm-unknown-linux-gnueabihf := -Wall -g -fPIC -D__arm__ $(CFLAGS)
1313
CFG_GCCISH_CXXFLAGS_arm-unknown-linux-gnueabihf := -fno-rtti $(CXXFLAGS)
1414
CFG_GCCISH_LINK_FLAGS_arm-unknown-linux-gnueabihf := -shared -fPIC -g

branches/try/mk/cfg/i386-apple-ios

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ CFG_LIB_NAME_i386-apple-ios = lib$(1).a
1313
CFG_LIB_GLOB_i386-apple-ios = lib$(1)-*.dylib
1414
CFG_STATIC_LIB_NAME_i386-apple-ios=lib$(1).a
1515
CFG_LIB_DSYM_GLOB_i386-apple-ios = lib$(1)-*.dylib.dSYM
16-
CFG_CFLAGS_i386-apple-ios = $(CFG_IOSSIM_FLAGS)
1716
CFG_GCCISH_CFLAGS_i386-apple-ios = -Wall -Werror -g -fPIC -m32 $(CFG_IOSSIM_FLAGS)
1817
CFG_GCCISH_CXXFLAGS_i386-apple-ios = -fno-rtti $(CFG_IOSSIM_FLAGS) -I$(CFG_IOSSIM_SDK)/usr/include/c++/4.2.1
1918
CFG_GCCISH_LINK_FLAGS_i386-apple-ios = -lpthread -Wl,-no_compact_unwind -m32 -Wl,-syslibroot $(CFG_IOSSIM_SDK)
@@ -30,5 +29,5 @@ CFG_PATH_MUNGE_i386-apple-ios = true
3029
CFG_LDPATH_i386-apple-ios =
3130
CFG_RUN_i386-apple-ios = $(2)
3231
CFG_RUN_TARG_i386-apple-ios = $(call CFG_RUN_i386-apple-ios,,$(2))
33-
CFG_JEMALLOC_CFLAGS_i386-apple-ios = -target i386-apple-ios -Wl,-syslibroot $(CFG_IOSSIM_SDK) -Wl,-no_compact_unwind
32+
CFG_JEMALLOC_CFLAGS_i386-apple-ios = $(CFG_IOSSIM_FLAGS) -target i386-apple-ios -Wl,-syslibroot $(CFG_IOSSIM_SDK) -Wl,-no_compact_unwind
3433
CFG_GNU_TRIPLE_i386-apple-ios := i386-apple-ios

branches/try/mk/cfg/i686-apple-darwin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_LIB_NAME_i686-apple-darwin=lib$(1).dylib
77
CFG_STATIC_LIB_NAME_i686-apple-darwin=lib$(1).a
88
CFG_LIB_GLOB_i686-apple-darwin=lib$(1)-*.dylib
99
CFG_LIB_DSYM_GLOB_i686-apple-darwin=lib$(1)-*.dylib.dSYM
10-
CFG_CFLAGS_i686-apple-darwin := -m32 -arch i386 $(CFLAGS)
10+
CFG_JEMALLOC_CFLAGS_i686-apple-darwin := -m32 -arch i386 $(CFLAGS)
1111
CFG_GCCISH_CFLAGS_i686-apple-darwin := -Wall -Werror -g -fPIC -m32 -arch i386 $(CFLAGS)
1212
CFG_GCCISH_CXXFLAGS_i686-apple-darwin := -fno-rtti $(CXXFLAGS)
1313
CFG_GCCISH_LINK_FLAGS_i686-apple-darwin := -dynamiclib -pthread -framework CoreServices -m32

branches/try/mk/cfg/i686-pc-windows-gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CFG_LIB_NAME_i686-pc-windows-gnu=$(1).dll
88
CFG_STATIC_LIB_NAME_i686-pc-windows-gnu=$(1).lib
99
CFG_LIB_GLOB_i686-pc-windows-gnu=$(1)-*.dll
1010
CFG_LIB_DSYM_GLOB_i686-pc-windows-gnu=$(1)-*.dylib.dSYM
11-
CFG_CFLAGS_i686-pc-windows-gnu := -march=i686 -m32 -D_WIN32_WINNT=0x0600 $(CFLAGS)
11+
CFG_JEMALLOC_CFLAGS_i686-pc-windows-gnu := -march=i686 -m32 -D_WIN32_WINNT=0x0600 $(CFLAGS)
1212
CFG_GCCISH_CFLAGS_i686-pc-windows-gnu := -Wall -Werror -g -m32 -D_WIN32_WINNT=0x0600 $(CFLAGS)
1313
CFG_GCCISH_CXXFLAGS_i686-pc-windows-gnu := -fno-rtti $(CXXFLAGS)
1414
CFG_GCCISH_LINK_FLAGS_i686-pc-windows-gnu := -shared -g -m32

branches/try/mk/cfg/i686-unknown-linux-gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_LIB_NAME_i686-unknown-linux-gnu=lib$(1).so
77
CFG_STATIC_LIB_NAME_i686-unknown-linux-gnu=lib$(1).a
88
CFG_LIB_GLOB_i686-unknown-linux-gnu=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_i686-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
10-
CFG_CFLAGS_i686-unknown-linux-gnu := -m32 $(CFLAGS)
10+
CFG_JEMALLOC_CFLAGS_i686-unknown-linux-gnu := -m32 $(CFLAGS)
1111
CFG_GCCISH_CFLAGS_i686-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
1212
CFG_GCCISH_CXXFLAGS_i686-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
1313
CFG_GCCISH_LINK_FLAGS_i686-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32

branches/try/mk/cfg/mips-unknown-linux-gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_LIB_NAME_mips-unknown-linux-gnu=lib$(1).so
77
CFG_STATIC_LIB_NAME_mips-unknown-linux-gnu=lib$(1).a
88
CFG_LIB_GLOB_mips-unknown-linux-gnu=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_mips-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
10-
CFG_CFLAGS_mips-unknown-linux-gnu := -mips32r2 -msoft-float -mabi=32 -mno-compact-eh $(CFLAGS)
10+
CFG_JEMALLOC_CFLAGS_mips-unknown-linux-gnu := -mips32r2 -msoft-float -mabi=32 -mno-compact-eh $(CFLAGS)
1111
CFG_GCCISH_CFLAGS_mips-unknown-linux-gnu := -Wall -g -fPIC -mips32r2 -msoft-float -mabi=32 -mno-compact-eh $(CFLAGS)
1212
CFG_GCCISH_CXXFLAGS_mips-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
1313
CFG_GCCISH_LINK_FLAGS_mips-unknown-linux-gnu := -shared -fPIC -g -mips32r2 -msoft-float -mabi=32

branches/try/mk/cfg/mipsel-unknown-linux-gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_LIB_NAME_mipsel-unknown-linux-gnu=lib$(1).so
77
CFG_STATIC_LIB_NAME_mipsel-unknown-linux-gnu=lib$(1).a
88
CFG_LIB_GLOB_mipsel-unknown-linux-gnu=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_mipsel-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
10-
CFG_CFLAGS_mipsel-unknown-linux-gnu := -mips32 -mabi=32 $(CFLAGS)
10+
CFG_JEMALLOC_CFLAGS_mipsel-unknown-linux-gnu := -mips32 -mabi=32 $(CFLAGS)
1111
CFG_GCCISH_CFLAGS_mipsel-unknown-linux-gnu := -Wall -g -fPIC -mips32 -mabi=32 $(CFLAGS)
1212
CFG_GCCISH_CXXFLAGS_mipsel-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
1313
CFG_GCCISH_LINK_FLAGS_mipsel-unknown-linux-gnu := -shared -fPIC -g -mips32

branches/try/mk/cfg/x86_64-apple-darwin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_LIB_NAME_x86_64-apple-darwin=lib$(1).dylib
77
CFG_STATIC_LIB_NAME_x86_64-apple-darwin=lib$(1).a
88
CFG_LIB_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib
99
CFG_LIB_DSYM_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib.dSYM
10-
CFG_CFLAGS_x86_64-apple-darwin := -m64 -arch x86_64 $(CFLAGS)
10+
CFG_JEMALLOC_CFLAGS_x86_64-apple-darwin := -m64 -arch x86_64 $(CFLAGS)
1111
CFG_GCCISH_CFLAGS_x86_64-apple-darwin := -Wall -Werror -g -fPIC -m64 -arch x86_64 $(CFLAGS)
1212
CFG_GCCISH_CXXFLAGS_x86_64-apple-darwin := -fno-rtti $(CXXFLAGS)
1313
CFG_GCCISH_LINK_FLAGS_x86_64-apple-darwin := -dynamiclib -pthread -framework CoreServices -m64

branches/try/mk/cfg/x86_64-pc-windows-gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CFG_LIB_NAME_x86_64-pc-windows-gnu=$(1).dll
88
CFG_STATIC_LIB_NAME_x86_64-pc-windows-gnu=$(1).lib
99
CFG_LIB_GLOB_x86_64-pc-windows-gnu=$(1)-*.dll
1010
CFG_LIB_DSYM_GLOB_x86_64-pc-windows-gnu=$(1)-*.dylib.dSYM
11-
CFG_CFLAGS_x86_64-pc-windows-gnu := -m64 -D_WIN32_WINNT=0x0600 $(CFLAGS)
11+
CFG_JEMALLOC_CFLAGS_x86_64-pc-windows-gnu := -m64 -D_WIN32_WINNT=0x0600 $(CFLAGS)
1212
CFG_GCCISH_CFLAGS_x86_64-pc-windows-gnu := -Wall -Werror -g -m64 -D_WIN32_WINNT=0x0600 $(CFLAGS)
1313
CFG_GCCISH_CXXFLAGS_x86_64-pc-windows-gnu := -fno-rtti $(CXXFLAGS)
1414
CFG_GCCISH_LINK_FLAGS_x86_64-pc-windows-gnu := -shared -g -m64

branches/try/mk/cfg/x86_64-unknown-dragonfly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_LIB_NAME_x86_64-unknown-dragonfly=lib$(1).so
77
CFG_STATIC_LIB_NAME_x86_64-unknown-dragonfly=lib$(1).a
88
CFG_LIB_GLOB_x86_64-unknown-dragonfly=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_x86_64-unknown-dragonfly=$(1)-*.dylib.dSYM
10-
CFG_CFLAGS_x86_64-unknown-dragonfly := -I/usr/include -I/usr/local/include $(CFLAGS)
10+
CFG_JEMALLOC_CFLAGS_x86_64-unknown-dragonfly := -I/usr/include -I/usr/local/include $(CFLAGS)
1111
CFG_GCCISH_CFLAGS_x86_64-unknown-dragonfly := -Wall -Werror -g -fPIC -I/usr/include -I/usr/local/include $(CFLAGS)
1212
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-dragonfly := -shared -fPIC -g -pthread -lrt
1313
CFG_GCCISH_DEF_FLAG_x86_64-unknown-dragonfly := -Wl,--export-dynamic,--dynamic-list=

branches/try/mk/cfg/x86_64-unknown-freebsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_LIB_NAME_x86_64-unknown-freebsd=lib$(1).so
77
CFG_STATIC_LIB_NAME_x86_64-unknown-freebsd=lib$(1).a
88
CFG_LIB_GLOB_x86_64-unknown-freebsd=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_x86_64-unknown-freebsd=$(1)-*.dylib.dSYM
10-
CFG_CFLAGS_x86_64-unknown-freebsd := -I/usr/local/include $(CFLAGS)
10+
CFG_JEMALLOC_CFLAGS_x86_64-unknown-freebsd := -I/usr/local/include $(CFLAGS)
1111
CFG_GCCISH_CFLAGS_x86_64-unknown-freebsd := -Wall -Werror -g -fPIC -I/usr/local/include $(CFLAGS)
1212
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-freebsd := -shared -fPIC -g -pthread -lrt
1313
CFG_GCCISH_DEF_FLAG_x86_64-unknown-freebsd := -Wl,--export-dynamic,--dynamic-list=

branches/try/mk/cfg/x86_64-unknown-linux-gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CFG_LIB_NAME_x86_64-unknown-linux-gnu=lib$(1).so
77
CFG_STATIC_LIB_NAME_x86_64-unknown-linux-gnu=lib$(1).a
88
CFG_LIB_GLOB_x86_64-unknown-linux-gnu=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_x86_64-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
10-
CFG_CFLAGS_x86_64-unknown-linux-gnu := -m64
10+
CFG_JEMALLOC_CFLAGS_x86_64-unknown-linux-gnu := -m64
1111
CFG_GCCISH_CFLAGS_x86_64-unknown-linux-gnu := -Wall -Werror -g -fPIC -m64
1212
CFG_GCCISH_CXXFLAGS_x86_64-unknown-linux-gnu := -fno-rtti
1313
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m64

branches/try/src/doc/reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ r##"foo #"# bar"##; // foo #"# bar
304304
#### Byte and byte string literals
305305

306306
```{.ebnf .gram}
307-
byte_lit : "b\x27" byte_body '\x27' ;
308-
byte_string_lit : "b\x22" string_body * '\x22' | "br" raw_byte_string ;
307+
byte_lit : 'b' '\x27' byte_body '\x27' ;
308+
byte_string_lit : 'b' '"' string_body * '"' | 'b' 'r' raw_byte_string ;
309309
310310
byte_body : ascii_non_single_quote
311311
| '\x5c' [ '\x27' | common_escape ] ;
@@ -381,10 +381,10 @@ num_suffix : int_suffix | float_suffix ;
381381
382382
int_suffix : 'u' int_suffix_size ?
383383
| 'i' int_suffix_size ? ;
384-
int_suffix_size : [ '8' | "16" | "32" | "64" ] ;
384+
int_suffix_size : [ '8' | '1' '6' | '3' '2' | '6' '4' ] ;
385385
386386
float_suffix : [ exponent | '.' dec_lit exponent ? ] ? float_suffix_ty ? ;
387-
float_suffix_ty : 'f' [ "32" | "64" ] ;
387+
float_suffix_ty : 'f' [ '3' '2' | '6' '4' ] ;
388388
exponent : ['E' | 'e'] ['-' | '+' ] ? dec_lit ;
389389
dec_lit : [ dec_digit | '_' ] + ;
390390
```
@@ -1862,7 +1862,7 @@ the namespace hierarchy as it normally would.
18621862
## Attributes
18631863

18641864
```{.ebnf .gram}
1865-
attribute : "#!" ? '[' meta_item ']' ;
1865+
attribute : '#' '!' ? '[' meta_item ']' ;
18661866
meta_item : ident [ '=' literal
18671867
| '(' meta_seq ')' ] ? ;
18681868
meta_seq : meta_item [ ',' meta_seq ] ? ;

branches/try/src/grammar/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, Token>) -> TokenAndSpan {
178178
let toknum = m.name("toknum");
179179
let content = m.name("content");
180180

181-
let proto_tok = tokens.get(&toknum).expect(format!("didn't find token {} in the map",
181+
let proto_tok = tokens.find_equiv(&toknum).expect(format!("didn't find token {} in the map",
182182
toknum).as_slice());
183183

184184
let nm = parse::token::intern(content);

branches/try/src/libcollections/bit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl Bitv {
283283
x != 0
284284
}
285285

286-
/// Sets the value of a bit at an index `i`.
286+
/// Sets the value of a bit at a index `i`.
287287
///
288288
/// # Panics
289289
///
@@ -582,7 +582,7 @@ impl Bitv {
582582
///
583583
/// # Panics
584584
///
585-
/// Panics if the `Bitv` and slice are of different length.
585+
/// Panics if the the `Bitv` and slice are of different length.
586586
///
587587
/// # Example
588588
///

branches/try/src/libcollections/btree/map.rs

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use core::prelude::*;
2121

2222
use self::StackOp::*;
2323
use super::node::*;
24-
use core::borrow::BorrowFrom;
2524
use std::hash::{Writer, Hash};
2625
use core::default::Default;
2726
use core::{iter, fmt, mem};
@@ -57,7 +56,7 @@ use ring_buf::RingBuf;
5756
/// and possibly other factors. Using linear search, searching for a random element is expected
5857
/// to take O(B log<sub>B</sub>n) comparisons, which is generally worse than a BST. In practice,
5958
/// however, performance is excellent. `BTreeMap` is able to readily outperform `TreeMap` under
60-
/// many workloads, and is competitive where it doesn't. BTreeMap also generally *scales* better
59+
/// many workloads, and is competetive where it doesn't. BTreeMap also generally *scales* better
6160
/// than TreeMap, making it more appropriate for large datasets.
6261
///
6362
/// However, `TreeMap` may still be more appropriate to use in many contexts. If elements are very
@@ -185,9 +184,6 @@ impl<K: Ord, V> BTreeMap<K, V> {
185184

186185
/// Returns a reference to the value corresponding to the key.
187186
///
188-
/// The key may be any borrowed form of the map's key type, but the ordering
189-
/// on the borrowed form *must* match the ordering on the key type.
190-
///
191187
/// # Example
192188
///
193189
/// ```
@@ -199,7 +195,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
199195
/// assert_eq!(map.get(&2), None);
200196
/// ```
201197
#[unstable = "matches collection reform specification, waiting for dust to settle"]
202-
pub fn get<Sized? Q>(&self, key: &Q) -> Option<&V> where Q: BorrowFrom<K> + Ord {
198+
pub fn get(&self, key: &K) -> Option<&V> {
203199
let mut cur_node = &self.root;
204200
loop {
205201
match cur_node.search(key) {
@@ -217,9 +213,6 @@ impl<K: Ord, V> BTreeMap<K, V> {
217213

218214
/// Returns true if the map contains a value for the specified key.
219215
///
220-
/// The key may be any borrowed form of the map's key type, but the ordering
221-
/// on the borrowed form *must* match the ordering on the key type.
222-
///
223216
/// # Example
224217
///
225218
/// ```
@@ -231,7 +224,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
231224
/// assert_eq!(map.contains_key(&2), false);
232225
/// ```
233226
#[unstable = "matches collection reform specification, waiting for dust to settle"]
234-
pub fn contains_key<Sized? Q>(&self, key: &Q) -> bool where Q: BorrowFrom<K> + Ord {
227+
pub fn contains_key(&self, key: &K) -> bool {
235228
self.get(key).is_some()
236229
}
237230

@@ -243,9 +236,6 @@ impl<K: Ord, V> BTreeMap<K, V> {
243236

244237
/// Returns a mutable reference to the value corresponding to the key.
245238
///
246-
/// The key may be any borrowed form of the map's key type, but the ordering
247-
/// on the borrowed form *must* match the ordering on the key type.
248-
///
249239
/// # Example
250240
///
251241
/// ```
@@ -261,7 +251,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
261251
/// ```
262252
// See `get` for implementation notes, this is basically a copy-paste with mut's added
263253
#[unstable = "matches collection reform specification, waiting for dust to settle"]
264-
pub fn get_mut<Sized? Q>(&mut self, key: &Q) -> Option<&mut V> where Q: BorrowFrom<K> + Ord {
254+
pub fn get_mut(&mut self, key: &K) -> Option<&mut V> {
265255
// temp_node is a Borrowck hack for having a mutable value outlive a loop iteration
266256
let mut temp_node = &mut self.root;
267257
loop {
@@ -420,9 +410,6 @@ impl<K: Ord, V> BTreeMap<K, V> {
420410
/// Removes a key from the map, returning the value at the key if the key
421411
/// was previously in the map.
422412
///
423-
/// The key may be any borrowed form of the map's key type, but the ordering
424-
/// on the borrowed form *must* match the ordering on the key type.
425-
///
426413
/// # Example
427414
///
428415
/// ```
@@ -434,7 +421,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
434421
/// assert_eq!(map.remove(&1), None);
435422
/// ```
436423
#[unstable = "matches collection reform specification, waiting for dust to settle"]
437-
pub fn remove<Sized? Q>(&mut self, key: &Q) -> Option<V> where Q: BorrowFrom<K> + Ord {
424+
pub fn remove(&mut self, key: &K) -> Option<V> {
438425
// See `swap` for a more thorough description of the stuff going on in here
439426
let mut stack = stack::PartialSearchStack::new(self);
440427
loop {
@@ -803,18 +790,14 @@ impl<K: Show, V: Show> Show for BTreeMap<K, V> {
803790
}
804791
}
805792

806-
impl<K: Ord, Sized? Q, V> Index<Q, V> for BTreeMap<K, V>
807-
where Q: BorrowFrom<K> + Ord
808-
{
809-
fn index(&self, key: &Q) -> &V {
793+
impl<K: Ord, V> Index<K, V> for BTreeMap<K, V> {
794+
fn index(&self, key: &K) -> &V {
810795
self.get(key).expect("no entry found for key")
811796
}
812797
}
813798

814-
impl<K: Ord, Sized? Q, V> IndexMut<Q, V> for BTreeMap<K, V>
815-
where Q: BorrowFrom<K> + Ord
816-
{
817-
fn index_mut(&mut self, key: &Q) -> &mut V {
799+
impl<K: Ord, V> IndexMut<K, V> for BTreeMap<K, V> {
800+
fn index_mut(&mut self, key: &K) -> &mut V {
818801
self.get_mut(key).expect("no entry found for key")
819802
}
820803
}

branches/try/src/libcollections/btree/node.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use core::prelude::*;
1919

2020
use core::{slice, mem, ptr};
2121
use core::iter::Zip;
22-
use core::borrow::BorrowFrom;
2322

2423
use vec;
2524
use vec::Vec;
@@ -48,7 +47,7 @@ pub struct Node<K, V> {
4847
// theory, if we take full control of allocation like HashMap's RawTable does,
4948
// and restrict leaves to max size 256 (not unreasonable for a btree node) we can cut
5049
// this down to just (ptr, cap: u8, size: u8, is_leaf: bool). With generic
51-
// integer arguments, cap can even move into the type, reducing this just to
50+
// integer arguments, cap can even move into the the type, reducing this just to
5251
// (ptr, size, is_leaf). This could also have cache benefits for very small nodes, as keys
5352
// could bleed into edges and vals.
5453
//
@@ -74,19 +73,19 @@ impl<K: Ord, V> Node<K, V> {
7473
/// Searches for the given key in the node. If it finds an exact match,
7574
/// `Found` will be yielded with the matching index. If it doesn't find an exact match,
7675
/// `GoDown` will be yielded with the index of the subtree the key must lie in.
77-
pub fn search<Sized? Q>(&self, key: &Q) -> SearchResult where Q: BorrowFrom<K> + Ord {
76+
pub fn search(&self, key: &K) -> SearchResult {
7877
// FIXME(Gankro): Tune when to search linear or binary based on B (and maybe K/V).
7978
// For the B configured as of this writing (B = 6), binary search was *significantly*
8079
// worse for uints.
8180
self.search_linear(key)
8281
}
8382

84-
fn search_linear<Sized? Q>(&self, key: &Q) -> SearchResult where Q: BorrowFrom<K> + Ord {
83+
fn search_linear(&self, key: &K) -> SearchResult {
8584
for (i, k) in self.keys.iter().enumerate() {
86-
match key.cmp(BorrowFrom::borrow_from(k)) {
87-
Greater => {},
85+
match k.cmp(key) {
86+
Less => {},
8887
Equal => return Found(i),
89-
Less => return GoDown(i),
88+
Greater => return GoDown(i),
9089
}
9190
}
9291
GoDown(self.len())

0 commit comments

Comments
 (0)