Skip to content

Commit 7149dad

Browse files
committed
---
yaml --- r: 128861 b: refs/heads/try c: ab65869 h: refs/heads/master i: 128859: 62b88fa v: v3
1 parent 48b59d1 commit 7149dad

File tree

11 files changed

+43
-162
lines changed

11 files changed

+43
-162
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: 07d86b46a949a94223da714e35b343243e4ecce4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
5-
refs/heads/try: cf71f1c7b077c93b33360fd5af6442fff2e39876
5+
refs/heads/try: ab65869c9d67bdc9d7ca9e7c80bb9a4460f1029e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/etc/vim/ftplugin/rust.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ if exists("g:loaded_delimitMate")
5656
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
5757
endif
5858

59+
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
60+
let b:rust_set_foldmethod=1
61+
setlocal foldmethod=syntax
62+
if g:rust_fold == 2
63+
setlocal foldlevel<
64+
else
65+
setlocal foldlevel=99
66+
endif
67+
endif
68+
5969
if has('conceal') && exists('g:rust_conceal')
6070
let b:rust_set_conceallevel=1
6171
setlocal conceallevel=2
@@ -108,6 +118,10 @@ let b:undo_ftplugin = "
108118
\|else
109119
\|unlet! b:delimitMate_excluded_regions
110120
\|endif
121+
\|if exists('b:rust_set_foldmethod')
122+
\|setlocal foldmethod< foldlevel<
123+
\|unlet b:rust_set_foldmethod
124+
\|endif
111125
\|if exists('b:rust_set_conceallevel')
112126
\|setlocal conceallevel<
113127
\|unlet b:rust_set_conceallevel

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ elseif exists("b:current_syntax")
1111
finish
1212
endif
1313

14-
" Fold settings {{{1
15-
16-
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
17-
setlocal foldmethod=syntax
18-
if g:rust_fold == 2
19-
setlocal foldlevel<
20-
else
21-
setlocal foldlevel=99
22-
endif
23-
endif
24-
2514
" Syntax definitions {{{1
2615
" Basic keywords {{{2
2716
syn keyword rustConditional match if else

branches/try/src/libnum/complex.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,6 @@ mod test {
257257
assert_eq!(_1_0i.inv(), _1_0i.inv());
258258
}
259259

