Skip to content

Commit 3d97ddc

Browse files
committed
---
yaml --- r: 101371 b: refs/heads/master c: bc8983a h: refs/heads/master i: 101369: 71ebe76 101367: 0843e89 v: v3
1 parent 49d9f48 commit 3d97ddc

File tree

140 files changed

+1121
-2540
lines changed

Some content is hidden

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

140 files changed

+1121
-2540
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1d494198bbb9701b6336febcf9d0ceb39e4b7975
2+
refs/heads/master: bc8983a3fa44f0c35c7fe669913ca7ea82758125
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ fetch snapshots, and an OS that can execute the available snapshot binaries.
7171

7272
Snapshot binaries are currently built and tested on several platforms:
7373

74-
* Windows (7, 8, Server 2008 R2), x86 only
75-
* Linux (2.6.18 or later, various distributions), x86 and x86-64
76-
* OSX 10.7 (Lion) or greater, x86 and x86-64
74+
* Windows (7, Server 2008 R2), x86 only
75+
* Linux (various distributions), x86 and x86-64
76+
* OSX 10.6 ("Snow Leopard") or greater, x86 and x86-64
7777

7878
You may find that other platforms work, but these are our officially
7979
supported build environments that are most likely to work.

trunk/doc/rustdoc.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,9 @@ that one can still write things like `#[deriving(Eq)]`).
139139

140140
~~~
141141
```rust
142-
# /!\ The three following lines are comments, which are usually stripped off by
143-
# the doc-generating tool. In order to display them anyway in this particular
144-
# case, the character following the leading '#' is not a usual space like in
145-
# these first five lines but a non breakable one.
146-
#
147-
# // showing 'fib' in this documentation would just be tedious and detracts from
148-
# // what's actualy being documented.
149-
# fn fib(n: int) { n + 2 }
142+
# // showing 'fib' in this documentation would just be tedious and detracts from
143+
# // what's actualy being documented.
144+
# fn fib(n: int) { n + 2 }
150145
151146
do spawn { fib(200); }
152147
```

trunk/doc/tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ from the Internet on our supported platforms.
7272

7373
Snapshot binaries are currently built and tested on several platforms:
7474

75-
* Windows (7, 8, Server 2008 R2), x86 only
76-
* Linux (2.6.18 or later, various distributions), x86 and x86-64
77-
* OSX 10.7 (Lion) or greater, x86 and x86-64
75+
* Windows (7, Server 2008 R2), x86 only
76+
* Linux (various distributions), x86 and x86-64
77+
* OSX 10.6 ("Snow Leopard") or greater, x86 and x86-64
7878

