Skip to content

Commit 616dcb9

Browse files
committed
---
yaml --- r: 162416 b: refs/heads/try c: 7a372e2 h: refs/heads/master v: v3
1 parent 00f2d53 commit 616dcb9

Some content is hidden

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

68 files changed

+713
-1073
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: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
5-
refs/heads/try: 96c8f2b0c1846756e617f1f1fc1372c506e24248
5+
refs/heads/try: 7a372e23cbab0be6abd3fbd321d0548640568920
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcollections/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub trait VectorVector<T> for Sized? {
121121
fn connect_vec(&self, sep: &T) -> Vec<T>;
122122
}
123123

124-
impl<'a, T: Clone, V: AsSlice<T>> VectorVector<T> for [V] {
124+
impl<T: Clone, V: AsSlice<T>> VectorVector<T> for [V] {
125125
fn concat_vec(&self) -> Vec<T> {
126126
let size = self.iter().fold(0u, |acc, v| acc + v.as_slice().len());
127127
let mut result = Vec::with_capacity(size);

branches/try/src/libcollections/vec.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use core::cmp::max;
2020
use core::default::Default;
2121
use core::fmt;
2222
use core::kinds::marker::{ContravariantLifetime, InvariantType};
23-
use core::kinds::Sized;
2423
use core::mem;
2524
use core::num::{Int, UnsignedInt};
2625
use core::ops;
@@ -517,7 +516,7 @@ impl<T: PartialOrd> PartialOrd for Vec<T> {
517516
impl<T: Eq> Eq for Vec<T> {}
518517

519518
#[experimental]
520-
impl<T: PartialEq, Sized? V: AsSlice<T>> Equiv<V> for Vec<T> {
519+
impl<T: PartialEq, V: AsSlice<T>> Equiv<V> for Vec<T> {
521520
#[inline]
522521
fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
523522
}
@@ -1182,7 +1181,7 @@ impl<T> AsSlice<T> for Vec<T> {
11821181
}
11831182
}
11841183

1185-
impl<T: Clone, Sized? V: AsSlice<T>> Add<V, Vec<T>> for Vec<T> {
1184+
impl<T: Clone, V: AsSlice<T>> Add<V, Vec<T>> for Vec<T> {
11861185
#[inline]
11871186
fn add(&self, rhs: &V) -> Vec<T> {
11881187
let mut res = Vec::with_capacity(self.len() + rhs.as_slice().len());

branches/try/src/libcore/cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub trait PartialOrd for Sized?: PartialEq {
241241
/// container types; e.g. it is often desirable to be able to use `&str`
242242
/// values to look up entries in a container with `String` keys.
243243
#[experimental = "Better solutions may be discovered."]
244-
pub trait Equiv<Sized? T> for Sized? {
244+
pub trait Equiv<T> for Sized? {
245245
/// Implement this function to decide equivalent values.
246246
fn equiv(&self, other: &T) -> bool;
247247
}

branches/try/src/libcore/ops.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub trait Drop {
112112
* ```
113113
*/
114114
#[lang="add"]
115-
pub trait Add<Sized? RHS,Result> for Sized? {
115+
pub trait Add<RHS,Result> {
116116
/// The method for the `+` operator
117117
fn add(&self, rhs: &RHS) -> Result;
118118
}
@@ -153,7 +153,7 @@ add_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64)
153153
* ```
154154
*/
155155
#[lang="sub"]
156-
pub trait Sub<Sized? RHS, Result> for Sized? {
156+
pub trait Sub<RHS,Result> {
157157
/// The method for the `-` operator
158158
fn sub(&self, rhs: &RHS) -> Result;
159159
}
@@ -194,7 +194,7 @@ sub_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64)
194194
* ```
195195
*/
196196
#[lang="mul"]
197-
pub trait Mul<Sized? RHS, Result> for Sized? {
197+
pub trait Mul<RHS,Result> {
198198
/// The method for the `*` operator
199199
fn mul(&self, rhs: &RHS) -> Result;
200200
}
@@ -235,7 +235,7 @@ mul_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64)
235235
* ```
236236
*/
237237
#[lang="div"]
238-
pub trait Div<Sized? RHS, Result> for Sized? {
238+
pub trait Div<RHS,Result> {
239239
/// The method for the `/` operator
240240
fn div(&self, rhs: &RHS) -> Result;
241241
}
@@ -276,7 +276,7 @@ div_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64)
276276
* ```
277277
*/
278278
#[lang="rem"]
279-
pub trait Rem<Sized? RHS, Result> for Sized? {
279+
pub trait Rem<RHS,Result> {
280280
/// The method for the `%` operator
281281
fn rem(&self, rhs: &RHS) -> Result;
282282
}
@@ -331,7 +331,7 @@ rem_float_impl!(f64, fmod)
331331
* ```
332332
*/
333333
#[lang="neg"]
334-
pub trait Neg<Result> for Sized? {
334+
pub trait Neg<Result> {
335335
/// The method for the unary `-` operator
336336
fn neg(&self) -> Result;
337337
}
@@ -388,7 +388,7 @@ neg_uint_impl!(u64, i64)
388388
* ```
389389
*/
390390
#[lang="not"]
391-
pub trait Not<Result> for Sized? {
391+
pub trait Not<Result> {
392392
/// The method for the unary `!` operator
393393
fn not(&self) -> Result;
394394
}
@@ -430,7 +430,7 @@ not_impl!(bool uint u8 u16 u32 u64 int i8 i16 i32 i64)
430430
* ```
431431
*/
432432
#[lang="bitand"]
433-
pub trait BitAnd<Sized? RHS, Result> for Sized? {
433+
pub trait BitAnd<RHS,Result> {
434434
/// The method for the `&` operator
435435
fn bitand(&self, rhs: &RHS) -> Result;
436436
}
@@ -471,7 +471,7 @@ bitand_impl!(bool uint u8 u16 u32 u64 int i8 i16 i32 i64)
471471
* ```
472472
*/
473473
#[lang="bitor"]
474-
pub trait BitOr<Sized? RHS, Result> for Sized? {
474+
pub trait BitOr<RHS,Result> {
475475
/// The method for the `|` operator
476476
fn bitor(&self, rhs: &RHS) -> Result;
477477
}
@@ -512,7 +512,7 @@ bitor_impl!(bool uint u8 u16 u32 u64 int i8 i16 i32 i64)
512512
* ```
513513
*/
514514
#[lang="bitxor"]
515-
pub trait BitXor<Sized? RHS, Result> for Sized? {
515+
pub trait BitXor<RHS,Result> {
516516
/// The method for the `^` operator
517517
fn bitxor(&self, rhs: &RHS) -> Result;
518518
}
@@ -553,7 +553,7 @@ bitxor_impl!(bool uint u8 u16 u32 u64 int i8 i16 i32 i64)
553553
* ```
554554
*/
555555
#[lang="shl"]
556-
pub trait Shl<Sized? RHS, Result> for Sized? {
556+
pub trait Shl<RHS,Result> {
557557
/// The method for the `<<` operator
558558
fn shl(&self, rhs: &RHS) -> Result;
559559
}
@@ -596,7 +596,7 @@ shl_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64)
596596
* ```
597597
*/
598598
#[lang="shr"]
599-
pub trait Shr<Sized? RHS, Result> for Sized? {
599+
pub trait Shr<RHS,Result> {
600600
/// The method for the `>>` operator
601601
fn shr(&self, rhs: &RHS) -> Result;
602602
}
@@ -669,7 +669,7 @@ pub trait Index<Sized? Index, Sized? Result> for Sized? {
669669
* ```
670670
*/
671671
#[lang="index_mut"]
672-
pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
672+
pub trait IndexMut<Sized? Index, Result> for Sized? {
673673
/// The method for the indexing (`Foo[Bar]`) operation
674674
fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result;
675675
}
@@ -712,7 +712,7 @@ pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
712712
* ```
713713
*/
714714
#[lang="slice"]
715-
pub trait Slice<Sized? Idx, Sized? Result> for Sized? {
715+
pub trait Slice<Idx, Sized? Result> for Sized? {
716716
/// The method for the slicing operation foo[]
717717
fn as_slice_<'a>(&'a self) -> &'a Result;
718718
/// The method for the slicing operation foo[from..]
@@ -761,7 +761,7 @@ pub trait Slice<Sized? Idx, Sized? Result> for Sized? {
761761
* ```
762762
*/
763763
#[lang="slice_mut"]
764-
pub trait SliceMut<Sized? Idx, Sized? Result> for Sized? {
764+
pub trait SliceMut<Idx, Sized? Result> for Sized? {
765765
/// The method for the slicing operation foo[]
766766
fn as_mut_slice_<'a>(&'a mut self) -> &'a mut Result;
767767
/// The method for the slicing operation foo[from..]
@@ -800,7 +800,7 @@ pub trait SliceMut<Sized? Idx, Sized? Result> for Sized? {
800800
* ```
801801
*/
802802
#[lang="deref"]
803-
pub trait Deref<Sized? Result> for Sized? {
803+
pub trait Deref<Sized? Result> {
804804
/// The method called to dereference a value
805805
fn deref<'a>(&'a self) -> &'a Result;
806806
}
@@ -859,21 +859,21 @@ impl<'a, Sized? T> DerefMut<T> for &'a mut T {
859859

860860
/// A version of the call operator that takes an immutable receiver.
861861
#[lang="fn"]
862-
pub trait Fn<Args,Result> for Sized? {
862+
pub trait Fn<Args,Result> {
863863
/// This is called when the call operator is used.
864864
extern "rust-call" fn call(&self, args: Args) -> Result;
865865
}
866866

867867
/// A version of the call operator that takes a mutable receiver.
868868
#[lang="fn_mut"]
869-
pub trait FnMut<Args,Result> for Sized? {
869+
pub trait FnMut<Args,Result> {
870870
/// This is called when the call operator is used.
871871
extern "rust-call" fn call_mut(&mut self, args: Args) -> Result;
872872
}
873873

874874
/// A version of the call operator that takes a by-value receiver.
875875
#[lang="fn_once"]
876-
pub trait FnOnce<Args,Result> for Sized? {
876+
pub trait FnOnce<Args,Result> {
877877
/// This is called when the call operator is used.
878878
extern "rust-call" fn call_once(self, args: Args) -> Result;
879879
}

branches/try/src/libcore/slice.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,25 +1008,15 @@ impl<T: Clone> CloneSlicePrelude<T> for [T] {
10081008

10091009
/// Data that is viewable as a slice.
10101010
#[unstable = "may merge with other traits"]
1011-
pub trait AsSlice<T> for Sized? {
1011+
pub trait AsSlice<T> {
10121012
/// Work with `self` as a slice.
10131013
fn as_slice<'a>(&'a self) -> &'a [T];
10141014
}
10151015

10161016
#[unstable = "trait is unstable"]
1017-
impl<T> AsSlice<T> for [T] {
1017+
impl<'a,T> AsSlice<T> for &'a [T] {
10181018
#[inline(always)]
1019-
fn as_slice<'a>(&'a self) -> &'a [T] { self }
1020-
}
1021-
1022-
impl<'a, T, Sized? U: AsSlice<T>> AsSlice<T> for &'a U {
1023-
#[inline(always)]
1024-
fn as_slice<'a>(&'a self) -> &'a [T] { AsSlice::as_slice(*self) }
1025-
}
1026-
1027-
impl<'a, T, Sized? U: AsSlice<T>> AsSlice<T> for &'a mut U {
1028-
#[inline(always)]
1029-
fn as_slice<'a>(&'a self) -> &'a [T] { AsSlice::as_slice(*self) }
1019+
fn as_slice<'a>(&'a self) -> &'a [T] { *self }
10301020
}
10311021

10321022
#[unstable = "waiting for DST"]
@@ -1691,13 +1681,13 @@ impl<T: PartialEq> PartialEq for [T] {
16911681
impl<T: Eq> Eq for [T] {}
16921682

16931683
#[unstable = "waiting for DST"]
1694-
impl<T: PartialEq, Sized? V: AsSlice<T>> Equiv<V> for [T] {
1684+
impl<T: PartialEq, V: AsSlice<T>> Equiv<V> for [T] {
16951685
#[inline]
16961686
fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
16971687
}
16981688

16991689
#[unstable = "waiting for DST"]
1700-
impl<'a,T:PartialEq, Sized? V: AsSlice<T>> Equiv<V> for &'a mut [T] {
1690+
impl<'a,T:PartialEq, V: AsSlice<T>> Equiv<V> for &'a mut [T] {
17011691
#[inline]
17021692
fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
17031693
}

branches/try/src/libgraphviz/maybe_owned_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<'a, T: Ord> Ord for MaybeOwnedVector<'a, T> {
8989
}
9090
}
9191

92-
impl<'a, T: PartialEq, Sized? V: AsSlice<T>> Equiv<V> for MaybeOwnedVector<'a, T> {
92+
impl<'a, T: PartialEq, V: AsSlice<T>> Equiv<V> for MaybeOwnedVector<'a, T> {
9393
fn equiv(&self, other: &V) -> bool {
9494
self.as_slice() == other.as_slice()
9595
}

branches/try/src/librustc/metadata/tydecode.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
pub use self::DefIdSource::*;
2020

21-
use middle::region;
2221
use middle::subst;
2322
use middle::subst::VecPerParamSpace;
2423
use middle::ty::{mod, Ty};
@@ -316,17 +315,17 @@ fn parse_region(st: &mut PState, conv: conv_did) -> ty::Region {
316315
}
317316
'f' => {
318317
assert_eq!(next(st), '[');
319-
let scope = parse_scope(st);
318+
let id = parse_uint(st) as ast::NodeId;
320319
assert_eq!(next(st), '|');
321320
let br = parse_bound_region(st, |x,y| conv(x,y));
322321
assert_eq!(next(st), ']');
323-
ty::ReFree(ty::FreeRegion { scope: scope,
322+
ty::ReFree(ty::FreeRegion {scope_id: id,
324323
bound_region: br})
325324
}
326325
's' => {
327-
let scope = parse_scope(st);
326+
let id = parse_uint(st) as ast::NodeId;
328327
assert_eq!(next(st), '|');
329-
ty::ReScope(scope)
328+
ty::ReScope(id)
330329
}
331330
't' => {
332331
ty::ReStatic
@@ -338,16 +337,6 @@ fn parse_region(st: &mut PState, conv: conv_did) -> ty::Region {
338337
}
339338
}
340339

341-
fn parse_scope(st: &mut PState) -> region::CodeExtent {
342-
match next(st) {
343-
'M' => {
344-
let node_id = parse_uint(st) as ast::NodeId;
345-
region::CodeExtent::Misc(node_id)
346-
}
347-
_ => panic!("parse_scope: bad input")
348-
}
349-
}
350-
351340
fn parse_opt<'a, 'tcx, T>(st: &mut PState<'a, 'tcx>, f: |&mut PState<'a, 'tcx>| -> T)
352341
-> Option<T> {
353342
match next(st) {

branches/try/src/librustc/metadata/tyencode.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use std::cell::RefCell;
1717

18-
use middle::region;
1918
use middle::subst;
2019
use middle::subst::VecPerParamSpace;
2120
use middle::ty::ParamTy;
@@ -144,16 +143,12 @@ pub fn enc_region(w: &mut SeekableMemWriter, cx: &ctxt, r: ty::Region) {
144143
token::get_name(name));
145144
}
146145
ty::ReFree(ref fr) => {
147-
mywrite!(w, "f[");
148-
enc_scope(w, cx, fr.scope);
149-
mywrite!(w, "|");
146+
mywrite!(w, "f[{}|", fr.scope_id);
150147
enc_bound_region(w, cx, fr.bound_region);
151148
mywrite!(w, "]");
152149
}
153-
ty::ReScope(scope) => {
154-
mywrite!(w, "s");
155-
enc_scope(w, cx, scope);
156-
mywrite!(w, "|");
150+
ty::ReScope(nid) => {
151+
mywrite!(w, "s{}|", nid);
157152
}
158153
ty::ReStatic => {
159154
mywrite!(w, "t");
@@ -168,12 +163,6 @@ pub fn enc_region(w: &mut SeekableMemWriter, cx: &ctxt, r: ty::Region) {
168163
}
169164
}
170165

171-
fn enc_scope(w: &mut SeekableMemWriter, _cx: &ctxt, scope: region::CodeExtent) {
172-
match scope {
173-
region::CodeExtent::Misc(node_id) => mywrite!(w, "M{}", node_id)
174-
}
175-
}
176-
177166
fn enc_bound_region(w: &mut SeekableMemWriter, cx: &ctxt, br: ty::BoundRegion) {
178167
match br {
179168
ty::BrAnon(idx) => {

0 commit comments

Comments
 (0)