Skip to content

Commit acaf370

Browse files
committed
---
yaml --- r: 142717 b: refs/heads/try2 c: 663a959 h: refs/heads/master i: 142715: 0d94cc1 v: v3
1 parent ecad78e commit acaf370

File tree

11 files changed

+21
-131
lines changed

11 files changed

+21
-131
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 9b5d52312622fb301d9e102b3eeca5a7afcdeb9b
8+
refs/heads/try2: 663a9597b24f841f44e560e2478225353dbcec30
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,7 @@ pub fn parse_type_param_def_data(data: &[u8], start: uint,
543543
}
544544

545545
fn parse_type_param_def(st: &mut PState, conv: conv_did) -> ty::TypeParameterDef {
546-
ty::TypeParameterDef {ident: parse_ident(st, ':'),
547-
def_id: parse_def(st, NominalType, |x,y| conv(x,y)),
546+
ty::TypeParameterDef {def_id: parse_def(st, NominalType, |x,y| conv(x,y)),
548547
bounds: @parse_bounds(st, |x,y| conv(x,y))}
549548
}
550549

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,6 @@ fn enc_bounds(w: @io::Writer, cx: @ctxt, bs: &ty::ParamBounds) {
416416
}
417417

418418
pub fn enc_type_param_def(w: @io::Writer, cx: @ctxt, v: &ty::TypeParameterDef) {
419-
w.write_str(cx.tcx.sess.str_of(v.ident));
420-
w.write_char(':');
421419
w.write_str((cx.ds)(v.def_id));
422420
w.write_char('|');
423421
enc_bounds(w, cx, v.bounds);

branches/try2/src/librustc/middle/subst.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ impl Subst for ty::ParamBounds {
130130
impl Subst for ty::TypeParameterDef {
131131
fn subst(&self, tcx: ty::ctxt, substs: &ty::substs) -> ty::TypeParameterDef {
132132
ty::TypeParameterDef {
133-
ident: self.ident,
134133
def_id: self.def_id,
135134
bounds: self.bounds.subst(tcx, substs)
136135
}

branches/try2/src/librustc/middle/ty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,6 @@ impl ToStr for IntVarValue {
794794
}
795795

796796
pub struct TypeParameterDef {
797-
ident: ast::ident,
798797
def_id: ast::def_id,
799798
bounds: @ParamBounds
800799
}

branches/try2/src/librustc/middle/typeck/collect.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ use syntax::print::pprust::{path_to_str, explicit_self_to_str};
5959
use syntax::visit;
6060
use syntax::opt_vec::OptVec;
6161
use syntax::opt_vec;
62-
use syntax::parse::token::special_idents;
6362

6463
pub fn collect_item_types(ccx: @mut CrateCtxt, crate: &ast::crate) {
6564
fn collect_intrinsic_type(ccx: &CrateCtxt,
@@ -319,7 +318,6 @@ pub fn ensure_trait_methods(ccx: &CrateCtxt,
319318
let self_trait_def = get_trait_def(ccx, local_def(trait_id));
320319
let self_trait_ref = self_trait_def.trait_ref.subst(tcx, &substs);
321320
new_type_param_defs.push(ty::TypeParameterDef {
322-
ident: special_idents::self_,
323321
def_id: dummy_defid,
324322
bounds: @ty::ParamBounds {
325323
builtin_bounds: ty::EmptyBuiltinBounds(),
@@ -1153,7 +1151,6 @@ pub fn ty_generics(ccx: &CrateCtxt,
11531151
let bounds = @compute_bounds(ccx, rp, generics,
11541152
param_ty, &param.bounds);
11551153
let def = ty::TypeParameterDef {
1156-
ident: param.ident,
11571154
def_id: local_def(param.id),
11581155
bounds: bounds
11591156
};

branches/try2/src/librustc/util/ppaux.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -435,17 +435,16 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str {
435435
ty_infer(infer_ty) => infer_ty.to_str(),
436436
ty_err => ~"[type error]",
437437
ty_param(param_ty {idx: id, def_id: did}) => {
438-
let param_def = cx.ty_param_defs.find(&did.node);
439-
let ident = match param_def {
440-
Some(def) => {
441-
cx.sess.str_of(def.ident).to_owned()
442-
}
443-
None => {
444-
// This should not happen...
445-
fmt!("BUG[%?]", id)
446-
}
447-
};
448-
if !cx.sess.verbose() { ident } else { fmt!("%s:%?", ident, did) }
438+
let mut parm = (('T' as uint) + id) as char;
439+
if (parm as uint) > ('Z' as uint) {
440+
parm = (parm as uint - 26) as char;
441+
}
442+
443+
if cx.sess.verbose() {
444+
fmt!("%c:%?", parm, did)
445+
} else {
446+
fmt!("%c", parm)
447+
}
449448
}
450449
ty_self(*) => ~"Self",
451450
ty_enum(did, ref substs) | ty_struct(did, ref substs) => {

branches/try2/src/libstd/libc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ pub mod types {
186186
// Standard types that are opaque or common, so are not per-target.
187187
pub mod common {
188188
pub mod c95 {
189+
/**
190+
Type used to construct void pointers for use with C.
191+
192+
This type is only useful as a pointer target. Do not use it as a
193+
return type for FFI functions which have the `void` return type in
194+
C. Use the unit type `()` or omit the return type instead.
195+
*/
189196
pub enum c_void {}
190197
pub enum FILE {}
191198
pub enum fpos_t {}

branches/try2/src/libstd/ptr.rs

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ use option::{Option, Some, None};
1515
use sys;
1616
use unstable::intrinsics;
1717
use util::swap;
18-
use ops::{Add,Sub};
19-
use num::Int;
2018

2119
#[cfg(not(test))] use cmp::{Eq, Ord};
2220
use uint;
@@ -386,46 +384,6 @@ impl<T> Ord for *const T {
386384
}
387385
}
388386

389-
#[cfg(not(test))]
390-
impl<T, I: Int> Add<I, *T> for *T {
391-
/// Add an integer value to a pointer to get an offset pointer.
392-
/// Is calculated according to the size of the type pointed to.
393-
#[inline]
394-
pub fn add(&self, rhs: &I) -> *T {
395-
self.offset(rhs.to_int() as uint)
396-
}
397-
}
398-
399-
#[cfg(not(test))]
400-
impl<T, I: Int> Sub<I, *T> for *T {
401-
/// Subtract an integer value from a pointer to get an offset pointer.
402-
/// Is calculated according to the size of the type pointed to.
403-
#[inline]
404-
pub fn sub(&self, rhs: &I) -> *T {
405-
self.offset(-rhs.to_int() as uint)
406-
}
407-
}
408-
409-
#[cfg(not(test))]
410-
impl<T, I: Int> Add<I, *mut T> for *mut T {
411-
/// Add an integer value to a pointer to get an offset pointer.
412-
/// Is calculated according to the size of the type pointed to.
413-
#[inline]
414-
pub fn add(&self, rhs: &I) -> *mut T {
415-
self.offset(rhs.to_int() as uint)
416-
}
417-
}
418-
419-
#[cfg(not(test))]
420-
impl<T, I: Int> Sub<I, *mut T> for *mut T {
421-
/// Subtract an integer value from a pointer to get an offset pointer.
422-
/// Is calculated according to the size of the type pointed to.
423-
#[inline]
424-
pub fn sub(&self, rhs: &I) -> *mut T {
425-
self.offset(-rhs.to_int() as uint)
426-
}
427-
}
428-
429387
#[cfg(test)]
430388
pub mod ptr_tests {
431389
use super::*;
@@ -543,60 +501,6 @@ pub mod ptr_tests {
543501
}
544502
}
545503

546-
#[test]
547-
fn test_ptr_addition() {
548-
use vec::raw::*;
549-
550-
unsafe {
551-
let xs = ~[5, ..16];
552-
let mut ptr = to_ptr(xs);
553-
let end = ptr + 16;
554-
555-
while ptr < end {
556-
assert_eq!(*ptr, 5);
557-
ptr = ptr + 1u;
558-
}
559-
560-
let mut xs_mut = xs.clone();
561-
let mut m_ptr = to_mut_ptr(xs_mut);
562-
let m_end = m_ptr + 16i16;
563-
564-
while m_ptr < m_end {
565-
*m_ptr += 5;
566-
m_ptr = m_ptr + 1u8;
567-
}
568-
569-
assert_eq!(xs_mut, ~[10, ..16]);
570-
}
571-
}
572-
573-
#[test]
574-
fn test_ptr_subtraction() {
575-
use vec::raw::*;
576-
577-
unsafe {
578-
let xs = ~[0,1,2,3,4,5,6,7,8,9];
579-
let mut idx = 9i8;
580-
let ptr = to_ptr(xs);
581-
582-
while idx >= 0i8 {
583-
assert_eq!(*(ptr + idx), idx as int);
584-
idx = idx - 1i8;
585-
}
586-
587-
let mut xs_mut = xs.clone();
588-
let mut m_start = to_mut_ptr(xs_mut);
589-
let mut m_ptr = m_start + 9u32;
590-
591-
while m_ptr >= m_start {
592-
*m_ptr += *m_ptr;
593-
m_ptr = m_ptr - 1i8;
594-
}
595-
596-
assert_eq!(xs_mut, ~[0,2,4,6,8,10,12,14,16,18]);
597-
}
598-
}
599-
600504
#[test]
601505
fn test_ptr_array_each_with_len() {
602506
unsafe {

branches/try2/src/libstd/repr.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,11 @@ impl ReprVisitor {
206206
inner: *TyDesc)
207207
-> bool {
208208
let mut p = ptr;
209+
let end = ptr::offset(p, len);
209210
let (sz, al) = unsafe { ((*inner).size, (*inner).align) };
210211
self.writer.write_char('[');
211212
let mut first = true;
212-
let mut left = len;
213-
// unit structs have 0 size, and don't loop forever.
214-
let dec = if sz == 0 {1} else {sz};
215-
while left > 0 {
213+
while (p as uint) < (end as uint) {
216214
if first {
217215
first = false;
218216
} else {
@@ -221,7 +219,6 @@ impl ReprVisitor {
221219
self.write_mut_qualifier(mtbl);
222220
self.visit_ptr_inner(p as *c_void, inner);
223221
p = align(ptr::offset(p, sz) as uint, al) as *u8;
224-
left -= dec;
225222
}
226223
self.writer.write_char(']');
227224
true
@@ -638,7 +635,4 @@ fn test_repr() {
638635
"(10, ~\"hello\")");
639636
exact_test(&(10_u64, ~"hello"),
640637
"(10, ~\"hello\")");
641-
642-
struct Foo;
643-
exact_test(&(~[Foo, Foo, Foo]), "~[{}, {}, {}]");
644638
}

branches/try2/src/test/compile-fail/type-parameter-names.rs

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)