7979
You may find that other platforms work, but these are our "tier 1"
8080
supported build environments that are most likely to work.
@@ -646,7 +646,7 @@ match mypoint {
646646
## Enums
647647

648648
Enums are datatypes that have several alternate representations. For
649-
example, consider the following type:
649+
example, consider the type shown earlier:
650650

651651
~~~~
652652
# struct Point { x: f64, y: f64 }

trunk/src/libarena/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ use std::cast;
3333
use std::cell::{Cell, RefCell};
3434
use std::num;
3535
use std::ptr;
36-
use std::kinds::marker;
3736
use std::mem;
3837
use std::rt::global_heap;
38+
use std::uint;
3939
use std::unstable::intrinsics::{TyDesc, get_tydesc};
4040
use std::unstable::intrinsics;
4141
use std::util;
@@ -71,14 +71,14 @@ struct Chunk {
7171
// different chunks than objects without destructors. This reduces
7272
// overhead when initializing plain-old-data and means we don't need
7373
// to waste time running the destructors of POD.
74+
#[no_freeze]
7475
pub struct Arena {
7576
// The head is separated out from the list as a unbenchmarked
7677
// microoptimization, to avoid needing to case on the list to
7778
// access the head.
7879
priv head: Chunk,
7980
priv pod_head: Chunk,
8081
priv chunks: RefCell<@List<Chunk>>,
81-
priv no_freeze: marker::NoFreeze,
8282
}
8383

8484
impl Arena {
@@ -91,7 +91,6 @@ impl Arena {
9191
head: chunk(initial_size, false),
9292
pod_head: chunk(initial_size, true),
9393
chunks: RefCell::new(@Nil),
94-
no_freeze: marker::NoFreeze,
9594
}
9695
}
9796
}
@@ -179,7 +178,7 @@ impl Arena {
179178
let new_min_chunk_size = num::max(n_bytes, chunk_size);
180179
self.chunks.set(@Cons(self.pod_head.clone(), self.chunks.get()));
181180
self.pod_head =
182-
chunk(num::next_power_of_two(new_min_chunk_size + 1u), true);
181+
chunk(uint::next_power_of_two(new_min_chunk_size + 1u), true);
183182

184183
return self.alloc_pod_inner(n_bytes, align);
185184
}
@@ -221,7 +220,7 @@ impl Arena {
221220
let new_min_chunk_size = num::max(n_bytes, chunk_size);
222221
self.chunks.set(@Cons(self.head.clone(), self.chunks.get()));
223222
self.head =
224-
chunk(num::next_power_of_two(new_min_chunk_size + 1u), false);
223+
chunk(uint::next_power_of_two(new_min_chunk_size + 1u), false);
225224

226225
return self.alloc_nonpod_inner(n_bytes, align);
227226
}

trunk/src/libextra/arc.rs

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -45,9 +45,9 @@ use sync;
4545
use sync::{Mutex, RWLock};
4646

4747
use std::cast;
48-
use std::kinds::marker;
4948
use std::sync::arc::UnsafeArc;
5049
use std::task;
50+
use std::borrow;
5151

5252
/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
5353
pub struct Condvar<'a> {
@@ -151,19 +151,17 @@ impl<T:Freeze + Send> Clone for Arc<T> {
151151
struct MutexArcInner<T> { lock: Mutex, failed: bool, data: T }
152152

153153
/// An Arc with mutable data protected by a blocking mutex.
154-
pub struct MutexArc<T> {
155-
priv x: UnsafeArc<MutexArcInner<T>>,
156-
priv marker: marker::NoFreeze,
157-
}
154+
#[no_freeze]
155+
pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
156+
158157

159158
impl<T:Send> Clone for MutexArc<T> {
160159
/// Duplicate a mutex-protected Arc. See arc::clone for more details.
161160
#[inline]
162161
fn clone(&self) -> MutexArc<T> {
163162
// NB: Cloning the underlying mutex is not necessary. Its reference
164163
// count would be exactly the same as the shared state's.
165-
MutexArc { x: self.x.clone(),
166-
marker: marker::NoFreeze, }
164+
MutexArc { x: self.x.clone() }
167165
}
168166
}
169167

@@ -182,8 +180,7 @@ impl<T:Send> MutexArc<T> {
182180
lock: Mutex::new_with_condvars(num_condvars),
183181
failed: false, data: user_data
184182
};
185-
MutexArc { x: UnsafeArc::new(data),
186-
marker: marker::NoFreeze, }
183+
MutexArc { x: UnsafeArc::new(data) }
187184
}
188185

189186
/**
@@ -322,17 +319,16 @@ struct RWArcInner<T> { lock: RWLock, failed: bool, data: T }
322319
*
323320
* Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested.
324321
*/
322+
#[no_freeze]
325323
pub struct RWArc<T> {
326324
priv x: UnsafeArc<RWArcInner<T>>,
327-
priv marker: marker::NoFreeze,
328325
}
329326

330327
impl<T:Freeze + Send> Clone for RWArc<T> {
331328
/// Duplicate a rwlock-protected Arc. See arc::clone for more details.
332329
#[inline]
333330
fn clone(&self) -> RWArc<T> {
334-
RWArc { x: self.x.clone(),
335-
marker: marker::NoFreeze, }
331+
RWArc { x: self.x.clone() }
336332
}
337333

338334
}
@@ -352,8 +348,7 @@ impl<T:Freeze + Send> RWArc<T> {
352348
lock: RWLock::new_with_condvars(num_condvars),
353349
failed: false, data: user_data
354350
};
355-
RWArc { x: UnsafeArc::new(data),
356-
marker: marker::NoFreeze, }
351+
RWArc { x: UnsafeArc::new(data), }
357352
}
358353