260-
#[test]
261-
#[should_fail]
262-
fn test_divide_by_zero_natural() {
263-
let n = Complex::new(2i, 3i);
264-
let d = Complex::new(0, 0);
265-
let _x = n / d;
266-
}
267-
268260
#[test]
269261
#[should_fail]
270262
#[ignore]

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,7 +2278,7 @@ pub fn get_fn_llvm_attributes(ccx: &CrateContext, fn_ty: ty::t)
22782278
match ty::get(ret_ty).sty {
22792279
// `~` pointer return values never alias because ownership
22802280
// is transferred
2281-
ty::ty_uniq(it) if match ty::get(it).sty {
2281+
ty::ty_uniq(it) if match ty::get(it).sty {
22822282
ty::ty_str | ty::ty_vec(..) | ty::ty_trait(..) => true, _ => false
22832283
} => {}
22842284
ty::ty_uniq(_) => {
@@ -2354,21 +2354,15 @@ pub fn get_fn_llvm_attributes(ccx: &CrateContext, fn_ty: ty::t)
23542354
}
23552355

23562356
// `&mut` pointer parameters never alias other parameters, or mutable global data
2357-
//
2358-
// `&T` where `T` contains no `UnsafeCell<U>` is immutable, and can be marked as both
2359-
// `readonly` and `noalias`, as LLVM's definition of `noalias` is based solely on
2360-
// memory dependencies rather than pointer equality
2357+
// `&` pointer parameters never alias either (for LLVM's purposes) as long as the
2358+
// interior is safe
23612359
ty::ty_rptr(b, mt) if mt.mutbl == ast::MutMutable ||
23622360
!ty::type_contents(ccx.tcx(), mt.ty).interior_unsafe() => {
23632361

23642362
let llsz = llsize_of_real(ccx, type_of::type_of(ccx, mt.ty));
23652363
attrs.arg(idx, llvm::NoAliasAttribute)
23662364
.arg(idx, llvm::DereferenceableAttribute(llsz));
23672365

2368-
if mt.mutbl == ast::MutImmutable {
2369-
attrs.arg(idx, llvm::ReadOnlyAttribute);
2370-
}
2371-
23722366
match b {
23732367
ReLateBound(_, BrAnon(_)) => {
23742368
attrs.arg(idx, llvm::NoCaptureAttribute);

branches/try/src/librustc/middle/trans/controlflow.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,13 @@ pub fn trans_for<'a>(
330330
// Check the discriminant; if the `None` case, exit the loop.
331331
let option_representation = adt::represent_type(loopback_bcx_out.ccx(),
332332
method_result_type);
333+
let i8_type = Type::i8(loopback_bcx_out.ccx());
333334
let lldiscriminant = adt::trans_get_discr(loopback_bcx_out,
334335
&*option_representation,
335336
option_datum.val,
336-
None);
337-
let i1_type = Type::i1(loopback_bcx_out.ccx());
338-
let llcondition = Trunc(loopback_bcx_out, lldiscriminant, i1_type);
337+
Some(i8_type));
338+
let llzero = C_u8(loopback_bcx_out.ccx(), 0);
339+
let llcondition = ICmp(loopback_bcx_out, IntNE, lldiscriminant, llzero);
339340
CondBr(loopback_bcx_out, llcondition, body_bcx_in.llbb, cleanup_llbb);
340341

341342
// Now we're in the body. Unpack the `Option` value into the programmer-

branches/try/src/librustc/middle/trans/glue.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,8 @@ fn trans_struct_drop<'a>(bcx: &'a Block<'a>,
250250
let args = vec!(self_arg);
251251

252252
// Add all the fields as a value which needs to be cleaned at the end of
253-
// this scope. Iterate in reverse order so a Drop impl doesn't reverse
254-
// the order in which fields get dropped.
255-
for (i, ty) in st.fields.iter().enumerate().rev() {
253+
// this scope.
254+
for (i, ty) in st.fields.iter().enumerate() {
256255
let llfld_a = adt::struct_field_ptr(variant_cx, &*st, value, i, false);
257256
variant_cx.fcx.schedule_drop_mem(cleanup::CustomScope(field_scope),
258257
llfld_a, *ty);

branches/try/src/libstd/io/util.rs

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ impl<R: Reader> Reader for LimitReader<R> {
4848
}
4949

5050
let len = cmp::min(self.limit, buf.len());
51-
let res = self.inner.read(buf.mut_slice_to(len));
52-
match res {
53-
Ok(len) => self.limit -= len,
54-
_ => {}
55-
}
56-
res
51+
self.inner.read(buf.mut_slice_to(len)).map(|len| {
52+
self.limit -= len;
53+
len
54+
})
5755
}
5856
}
5957

@@ -69,8 +67,6 @@ impl<R: Buffer> Buffer for LimitReader<R> {
6967
}
7068

7169
fn consume(&mut self, amt: uint) {
72-
// Don't let callers reset the limit by passing an overlarge value
73-
let amt = cmp::min(amt, self.limit);
7470
self.limit -= amt;
7571
self.inner.consume(amt);
7672
}
@@ -101,7 +97,6 @@ impl Buffer for ZeroReader {
10197
static DATA: [u8, ..64] = [0, ..64];
10298
Ok(DATA.as_slice())
10399
}
104-
105100
fn consume(&mut self, _amt: uint) {}
106101
}
107102

@@ -122,10 +117,7 @@ impl Buffer for NullReader {
122117
fn consume(&mut self, _amt: uint) {}
123118
}
124119

125-
/// A `Writer` which multiplexes writes to a set of `Writer`s.
126-
///
127-
/// The `Writer`s are delegated to in order. If any `Writer` returns an error,
128-
/// that error is returned immediately and remaining `Writer`s are not called.
120+
/// A `Writer` which multiplexes writes to a set of `Writers`.
129121
pub struct MultiWriter {
130122
writers: Vec<Box<Writer>>
131123
}
@@ -140,22 +132,24 @@ impl MultiWriter {
140132
impl Writer for MultiWriter {
141133
#[inline]
142134
fn write(&mut self, buf: &[u8]) -> io::IoResult<()> {
135+
let mut ret = Ok(());
143136
for writer in self.writers.mut_iter() {
144-
try!(writer.write(buf));
137+
ret = ret.and(writer.write(buf));
145138
}
146-
Ok(())
139+
return ret;
147140
}
148141

149142
#[inline]
150143
fn flush(&mut self) -> io::IoResult<()> {
144+
let mut ret = Ok(());
151145
for writer in self.writers.mut_iter() {
152-
try!(writer.flush());
146+
ret = ret.and(writer.flush());
153147
}
154-
Ok(())
148+
return ret;
155149
}
156150
}
157151

158-
/// A `Reader` which chains input from multiple `Reader`s, reading each to
152+
/// A `Reader` which chains input from multiple `Readers`, reading each to
159153
/// completion before moving onto the next.
160154
pub struct ChainedReader<I, R> {
161155
readers: I,
@@ -235,16 +229,17 @@ pub fn copy<R: Reader, W: Writer>(r: &mut R, w: &mut W) -> io::IoResult<()> {
235229
}
236230
}
237231

238-
/// An adaptor converting an `Iterator<u8>` to a `Reader`.
232+
/// A `Reader` which converts an `Iterator<u8>` into a `Reader`.
239233
pub struct IterReader<T> {
240234
iter: T,
241235
}
242236

243237
impl<T: Iterator<u8>> IterReader<T> {
244-
/// Creates a new `IterReader` which will read from the specified
245-
/// `Iterator`.
238+
/// Create a new `IterReader` which will read from the specified `Iterator`.
246239
pub fn new(iter: T) -> IterReader<T> {
247-
IterReader { iter: iter }
240+
IterReader {
241+
iter: iter,
242+
}
248243
}
249244
}
250245

@@ -256,7 +251,7 @@ impl<T: Iterator<u8>> Reader for IterReader<T> {
256251
*slot = elt;
257252
len += 1;
258253
}
259-
if len == 0 && buf.len() != 0 {
254+
if len == 0 {
260255
Err(io::standard_error(io::EndOfFile))
261256
} else {
262257
Ok(len)
@@ -302,14 +297,6 @@ mod test {
302297
assert_eq!(0, r.limit());
303298
}
304299

305-
#[test]
306-
fn test_limit_reader_overlong_consume() {
307-
let mut r = MemReader::new(vec![0, 1, 2, 3, 4, 5]);
308-
let mut r = LimitReader::new(r.by_ref(), 1);
309-
r.consume(2);
310-
assert_eq!(vec![], r.read_to_end().unwrap());
311-
}
312-
313300
#[test]
314301
fn test_null_writer() {
315302
let mut s = NullWriter;
@@ -428,11 +415,4 @@ mod test {
428415

429416
assert_eq!(r.read(buf).unwrap_err().kind, io::EndOfFile);
430417
}
431-
432-
#[test]
433-
fn iter_reader_zero_length() {
434-
let mut r = IterReader::new(range(0u8, 8));
435-
let mut buf = [];
436-
assert_eq!(Ok(0), r.read(buf));
437-
}
438418
}

branches/try/src/libstd/time/duration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ macro_rules! try_opt(
3838
// FIXME #16466: This could be represented as (i64 seconds, u32 nanos)
3939
/// ISO 8601 time duration with nanosecond precision.
4040
/// This also allows for the negative duration; see individual methods for details.
41-
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
41+
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
4242
pub struct Duration {
4343
days: i32,
4444
secs: u32, // Always < SECS_PER_DAY

branches/try/src/rustllvm/RustWrapper.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,7 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateSubroutineType(
282282
LLVMValueRef ParameterTypes) {
283283
return wrap(Builder->createSubroutineType(
284284
unwrapDI<DIFile>(File),
285-
#if LLVM_VERSION_MINOR >= 6
286285
unwrapDI<DITypeArray>(ParameterTypes)));
287-
#else
288-
unwrapDI<DIArray>(ParameterTypes)));
289-
#endif
290286
}
291287

292288
extern "C" LLVMValueRef LLVMDIBuilderCreateFunction(
@@ -638,11 +634,7 @@ extern "C" void LLVMDICompositeTypeSetTypeArray(
638634
LLVMValueRef CompositeType,
639635
LLVMValueRef TypeArray)
640636
{
641-
#if LLVM_VERSION_MINOR >= 6
642637
unwrapDI<DICompositeType>(CompositeType).setArrays(unwrapDI<DIArray>(TypeArray));
643-
#else
644-
unwrapDI<DICompositeType>(CompositeType).setTypeArray(unwrapDI<DIArray>(TypeArray));
645-
#endif
646638
}
647639

648640
extern "C" char *LLVMTypeToString(LLVMTypeRef Type) {

branches/try/src/test/run-pass/issue-16492.rs

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

0 commit comments

Comments
 (0)