Skip to content

Commit 6b43c0c

Browse files
committed
Stop parsing old operator overloading syntax
1 parent 2e1b98d commit 6b43c0c

File tree

11 files changed

+3
-105
lines changed

11 files changed

+3
-105
lines changed

src/libcore/at_vec.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,6 @@ pure fn from_elem<T: copy>(n_elts: uint, t: T) -> @[T] {
123123
}
124124
}
125125

126-
impl<T: copy> @[T]: vec_concat<T> {
127-
#[inline(always)]
128-
pure fn +(rhs: &[const T]) -> @[T] {
129-
append(self, rhs)
130-
}
131-
}
132-
133126
#[cfg(notest)]
134127
impl<T: copy> @[T]: add<&[const T],@[T]> {
135128
#[inline(always)]

src/libcore/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import path = path::path;
88
import tuple::{tuple_ops, extended_tuple_ops};
99
import str::{str_slice, unique_str};
1010
import vec::{const_vector, copyable_vector, immutable_vector};
11-
import vec::{immutable_copyable_vector, iter_trait_extensions, vec_concat};
11+
import vec::{immutable_copyable_vector, iter_trait_extensions};
1212
import iter::{base_iter, extended_iter, copyable_iter, times, timesi};
1313
import num::num;
1414
import ptr::ptr;
@@ -21,7 +21,7 @@ export num, times, timesi;
2121
// The following exports are the common traits
2222
export str_slice, unique_str;
2323
export const_vector, copyable_vector, immutable_vector;
24-
export immutable_copyable_vector, iter_trait_extensions, vec_concat;
24+
export immutable_copyable_vector, iter_trait_extensions;
2525
export base_iter, copyable_iter, extended_iter;
2626
export tuple_ops, extended_tuple_ops;
2727
export ptr;

src/libcore/dvec.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,6 @@ impl<A: copy> dvec<A> {
256256
}
257257
}
258258
259-
/// Copy out an individual element
260-
#[inline(always)]
261-
pure fn [](idx: uint) -> A {
262-
self.get_elt(idx)
263-
}
264-
265259
/// Copy out an individual element
266260
#[inline(always)]
267261
pure fn get_elt(idx: uint) -> A {

src/libcore/send_map.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,6 @@ mod linear {
275275
option::unwrap(value)
276276
}
277277

278-
fn [](k: &K) -> V {
279-
self.get(k)
280-
}
281278
}
282279

283280
impl<K,V> &linear_map<K,V> {

src/libcore/str.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,12 +1911,6 @@ impl ~str: unique_str {
19111911
/// Returns a string with trailing whitespace removed
19121912
#[inline]
19131913
fn trim_right() -> ~str { trim_right(self) }
1914-
1915-
/// Concatenate two strings: operator version
1916-
#[inline(always)]
1917-
pure fn +(rhs: &str) -> ~str {
1918-
append(self, rhs)
1919-
}
19201914
}
19211915

19221916
#[cfg(notest)]

src/libcore/vec.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,17 +1289,6 @@ pure fn as_mut_buf<T,U>(s: &[mut T],
12891289
}
12901290
}
12911291

1292-
trait vec_concat<T> {
1293-
pure fn +(rhs: &[const T]) -> self;
1294-
}
1295-
1296-
impl<T: copy> ~[T]: vec_concat<T> {
1297-
#[inline(always)]
1298-
pure fn +(rhs: &[const T]) -> ~[T] {
1299-
append(self, rhs)
1300-
}
1301-
}
1302-
13031292
#[cfg(notest)]
13041293
impl<T: copy> ~[T]: add<&[const T],~[T]> {
13051294
#[inline(always)]
@@ -1308,13 +1297,6 @@ impl<T: copy> ~[T]: add<&[const T],~[T]> {
13081297
}
13091298
}
13101299