359354
/**
@@ -470,7 +465,7 @@ impl<T:Freeze + Send> RWArc<T> {
470465
// of this cast is removing the mutability.)
471466
let new_data = data;
472467
// Downgrade ensured the token belonged to us. Just a sanity check.
473-
assert!((&(*state).data as *T as uint) == (new_data as *mut T as uint));
468+
assert!(borrow::ref_eq(&(*state).data, new_data));
474469
// Produce new token
475470
RWReadMode {
476471
data: new_data,

trunk/src/libextra/hex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -60,7 +60,7 @@ pub trait FromHex {
6060
pub enum FromHexError {
6161
/// The input contained a character not part of the hex format
6262
InvalidHexCharacter(char, uint),
63-
/// The input had an invalid length
63+
/// The input had a invalid length
6464
InvalidHexLength,
6565
}
6666

trunk/src/libextra/num/bigint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ impl ToStrRadix for BigInt {
12921292
}
12931293
12941294
impl FromStrRadix for BigInt {
1295-
/// Creates and initializes a BigInt.
1295+
/// Creates and initializes an BigInt.
12961296
#[inline]
12971297
fn from_str_radix(s: &str, radix: uint) -> Option<BigInt> {
12981298
BigInt::parse_bytes(s.as_bytes(), radix)
@@ -1385,7 +1385,7 @@ impl<R: Rng> RandBigInt for R {
13851385
}
13861386
13871387
impl BigInt {
1388-
/// Creates and initializes a BigInt.
1388+
/// Creates and initializes an BigInt.
13891389
#[inline]
13901390
pub fn new(sign: Sign, v: ~[BigDigit]) -> BigInt {
13911391
BigInt::from_biguint(sign, BigUint::new(v))

trunk/src/libextra/sync.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -18,6 +18,7 @@
1818
*/
1919

2020

