diff options
| author | bors <bors@rust-lang.org> | 2013-05-10 01:55:54 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-10 01:55:54 -0700 |
| commit | e9d0018abf8dd0c692db4cfe8f5d1bd1c150d643 (patch) | |
| tree | f52065d76f022ca0afe150daaa63c9ddc9157060 /src/libsyntax/parse/mod.rs | |
| parent | f04eb37c7ea19bbd2cff12d15816873e0a46fc86 (diff) | |
| parent | 1393c3a3f438c896083405dca501c8cf05767c65 (diff) | |
| download | rust-e9d0018abf8dd0c692db4cfe8f5d1bd1c150d643.tar.gz rust-e9d0018abf8dd0c692db4cfe8f5d1bd1c150d643.zip | |
auto merge of #6356 : dotdash/rust/strinterner, r=pcwalton
&str can be turned into @~str on demand, using to_owned(), so for strings, we can create a specialized interner that accepts &str for intern() and find() but stores and returns @~str.
Diffstat (limited to 'src/libsyntax/parse/mod.rs')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 0708b65864e..ce41d377346 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -375,13 +375,13 @@ mod test { assert!(i.len() < 100); for int::range(0,100-((i.len()).to_int())) |_dc| { - i.gensym(@~"dontcare"); + i.gensym("dontcare"); } - i.intern(@~"a"); - i.intern(@~"b"); - i.intern(@~"c"); - i.intern(@~"d"); - i.intern(@~"return"); + i.intern("a"); + i.intern("b"); + i.intern("c"); + i.intern("d"); + i.intern("return"); assert!(i.get(ast::ident{repr:101,ctxt:0}) == @~"b"); i } |
