Skip to content

Commit b82e3f9

Browse files
committed
---
yaml --- r: 140227 b: refs/heads/try2 c: 418f991 h: refs/heads/master i: 140225: 75f3327 140223: ce352c7 v: v3
1 parent 4677d4d commit b82e3f9

File tree

21 files changed

+42
-54
lines changed

21 files changed

+42
-54
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: 70b9ad1748748d93ccef95b59435a7357b350d11
8+
refs/heads/try2: 418f99111852d13e9446c70cd616e6e6780bb632
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/header.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,13 @@ pub fn load_props(testfile: &Path) -> TestProps {
8282
}
8383

8484
pub fn is_test_ignored(config: config, testfile: &Path) -> bool {
85-
let mut found = false;
8685
for iter_header(testfile) |ln| {
8786
if parse_name_directive(ln, ~"xfail-test") { return true; }
8887
if parse_name_directive(ln, xfail_target()) { return true; }
8988
if config.mode == common::mode_pretty &&
9089
parse_name_directive(ln, ~"xfail-pretty") { return true; }
9190
};
92-
return found;
91+
return false;
9392

9493
fn xfail_target() -> ~str {
9594
~"xfail-" + str::from_slice(os::SYSNAME)

branches/try2/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn run_rpass_test(config: config, props: TestProps, testfile: &Path) {
106106
fatal_ProcRes(~"test run failed!", ProcRes);
107107
}
108108
} else {
109-
let mut ProcRes = jit_test(config, props, testfile);
109+
let ProcRes = jit_test(config, props, testfile);
110110
111111
if ProcRes.status != 0 { fatal_ProcRes(~"jit failed!", ProcRes); }
112112
}

branches/try2/src/libcore/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn empty_cell<T>() -> Cell<T> {
4242
pub impl<T> Cell<T> {
4343
/// Yields the value, failing if the cell is empty.
4444
fn take(&self) -> T {
45-
let mut self = unsafe { transmute_mut(self) };
45+
let self = unsafe { transmute_mut(self) };
4646
if self.is_empty() {
4747
fail!(~"attempt to take an empty cell");
4848
}
@@ -54,7 +54,7 @@ pub impl<T> Cell<T> {
5454
5555
/// Returns the value, failing if the cell is full.
5656
fn put_back(&self, value: T) {
57-
let mut self = unsafe { transmute_mut(self) };
57+
let self = unsafe { transmute_mut(self) };
5858
if !self.is_empty() {
5959
fail!(~"attempt to put a value back into a full cell");
6060
}

branches/try2/src/libcore/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ impl<T: Owned> Selectable for Port<T> {
205205
fn header(&self) -> *PacketHeader {
206206
unsafe {
207207
match self.endp {
208-
Some(ref endp) => endp.header(),
209-
None => fail!(~"peeking empty stream")
208+
Some(ref endp) => endp.header(),
209+
None => fail!(~"peeking empty stream")
210210
}
211211
}
212212
}

branches/try2/src/libcore/flate.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Simple compression
1616

1717
use libc;
1818
use libc::{c_void, size_t, c_int};
19-
use ptr;
2019
use vec;
2120

2221
#[cfg(test)] use rand;
@@ -29,13 +28,13 @@ pub mod rustrt {
2928
pub extern {
3029
unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
3130
src_buf_len: size_t,
32-
pout_len: *size_t,
31+
pout_len: *mut size_t,
3332
flags: c_int)
3433
-> *c_void;
3534

3635
unsafe fn tinfl_decompress_mem_to_heap(psrc_buf: *const c_void,
3736
src_buf_len: size_t,
38-
pout_len: *size_t,
37+
pout_len: *mut size_t,
3938
flags: c_int)
4039
-> *c_void;
4140
}
@@ -53,11 +52,11 @@ pub fn deflate_bytes(bytes: &const [u8]) -> ~[u8] {
5352
let res =
5453
rustrt::tdefl_compress_mem_to_heap(b as *c_void,
5554
len as size_t,
56-
&outsz,
55+
&mut outsz,
5756
lz_norm);
5857
assert!(res as int != 0);
5958
let out = vec::raw::from_buf_raw(res as *u8,
60-
outsz as uint);
59+
outsz as uint);
6160
libc::free(res);
6261
out
6362
}
@@ -67,11 +66,11 @@ pub fn deflate_bytes(bytes: &const [u8]) -> ~[u8] {
6766
pub fn inflate_bytes(bytes: &const [u8]) -> ~[u8] {
6867
do vec::as_const_buf(bytes) |b, len| {
6968
unsafe {
70-
let outsz : size_t = 0;
69+
let mut outsz : size_t = 0;
7170
let res =
7271
rustrt::tinfl_decompress_mem_to_heap(b as *c_void,
7372
len as size_t,
74-
&outsz,
73+
&mut outsz,
7574
0);
7675
assert!(res as int != 0);
7776
let out = vec::raw::from_buf_raw(res as *u8,

branches/try2/src/libcore/libc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ pub mod types {
253253
pub type ssize_t = i32;
254254
}
255255
pub mod posix01 {
256-
use libc::types::os::arch::c95::{c_int, c_short, c_long,
257-
time_t};
256+
use libc::types::os::arch::c95::{c_short, c_long, time_t};
258257
use libc::types::os::arch::posix88::{dev_t, gid_t, ino_t};
259258
use libc::types::os::arch::posix88::{mode_t, off_t};
260259
use libc::types::os::arch::posix88::{uid_t};

branches/try2/src/libcore/os.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,13 @@ pub fn fsync_fd(fd: c_int, _l: io::fsync::Level) -> c_int {
351351
}
352352
}
353353

354-
pub struct Pipe { mut in: c_int, mut out: c_int }
354+
pub struct Pipe { in: c_int, out: c_int }
355355

356356
#[cfg(unix)]
357357
pub fn pipe() -> Pipe {
358358
unsafe {
359359
let mut fds = Pipe {in: 0 as c_int,
360-
out: 0 as c_int };
360+
out: 0 as c_int };
361361
assert!((libc::pipe(&mut fds.in) == (0 as c_int)));
362362
return Pipe {in: fds.in, out: fds.out};
363363
}
@@ -373,8 +373,7 @@ pub fn pipe() -> Pipe {
373373
// fully understand. Here we explicitly make the pipe non-inheritable,
374374
// which means to pass it to a subprocess they need to be duplicated
375375
// first, as in rust_run_program.
376-
let mut fds = Pipe {in: 0 as c_int,
377-
out: 0 as c_int };
376+
let mut fds = Pipe {in: 0 as c_int, out: 0 as c_int};
378377
let res = libc::pipe(&mut fds.in, 1024 as ::libc::c_uint,
379378
(libc::O_BINARY | libc::O_NOINHERIT) as c_int);
380379
assert!((res == 0 as c_int));
@@ -959,10 +958,10 @@ pub fn last_os_error() -> ~str {
959958
#[cfg(target_os = "macos")]
960959
#[cfg(target_os = "android")]
961960
#[cfg(target_os = "freebsd")]
962-
fn strerror_r(errnum: c_int, buf: *c_char, buflen: size_t) -> c_int {
961+
fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int {
963962
#[nolink]
964963
extern {
965-
unsafe fn strerror_r(errnum: c_int, buf: *c_char,
964+
unsafe fn strerror_r(errnum: c_int, buf: *mut c_char,
966965
buflen: size_t) -> c_int;
967966
}
968967
unsafe {
@@ -974,10 +973,10 @@ pub fn last_os_error() -> ~str {
974973
// and requires macros to instead use the POSIX compliant variant.
975974
// So we just use __xpg_strerror_r which is always POSIX compliant
976975
#[cfg(target_os = "linux")]
977-
fn strerror_r(errnum: c_int, buf: *c_char, buflen: size_t) -> c_int {
976+
fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int {
978977
#[nolink]
979978
extern {
980-
unsafe fn __xpg_strerror_r(errnum: c_int, buf: *c_char,
979+
unsafe fn __xpg_strerror_r(errnum: c_int, buf: *mut c_char,
981980
buflen: size_t) -> c_int;
982981
}
983982
unsafe {
@@ -987,7 +986,7 @@ pub fn last_os_error() -> ~str {
987986
988987
let mut buf = [0 as c_char, ..TMPBUF_SZ];
989988
unsafe {
990-
let err = strerror_r(errno() as c_int, &buf[0],
989+
let err = strerror_r(errno() as c_int, &mut buf[0],
991990
TMPBUF_SZ as size_t);
992991
if err < 0 {
993992
fail!(~"strerror_r failure");

branches/try2/src/libcore/rt/sched/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ pub impl Scheduler {
136136
/// Called by a running task to end execution, after which it will
137137
/// be recycled by the scheduler for reuse in a new task.
138138
fn terminate_current_task(~self) {
139-
let mut self = self;
140139
assert!(self.in_task_context());
141140

142141
rtdebug!("ending running task");
@@ -152,7 +151,6 @@ pub impl Scheduler {
152151
}
153152

154153
fn schedule_new_task(~self, task: ~Task) {
155-
let mut self = self;
156154
assert!(self.in_task_context());
157155

158156
do self.switch_running_tasks_and_then(task) |last_task| {

branches/try2/src/libcore/unstable/extfmt.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ pub mod rt {
501501
pub fn conv_int(cv: Conv, i: int, buf: &mut ~str) {
502502
let radix = 10;
503503
let prec = get_int_precision(cv);
504-
let mut s : ~str = uint_to_str_prec(int::abs(i) as uint, radix, prec);
504+
let s : ~str = uint_to_str_prec(int::abs(i) as uint, radix, prec);
505505
506506
let head = if i >= 0 {
507507
if have_flag(cv.flags, flag_sign_always) {
@@ -516,7 +516,7 @@ pub mod rt {
516516
}
517517
pub fn conv_uint(cv: Conv, u: uint, buf: &mut ~str) {
518518
let prec = get_int_precision(cv);
519-
let mut rs =
519+
let rs =
520520
match cv.ty {
521521
TyDefault => uint_to_str_prec(u, 10, prec),
522522
TyHexLower => uint_to_str_prec(u, 16, prec),
@@ -559,7 +559,7 @@ pub mod rt {
559559
CountIs(c) => (float::to_str_exact, c as uint),
560560
CountImplied => (float::to_str_digits, 6u)
561561
};
562-
let mut s = to_str(f, digits);
562+
let s = to_str(f, digits);
563563
let head = if 0.0 <= f {
564564
if have_flag(cv.flags, flag_sign_always) {
565565
Some('+')

branches/try2/src/libcore/vec.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,12 +1826,9 @@ impl<'self,T:Copy> CopyableVector<T> for &'self [T] {
18261826
#[inline]
18271827
fn to_owned(&self) -> ~[T] {
18281828
let mut result = ~[];
1829-
// FIXME: #4568
1830-
unsafe {
1831-
reserve(&mut result, self.len());
1832-
for self.each |e| {
1833-
result.push(copy *e);
1834-
}
1829+
reserve(&mut result, self.len());
1830+
for self.each |e| {
1831+
result.push(copy *e);
18351832
}
18361833
result
18371834

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use syntax::ast_util::local_def;
2828
use syntax::visit::{default_simple_visitor, mk_simple_visitor, SimpleVisitor};
2929
use syntax::visit::visit_crate;
3030

31-
use core::cast::transmute;
3231
use core::hashmap::HashMap;
3332

3433
pub enum LangItem {
@@ -370,7 +369,7 @@ pub impl LanguageItemCollector {
370369
}
371370

372371
fn collect_local_language_items(&mut self) {
373-
let this = ptr::addr_of(&self);
372+
let this: *mut LanguageItemCollector = &mut *self;
374373
visit_crate(self.crate, (), mk_simple_visitor(@SimpleVisitor {
375374
visit_item: |item| {
376375
for item.attrs.each |attribute| {
@@ -380,10 +379,10 @@ pub impl LanguageItemCollector {
380379
attribute.node.value
381380
);
382381
}
383-
},
384-
.. *default_simple_visitor()
385-
}));
386-
}
382+
}
383+
},
384+
.. *default_simple_visitor()
385+
}));
387386
}
388387

389388
fn collect_external_language_items(&mut self) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ pub fn compute_moves(tcx: ty::ctxt,
299299
pub fn moved_variable_node_id_from_def(def: def) -> Option<node_id> {
300300
match def {
301301
def_binding(nid, _) |
302-
def_arg(nid, _, _) |
302+
def_arg(nid, _) |
303303
def_local(nid, _) |
304304
def_self(nid, _) => Some(nid),
305305

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ use middle::ty::{ReSkolemized, ReVar};
1313
use middle::ty::{bound_region, br_anon, br_named, br_self, br_cap_avoid};
1414
use middle::ty::{br_fresh, ctxt, field, method};
1515
use middle::ty::{mt, t, param_bound, param_ty};
16-
use middle::ty::{re_bound, re_free, re_scope, re_infer, re_static, Region};
16+
use middle::ty::{re_bound, re_free, re_scope, re_infer, re_static, Region,
17+
re_empty};
1718
use middle::ty::{ty_bool, ty_bot, ty_box, ty_struct, ty_enum};
1819
use middle::ty::{ty_err, ty_estr, ty_evec, ty_float, ty_bare_fn, ty_closure};
1920
use middle::ty::{ty_nil, ty_opaque_box, ty_opaque_closure_ptr, ty_param};

branches/try2/src/libstd/ebml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ pub mod writer {
617617
priv impl Encoder {
618618
// used internally to emit things like the vector length and so on
619619
fn _emit_tagged_uint(&self, t: EbmlEncoderTag, v: uint) {
620-
assert!(v <= 0xFFFF_FFFF_u);
620+
assert!(v <= 0xFFFF_FFFF_u); // FIXME(#6130) assert warns on 32-bit
621621
self.wr_tagged_u32(t as uint, v as u32);
622622
}
623623

branches/try2/src/libstd/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
use core::cast;
2525
use core::cell::Cell;
26-
use core::comm::{ChanOne, PortOne, oneshot, send_one};
26+
use core::comm::{PortOne, oneshot, send_one};
2727
use core::pipes::recv;
2828
use core::task;
2929

branches/try2/src/libstd/sort.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//! Sorting methods
1212
1313
use core::cmp::{Eq, Ord};
14-
use core::util;
1514
use core::vec::len;
1615
use core::vec;
1716

branches/try2/src/libstd/workcache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use sort;
1717

1818
use core::cell::Cell;
1919
use core::cmp;
20-
use core::comm::{ChanOne, PortOne, oneshot, send_one};
20+
use core::comm::{PortOne, oneshot, send_one};
2121
use core::either::{Either, Left, Right};
2222
use core::hashmap::HashMap;
2323
use core::io;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use parse::token::{ident_interner, mk_ident_interner};
2424
use core::io;
2525
use core::option::{None, Option, Some};
2626
use core::path::Path;
27-
use core::result::{Err, Ok, Result};
27+
use core::result::{Err, Ok};
2828

2929
pub mod lexer;
3030
pub mod parser;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ pub impl Parser {
938938
match *self.token {
939939
token::MOD_SEP => {
940940
match self.look_ahead(1u) {
941-
token::IDENT(id,_) => {
941+
token::IDENT(*) => {
942942
self.bump();
943943
ids.push(self.parse_ident());
944944
}
@@ -3728,7 +3728,6 @@ pub impl Parser {
37283728
items: _,
37293729
foreign_items: foreign_items
37303730
} = self.parse_foreign_items(first_item_attrs, true);
3731-
let mut initial_attrs = attrs_remaining;
37323731
assert!(*self.token == token::RBRACE);
37333732
ast::foreign_mod {
37343733
sort: sort,
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// error-pattern:illegal borrow: borrowed value does not live long enough
2-
31
fn main() {
42
let v = ~"test";
53
let sslice = str::slice(v, 0, v.len());
4+
//~^ ERROR borrowed value does not live long enough
65
fail!(sslice);
76
}

0 commit comments

Comments
 (0)