21+
use std::borrow;
2122
use std::comm;
2223
use std::unstable::sync::Exclusive;
2324
use std::sync::arc::UnsafeArc;
@@ -633,7 +634,7 @@ impl RWLock {
633634
/// To be called inside of the write_downgrade block.
634635
pub fn downgrade<'a>(&self, token: RWLockWriteMode<'a>)
635636
-> RWLockReadMode<'a> {
636-
if !((self as *RWLock) == (token.lock as *RWLock)) {
637+
if !borrow::ref_eq(self, token.lock) {
637638
fail!("Can't downgrade() with a different rwlock's write_mode!");
638639
}
639640
unsafe {

trunk/src/librustc/back/link.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ pub mod write {
9696
use lib::llvm::llvm;
9797
use lib::llvm::{ModuleRef, TargetMachineRef, PassManagerRef};
9898
use lib;
99-
use syntax::abi;
10099
use util::common::time;
101100

102101
use std::c_str::ToCStr;
@@ -130,10 +129,7 @@ pub mod write {
130129
let use_softfp = sess.opts.debugging_opts & session::USE_SOFTFP != 0;
131130

132131
// FIXME: #11906: Omitting frame pointers breaks retrieving the value of a parameter.
133-
// FIXME: #11954: mac64 unwinding may not work with fp elim
134-
let no_fp_elim = sess.opts.debuginfo ||
135-
(sess.targ_cfg.os == abi::OsMacos &&
136-
sess.targ_cfg.arch == abi::X86_64);
132+
let no_fp_elim = sess.opts.debuginfo;
137133

138134
let tm = sess.targ_cfg.target_strs.target_triple.with_c_str(|T| {
139135
sess.opts.target_cpu.with_c_str(|CPU| {

trunk/src/librustc/front/feature_gate.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
4848
("log_syntax", Active),
4949
("trace_macros", Active),
5050
("simd", Active),
51-
("default_type_params", Active),
5251

5352
// These are used to test this portion of the compiler, they don't actually
5453
// mean anything
@@ -235,20 +234,6 @@ impl Visitor<()> for Context {
235234
}
236235
visit::walk_expr(self, e, ());
237236
}
238-
239-
fn visit_generics(&mut self, generics: &ast::Generics, _: ()) {
240-
for type_parameter in generics.ty_params.iter() {
241-
match type_parameter.default {
242-
Some(ty) => {
243-
self.gate_feature("default_type_params", ty.span,
244-
"default type parameters are \
245-
experimental and possibly buggy");
246-
}
247-
None => {}
248-
}
249-
}
250-
visit::walk_generics(self, generics, ());
251-
}
252237
}
253238

254239
pub fn check_crate(sess: Session, crate: &ast::Crate) {

trunk/src/librustc/metadata/common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pub static tag_items_data_item_variant: uint = 0x0eu;
3535

3636
pub static tag_items_data_parent_item: uint = 0x0fu;
3737

38+
pub static tag_items_data_item_is_tuple_struct_ctor: uint = 0x10u;
39+
3840
pub static tag_index: uint = 0x11u;
3941

4042
pub static tag_index_buckets: uint = 0x12u;

trunk/src/librustc/metadata/decoder.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,9 +980,26 @@ pub fn get_static_methods_if_impl(intr: @IdentInterner,
980980
return Some(static_impl_methods);
981981
}
982982

983+
/// If node_id is the constructor of a tuple struct, retrieve the NodeId of
984+
/// the actual type definition, otherwise, return None
985+
pub fn get_tuple_struct_definition_if_ctor(cdata: Cmd,
986+
node_id: ast::NodeId) -> Option<ast::NodeId> {
987+
let item = lookup_item(node_id, cdata.data());
988+
let mut ret = None;
989+
reader::tagged_docs(item, tag_items_data_item_is_tuple_struct_ctor, |_| {
990+
ret = Some(item_reqd_and_translated_parent_item(cdata.cnum, item));
991+
false
992+
});
993+
ret.map(|x| x.node)
994+
}
995+
983996
pub fn get_item_attrs(cdata: Cmd,
984997
node_id: ast::NodeId,
985998
f: |~[@ast::MetaItem]|) {
999+
// The attributes for a tuple struct are attached to the definition, not the ctor;
1000+
// we assume that someone passing in a tuple struct ctor is actually wanting to
1001+
// look at the definition
1002+
let node_id = get_tuple_struct_definition_if_ctor(cdata, node_id).unwrap_or(node_id);
9861003
let item = lookup_item(node_id, cdata.data());
9871004
reader::tagged_docs(item, tag_attributes, |attributes| {
9881005
reader::tagged_docs(attributes, tag_attribute, |attribute| {

trunk/src/librustc/metadata/encoder.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,12 @@ fn encode_info_for_struct_ctor(ecx: &EncodeContext,
778778
encode_symbol(ecx, ebml_w, ctor_id);
779779
}
780780

781+
// indicate that this is a tuple struct ctor, because downstream users will normally want
782+
// the tuple struct definition, but without this there is no way for them to tell that
783+
// they actually have a ctor rather than a normal function
784+
ebml_w.start_tag(tag_items_data_item_is_tuple_struct_ctor);
785+
ebml_w.end_tag();
786+
781787
ebml_w.end_tag();
782788
}
783789

trunk/src/librustc/metadata/tydecode.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,9 @@ pub fn parse_type_param_def_data(data: &[u8], start: uint,
573573
}
574574

575575
fn parse_type_param_def(st: &mut PState, conv: conv_did) -> ty::TypeParameterDef {
576-
ty::TypeParameterDef {
577-
ident: parse_ident(st, ':'),
578-
def_id: parse_def(st, NominalType, |x,y| conv(x,y)),
579-
bounds: @parse_bounds(st, |x,y| conv(x,y)),
580-
default: parse_opt(st, |st| parse_ty(st, |x,y| conv(x,y)))
581-
}
576+
ty::TypeParameterDef {ident: parse_ident(st, ':'),
577+
def_id: parse_def(st, NominalType, |x,y| conv(x,y)),
578+
bounds: @parse_bounds(st, |x,y| conv(x,y))}
582579
}
583580

584581
fn parse_bounds(st: &mut PState, conv: conv_did) -> ty::ParamBounds {

trunk/src/librustc/metadata/tyencode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,5 +421,4 @@ fn enc_bounds(w: &mut MemWriter, cx: @ctxt, bs: &ty::ParamBounds) {
421421
pub fn enc_type_param_def(w: &mut MemWriter, cx: @ctxt, v: &ty::TypeParameterDef) {
422422
mywrite!(w, "{}:{}|", cx.tcx.sess.str_of(v.ident), (cx.ds)(v.def_id));
423423
enc_bounds(w, cx, v.bounds);
424-
enc_opt(w, v.default, |w, t| enc_ty(w, cx, t));
425424
}

0 commit comments

Comments
 (0)