1311-
impl<T: copy> ~[mut T]: vec_concat<T> {
1312-
#[inline(always)]
1313-
pure fn +(rhs: &[const T]) -> ~[mut T] {
1314-
append_mut(self, rhs)
1315-
}
1316-
}
1317-
13181300
impl<T: copy> ~[mut T]: add<&[const T],~[mut T]> {
13191301
#[inline(always)]
13201302
pure fn add(rhs: &[const T]) -> ~[mut T] {

src/libstd/ebml.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ type doc = {data: @~[u8], start: uint, end: uint};
4242

4343
type tagged_doc = {tag: uint, doc: doc};
4444

45-
trait get_doc {
46-
fn [](tag: uint) -> doc;
47-
}
48-
49-
impl doc: get_doc {
50-
fn [](tag: uint) -> doc {
51-
get_doc(self, tag)
52-
}
53-
}
54-
5545
impl doc: ops::index<uint,doc> {
5646
pure fn index(&&tag: uint) -> doc {
5747
unchecked {

src/libsyntax/ast.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -821,34 +821,12 @@ pure fn empty_span() -> span {
821821

822822
// Convenience implementations
823823

824-
// Remove after snapshot!
825-
trait path_concat {
826-
pure fn +(&&id: ident) -> @path;
827-
}
828-
829-
// Remove after snapshot!
830-
impl ident: path_concat {
831-
pure fn +(&&id: ident) -> @path {
832-
simple_path(self, empty_span()) + id
833-
}
834-
}
835-
836824
impl ident: ops::add<ident,@path> {
837825
pure fn add(&&id: ident) -> @path {
838826
simple_path(self, empty_span()) + id
839827
}
840828
}
841829

842-
// Remove after snapshot!
843-
impl @path: path_concat {
844-
pure fn +(&&id: ident) -> @path {
845-
@{
846-
idents: vec::append_one(self.idents, id)
847-
with *self
848-
}
849-
}
850-
}
851-
852830
impl @path: ops::add<ident,@path> {
853831
pure fn add(&&id: ident) -> @path {
854832
@{

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,22 +2391,7 @@ class parser {
23912391
}
23922392

23932393
fn parse_method_name() -> ident {
2394-
match copy self.token {
2395-
token::BINOP(op) => { self.bump(); @token::binop_to_str(op) }
2396-
token::NOT => { self.bump(); @~"!" }
2397-
token::LBRACKET => {
2398-
self.bump();
2399-
self.expect(token::RBRACKET);
2400-
@~"[]"
2401-
}
2402-
_ => {
2403-
let id = self.parse_value_ident();
2404-
if id == @~"unary" && self.eat(token::BINOP(token::MINUS)) {
2405-
@~"unary-"
2406-
}
2407-
else { id }
2408-
}
2409-
}
2394+
self.parse_value_ident()
24102395
}
24112396

24122397
fn parse_method(pr: visibility) -> @method {

src/rustc/middle/ty.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,20 +1522,6 @@ fn remove_copyable(k: kind) -> kind {
15221522
k - kind_(KIND_MASK_COPY)
15231523
}
15241524
1525-
impl kind {
1526-
fn &(other: kind) -> kind {
1527-
lower_kind(self, other)
1528-
}
1529-
1530-
fn |(other: kind) -> kind {
1531-
raise_kind(self, other)
1532-
}
1533-
1534-
fn -(other: kind) -> kind {
1535-
kind_(*self & !*other)
1536-
}
1537-
}
1538-
15391525
impl kind: ops::bitand<kind,kind> {
15401526
pure fn bitand(other: kind) -> kind {
15411527
unchecked {

src/test/run-pass/class-impl-very-parameterized-trait.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class cat<T: copy> : map<int, T> {
5353
none => { fail ~"epic fail"; }
5454
}
5555
}
56-
fn [](&&k:int) -> T { self.get(k) }
5756
fn find(+k:int) -> option<T> { if k <= self.meows {
5857
some(self.name)
5958
}

0 commit comments

Comments
 (0)