Skip to content

Commit bb85426

Browse files
committed
---
yaml --- r: 139027 b: refs/heads/try2 c: b3ee49c h: refs/heads/master i: 139025: 1fc4bea 139023: 129aaf6 v: v3
1 parent 258841e commit bb85426

File tree

7 files changed

+42
-22
lines changed

7 files changed

+42
-22
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: 4ad9e5c0c29c0ef4ea62f31679de3f072abb454f
8+
refs/heads/try2: b3ee49c7e249e4fc2fb6456088b556e9ff8316d9
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/rt/thread_local_storage.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ type pthread_key_t = c_ulong;
4040

4141
#[cfg(target_os="linux")]
4242
#[cfg(target_os="freebsd")]
43-
#[cfg(target_os="android")]
4443
#[allow(non_camel_case_types)] // foreign type
4544
type pthread_key_t = c_uint;
4645

branches/try2/src/libcore/str.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,7 +2273,6 @@ pub trait StrSlice {
22732273
pure fn to_owned(&self) -> ~str;
22742274
pure fn to_managed(&self) -> @str;
22752275
pure fn char_at(&self, i: uint) -> char;
2276-
fn to_bytes(&self) -> ~[u8];
22772276
}
22782277
22792278
/// Extension methods for strings
@@ -2417,8 +2416,6 @@ impl StrSlice for &self/str {
24172416
24182417
#[inline]
24192418
pure fn char_at(&self, i: uint) -> char { char_at(*self, i) }
2420-
2421-
fn to_bytes(&self) -> ~[u8] { to_bytes(*self) }
24222419
}
24232420
24242421
pub trait OwnedStr {

branches/try2/src/libstd/deque.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,61 @@ pub struct Deque<T> {
2222
}
2323

2424
impl<T> Container for Deque<T> {
25+
/// Return the number of elements in the deque
2526
pure fn len(&self) -> uint { self.nelts }
27+
28+
/// Return true if the deque contains no elements
2629
pure fn is_empty(&self) -> bool { self.len() == 0 }
2730
}
2831

2932
impl<T> Mutable for Deque<T> {
33+
/// Clear the deque, removing all values.
3034
fn clear(&mut self) {
31-
for vec::each_mut(self.elts) |x| { *x = None }
35+
for self.elts.each_mut |x| { *x = None }
3236
self.nelts = 0;
3337
self.lo = 0;
3438
self.hi = 0;
3539
}
3640
}
3741

3842
pub impl<T> Deque<T> {
43+
/// Create an empty Deque
3944
static pure fn new() -> Deque<T> {
4045
Deque{nelts: 0, lo: 0, hi: 0,
4146
elts: vec::from_fn(initial_capacity, |_| None)}
4247
}
4348

49+
/// Return a reference to the first element in the deque
50+
///
51+
/// Fails if the deque is empty
4452
fn peek_front(&self) -> &self/T { get(self.elts, self.lo) }
53+
54+
/// Return a reference to the last element in the deque
55+
///
56+
/// Fails if the deque is empty
4557
fn peek_back(&self) -> &self/T { get(self.elts, self.hi - 1u) }
4658

59+
/// Retrieve an element in the deque by index
60+
///
61+
/// Fails if there is no element with the given index
4762
fn get(&self, i: int) -> &self/T {
4863
let idx = (self.lo + (i as uint)) % self.elts.len();
4964
get(self.elts, idx)
5065
}
5166

67+
/// Remove and return the first element in the deque
68+
///
69+
/// Fails if the deque is empty
5270
fn pop_front(&mut self) -> T {
5371
let mut result = self.elts[self.lo].swap_unwrap();
5472
self.lo = (self.lo + 1u) % self.elts.len();
5573
self.nelts -= 1u;
5674
result
5775
}
5876

77+
/// Remove and return the last element in the deque
78+
///
79+
/// Fails if the deque is empty
5980
fn pop_back(&mut self) -> T {
6081
if self.hi == 0u {
6182
self.hi = self.elts.len() - 1u;
@@ -66,6 +87,7 @@ pub impl<T> Deque<T> {
6687
result
6788
}
6889

90+
/// Prepend an element to the deque
6991
fn add_front(&mut self, t: T) {
7092
let oldlo = self.lo;
7193
if self.lo == 0u {
@@ -80,6 +102,7 @@ pub impl<T> Deque<T> {
80102
self.nelts += 1u;
81103
}
82104

105+
/// Append an element to the deque
83106
fn add_back(&mut self, t: T) {
84107
if self.lo == self.hi && self.nelts != 0u {
85108
self.elts = grow(self.nelts, self.lo, self.elts);

branches/try2/src/libsyntax/codemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl cmp::Eq for span {
140140

141141
impl<S:Encoder> Encodable<S> for span {
142142
/* Note #1972 -- spans are encoded but not decoded */
143-
fn encode(&self, _s: &S) { _s.emit_nil() }
143+
fn encode(&self, _s: &S) { }
144144
}
145145

146146
impl<D:Decoder> Decodable<D> for span {

branches/try2/src/libsyntax/parse/mod.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,10 @@ mod test {
297297
use std;
298298
use core::io;
299299
use core::option::None;
300+
use core::str;
300301
use util::testing::*;
301302

302-
#[test] fn to_json_str<E : Encodable<std::json::Encoder>>(val: @E) -> ~str {
303+
#[test] fn to_json_str (val: @Encodable<std::json::Encoder>) -> ~str {
303304
do io::with_str_writer |writer| {
304305
val.encode(~std::json::Encoder(writer));
305306
}
@@ -311,18 +312,18 @@ mod test {
311312
@~"fn foo (x : int) { x; }",
312313
~[],
313314
new_parse_sess(None));
314-
check_equal(to_json_str(@tts),
315-
~"[[\"tt_tok\",[null,[\"IDENT\",[\"fn\",false]]]],\
316-
[\"tt_tok\",[null,[\"IDENT\",[\"foo\",false]]]],\
317-
[\"tt_delim\",[[[\"tt_tok\",[null,[\"LPAREN\",[]]]],\
318-
[\"tt_tok\",[null,[\"IDENT\",[\"x\",false]]]],\
319-
[\"tt_tok\",[null,[\"COLON\",[]]]],\
320-
[\"tt_tok\",[null,[\"IDENT\",[\"int\",false]]]],\
321-
[\"tt_tok\",[null,[\"RPAREN\",[]]]]]]],\
322-
[\"tt_delim\",[[[\"tt_tok\",[null,[\"LBRACE\",[]]]],\
323-
[\"tt_tok\",[null,[\"IDENT\",[\"x\",false]]]],\
324-
[\"tt_tok\",[null,[\"SEMI\",[]]]],\
325-
[\"tt_tok\",[null,[\"RBRACE\",[]]]]]]]]"
315+
check_equal(to_json_str(@tts as @Encodable<std::json::Encoder>),
316+
~"[[\"tt_tok\",[,[\"IDENT\",[\"fn\",false]]]],\
317+
[\"tt_tok\",[,[\"IDENT\",[\"foo\",false]]]],\
318+
[\"tt_delim\",[[[\"tt_tok\",[,[\"LPAREN\",[]]]],\
319+
[\"tt_tok\",[,[\"IDENT\",[\"x\",false]]]],\
320+
[\"tt_tok\",[,[\"COLON\",[]]]],\
321+
[\"tt_tok\",[,[\"IDENT\",[\"int\",false]]]],\
322+
[\"tt_tok\",[,[\"RPAREN\",[]]]]]]],\
323+
[\"tt_delim\",[[[\"tt_tok\",[,[\"LBRACE\",[]]]],\
324+
[\"tt_tok\",[,[\"IDENT\",[\"x\",false]]]],\
325+
[\"tt_tok\",[,[\"SEMI\",[]]]],\
326+
[\"tt_tok\",[,[\"RBRACE\",[]]]]]]]]"
326327
);
327328
let ast1 = new_parser_from_tts(new_parse_sess(None),~[],tts)
328329
.parse_item(~[]);

branches/try2/src/rustllvm/RustWrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
433433
Options.EnableSegmentedStacks = EnableSegmentedStacks;
434434

435435
std::string Err;
436-
std::string Trip(Triple::normalize(triple));
436+
const Target *TheTarget = TargetRegistry::lookupTarget(triple, Err);
437437
std::string FeaturesStr;
438+
std::string Trip(triple);
438439
std::string CPUStr("generic");
439-
const Target *TheTarget = TargetRegistry::lookupTarget(Trip, Err);
440440
TargetMachine *Target =
441441
TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr,
442442
Options, Reloc::PIC_,

0 commit comments

Comments
 (0)