Skip to content

Commit aadab54

Browse files
committed
---
yaml --- r: 140719 b: refs/heads/try2 c: ed41864 h: refs/heads/master i: 140717: ca162df 140715: a0a8e0c 140711: abc5ad1 140703: 9ae0c1d v: v3
1 parent ee832e1 commit aadab54

File tree

27 files changed

+59
-157
lines changed

27 files changed

+59
-157
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: 35e6ce548f2008331c0fa50f1cff30ab7b412ab7
8+
refs/heads/try2: ed4186446492e141a4dc37829dc9599133d00dd0
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/compiletest.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#[allow(vecs_implicitly_copyable)];
1414
#[allow(non_camel_case_types)];
15-
#[allow(deprecated_mode)];
1615
#[allow(deprecated_pattern)];
1716

1817
extern mod std(vers = "0.7-pre");

branches/try2/src/libcore/comm.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Message passing
1313
*/
1414

1515
use cast::{transmute, transmute_mut};
16-
use cast;
1716
use either::{Either, Left, Right};
1817
use kinds::Owned;
1918
use option::{Option, Some, None};
@@ -150,7 +149,7 @@ impl<T: Owned> GenericChan<T> for Chan<T> {
150149
#[inline(always)]
151150
fn send(&self, x: T) {
152151
unsafe {
153-
let mut self_endp = transmute_mut(&self.endp);
152+
let self_endp = transmute_mut(&self.endp);
154153
let endp = replace(self_endp, None);
155154
*self_endp = Some(streamp::client::data(endp.unwrap(), x))
156155
}
@@ -161,7 +160,7 @@ impl<T: Owned> GenericSmartChan<T> for Chan<T> {
161160
#[inline(always)]
162161
fn try_send(&self, x: T) -> bool {
163162
unsafe {
164-
let mut self_endp = transmute_mut(&self.endp);
163+
let self_endp = transmute_mut(&self.endp);
165164
let endp = replace(self_endp, None);
166165
match streamp::client::try_data(endp.unwrap(), x) {
167166
Some(next) => {
@@ -178,7 +177,7 @@ impl<T: Owned> GenericPort<T> for Port<T> {
178177
#[inline(always)]
179178
fn recv(&self) -> T {
180179
unsafe {
181-
let mut self_endp = transmute_mut(&self.endp);
180+
let self_endp = transmute_mut(&self.endp);
182181
let endp = replace(self_endp, None);
183182
let streamp::data(x, endp) = recv(endp.unwrap());
184183
*self_endp = Some(endp);
@@ -189,7 +188,7 @@ impl<T: Owned> GenericPort<T> for Port<T> {
189188
#[inline(always)]
190189
fn try_recv(&self) -> Option<T> {
191190
unsafe {
192-
let mut self_endp = transmute_mut(&self.endp);
191+
let self_endp = transmute_mut(&self.endp);
193192
let endp = replace(self_endp, None);
194193
match try_recv(endp.unwrap()) {
195194
Some(streamp::data(x, endp)) => {
@@ -206,7 +205,7 @@ impl<T: Owned> Peekable<T> for Port<T> {
206205
#[inline(always)]
207206
fn peek(&self) -> bool {
208207
unsafe {
209-
let mut self_endp = transmute_mut(&self.endp);
208+
let self_endp = transmute_mut(&self.endp);
210209
let mut endp = replace(self_endp, None);
211210
let peek = match endp {
212211
Some(ref mut endp) => peek(endp),
@@ -220,12 +219,10 @@ impl<T: Owned> Peekable<T> for Port<T> {
220219
221220
impl<T: Owned> Selectable for Port<T> {
222221
fn header(&mut self) -> *mut PacketHeader {
223-
unsafe {
224222
match self.endp {
225223
Some(ref mut endp) => endp.header(),
226224
None => fail!(~"peeking empty stream")
227225
}
228-
}
229226
}
230227
}
231228
@@ -259,7 +256,7 @@ pub impl<T: Owned> PortSet<T> {
259256
impl<T:Owned> GenericPort<T> for PortSet<T> {
260257
fn try_recv(&self) -> Option<T> {
261258
unsafe {
262-
let mut self_ports = transmute_mut(&self.ports);
259+
let self_ports = transmute_mut(&self.ports);
263260
let mut result = None;
264261
// we have to swap the ports array so we aren't borrowing
265262
// aliasable mutable memory.
@@ -351,7 +348,7 @@ pub mod oneshot {
351348
pub fn init<T: Owned>() -> (client::Oneshot<T>, server::Oneshot<T>) {
352349
pub use core::pipes::HasBuffer;
353350
354-
let mut buffer = ~::core::pipes::Buffer {
351+
let buffer = ~::core::pipes::Buffer {
355352
header: ::core::pipes::BufferHeader(),
356353
data: __Buffer {
357354
Oneshot: ::core::pipes::mk_packet::<Oneshot<T>>()

branches/try2/src/libcore/core.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ they contained the following prologue:
6161
#[no_core];
6262

6363
#[deny(non_camel_case_types)];
64-
#[allow(deprecated_mutable_fields)];
6564

6665
// Make core testable by not duplicating lang items. See #2912
6766
#[cfg(test)] extern mod realcore(name = "core", vers = "0.7-pre");

branches/try2/src/libcore/old_iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub trait CopyableNonstrictIter<A:Copy> {
9393
// Like "each", but copies out the value. If the receiver is mutated while
9494
// iterating over it, the semantics must not be memory-unsafe but are
9595
// otherwise undefined.
96-
fn each_val(&const self, f: &fn(A) -> bool) -> bool;
96+
fn each_val(&const self, f: &fn(A) -> bool);
9797
}
9898

9999
// A trait for sequences that can be built by imperatively pushing elements

branches/try2/src/libcore/pipes.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ pub fn send<T,Tbuffer>(mut p: SendPacketBuffered<T,Tbuffer>,
348348
payload: T)
349349
-> bool {
350350
let header = p.header();
351-
let mut p_ = p.unwrap();
351+
let p_ = p.unwrap();
352352
let p = unsafe { &mut *p_ };
353353
assert!(ptr::to_unsafe_ptr(&(p.header)) == header);
354354
assert!(p.payload.is_none());
@@ -405,10 +405,8 @@ a message, or `Some(T)` if a message was received.
405405
*/
406406
pub fn try_recv<T:Owned,Tbuffer:Owned>(mut p: RecvPacketBuffered<T, Tbuffer>)
407407
-> Option<T> {
408-
let mut p_ = p.unwrap();
409-
let mut p = unsafe {
410-
&mut *p_
411-
};
408+
let p_ = p.unwrap();
409+
let p = unsafe { &mut *p_ };
412410
413411
do (|| {
414412
try_recv_(p)

branches/try2/src/libcore/reflect.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
409409
disr_val: int,
410410
n_fields: uint,
411411
name: &str) -> bool {
412-
self.inner.push_ptr(); // NOTE remove after next snapshot
413412
if ! self.inner.visit_enter_enum_variant(variant, disr_val,
414413
n_fields, name) {
415414
return false;
@@ -433,7 +432,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
433432
n_fields, name) {
434433
return false;
435434
}
436-
self.inner.pop_ptr(); // NOTE remove after next snapshot
437435
true
438436
}
439437

branches/try2/src/libcore/rt/uv/net.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ pub impl StreamWatcher {
152152
extern fn close_cb(handle: *uvll::uv_stream_t) {
153153
let mut stream_watcher: StreamWatcher = NativeHandle::from_native_handle(handle);
154154
{
155-
let mut data = get_watcher_data(&mut stream_watcher);
156-
data.close_cb.swap_unwrap()();
155+
get_watcher_data(&mut stream_watcher).close_cb.swap_unwrap()();
157156
}
158157
drop_watcher_data(&mut stream_watcher);
159158
unsafe { free_handle(handle as *c_void) }
@@ -214,8 +213,7 @@ pub impl TcpWatcher {
214213
assert!(get_watcher_data(self).connect_cb.is_none());
215214
get_watcher_data(self).connect_cb = Some(cb);
216215

217-
let mut connect_watcher = ConnectRequest::new();
218-
let connect_handle = connect_watcher.native_handle();
216+
let connect_handle = ConnectRequest::new().native_handle();
219217
match address {
220218
Ipv4(*) => {
221219
do ip4_as_uv_ip4(address) |addr| {

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ impl Drop for UvEventLoop {
4646
let self = unsafe {
4747
transmute::<&UvEventLoop, &mut UvEventLoop>(self)
4848
};
49-
let mut uv_loop = self.uvio.uv_loop();
50-
uv_loop.close();
49+
self.uvio.uv_loop().close();
5150
}
5251
}
5352

@@ -189,9 +188,8 @@ impl TcpListener for UvTcpListener {
189188
let maybe_stream = if status.is_none() {
190189
let mut server_stream_watcher = server_stream_watcher;
191190
let mut loop_ = loop_from_watcher(&server_stream_watcher);
192-
let mut client_tcp_watcher = TcpWatcher::new(&mut loop_);
193-
let client_tcp_watcher = client_tcp_watcher.as_stream();
194-
// XXX: Need's to be surfaced in interface
191+
let client_tcp_watcher = TcpWatcher::new(&mut loop_).as_stream();
192+
// XXX: Needs to be surfaced in interface
195193
server_stream_watcher.accept(client_tcp_watcher);
196194
Some(~UvStream::new(client_tcp_watcher))
197195
} else {

branches/try2/src/libcore/task/spawn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
472472
/*##################################################################*
473473
* Step 1. Get spawner's taskgroup info.
474474
*##################################################################*/
475-
let mut spawner_group: @@mut TCB =
475+
let spawner_group: @@mut TCB =
476476
match local_get(OldHandle(spawner), taskgroup_key!()) {
477477
None => {
478478
// Main task, doing first spawn ever. Lazily initialise

branches/try2/src/libcore/vec.rs

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,37 +2945,34 @@ impl<A:Copy + Ord> old_iter::CopyableOrderedIter<A> for @[A] {
29452945
}
29462946

29472947
impl<'self,A:Copy> old_iter::CopyableNonstrictIter<A> for &'self [A] {
2948-
fn each_val(&const self, f: &fn(A) -> bool) -> bool {
2948+
fn each_val(&const self, f: &fn(A) -> bool) {
29492949
let mut i = 0;
29502950
while i < self.len() {
2951-
if !f(copy self[i]) { return false; }
2951+
if !f(copy self[i]) { break; }
29522952
i += 1;
29532953
}
2954-
return true;
29552954
}
29562955
}
29572956

29582957
// FIXME(#4148): This should be redundant
29592958
impl<A:Copy> old_iter::CopyableNonstrictIter<A> for ~[A] {
2960-
fn each_val(&const self, f: &fn(A) -> bool) -> bool {
2959+
fn each_val(&const self, f: &fn(A) -> bool) {
29612960
let mut i = 0;
29622961
while i < uniq_len(self) {
2963-
if !f(copy self[i]) { return false; }
2962+
if !f(copy self[i]) { break; }
29642963
i += 1;
29652964
}
2966-
return true;
29672965
}
29682966
}
29692967

29702968
// FIXME(#4148): This should be redundant
29712969
impl<A:Copy> old_iter::CopyableNonstrictIter<A> for @[A] {
2972-
fn each_val(&const self, f: &fn(A) -> bool) -> bool {
2970+
fn each_val(&const self, f: &fn(A) -> bool) {
29732971
let mut i = 0;
29742972
while i < self.len() {
2975-
if !f(copy self[i]) { return false; }
2973+
if !f(copy self[i]) { break; }
29762974
i += 1;
29772975
}
2978-
return true;
29792976
}
29802977
}
29812978

@@ -4691,14 +4688,4 @@ mod tests {
46914688
i += 1;
46924689
}
46934690
}
4694-
4695-
#[test]
4696-
fn test_each_val() {
4697-
use old_iter::CopyableNonstrictIter;
4698-
let mut i = 0;
4699-
for [1, 2, 3].each_val |v| {
4700-
i += v;
4701-
}
4702-
assert!(i == 6);
4703-
}
47044691
}

branches/try2/src/librustc/middle/borrowck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
/*! See doc.rs for a thorough explanation of the borrow checker */
1212

13-
use core;
1413
use core::prelude::*;
1514

1615
use mc = middle::mem_categorization;
@@ -22,6 +21,7 @@ use middle::dataflow::DataFlowOperator;
2221
use util::common::stmt_set;
2322
use util::ppaux::{note_and_explain_region, Repr};
2423

24+
use core;
2525
use core::hashmap::{HashSet, HashMap};
2626
use core::io;
2727
use core::result::{Result};

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,6 @@ pub impl mem_categorization_ctxt {
571571
}
572572
}
573573

574-
/// The `field_id` parameter is the ID of the enclosing expression or
575-
/// pattern. It is used to determine which variant of an enum is in use.
576574
fn cat_field<N:ast_node>(&self,
577575
node: N,
578576
base_cmt: cmt,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ use syntax::ast_util::{def_id_of_def, local_def};
6060
use syntax::ast_util::{path_to_ident, walk_pat, trait_method_to_ty_method};
6161
use syntax::ast_util::{Privacy, Public, Private};
6262
use syntax::ast_util::{variant_visibility_to_privacy, visibility_to_privacy};
63-
use syntax::attr::{attr_metas, contains_name, attrs_contains_name};
63+
use syntax::attr::{attr_metas, contains_name};
6464
use syntax::parse::token::ident_interner;
6565
use syntax::parse::token::special_idents;
6666
use syntax::print::pprust::path_to_str;

branches/try2/src/librustc/middle/typeck/infer/region_inference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,12 @@ use middle::typeck::infer::cres;
544544
use util::common::indenter;
545545
use util::ppaux::note_and_explain_region;
546546

547+
use core;
547548
use core::cell::{Cell, empty_cell};
548549
use core::hashmap::{HashMap, HashSet};
549550
use core::to_bytes;
550551
use core::uint;
551552
use core::vec;
552-
use core;
553553
use syntax::codemap::span;
554554
use syntax::ast;
555555

branches/try2/src/libstd/ebml.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -634,13 +634,6 @@ pub mod writer {
634634
use core::vec;
635635
636636
// ebml writing
637-
#[cfg(stage0)]
638-
pub struct Encoder {
639-
writer: @io::Writer,
640-
priv mut size_positions: ~[uint],
641-
}
642-
643-
#[cfg(not(stage0))]
644637
pub struct Encoder {
645638
writer: @io::Writer,
646639
priv size_positions: ~[uint],

branches/try2/src/libstd/fileinput.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ total line count).
9494
}
9595
*/
9696

97-
#[allow(deprecated_mutable_fields)];
98-
9997
use core::io::ReaderUtil;
10098

10199
/**
@@ -212,8 +210,8 @@ impl FileInput {
212210
pub fn next_file(&self) -> bool {
213211
// No more files
214212

215-
// Compiler whines about "illegal borrow unless pure" for
216-
// files.is_empty()
213+
// unsafe block can be removed after the next snapshot
214+
// (next one after 2013-05-03)
217215
if unsafe { self.fi.files.is_empty() } {
218216
self.fi.current_reader = None;
219217
return false;
@@ -337,7 +335,8 @@ impl io::Reader for FileInput {
337335
fn eof(&self) -> bool {
338336
// we've run out of files, and current_reader is either None or eof.
339337

340-
// compiler whines about illegal borrows for files.is_empty()
338+
// unsafe block can be removed after the next snapshot
339+
// (next one after 2013-05-03)
341340
(unsafe { self.fi.files.is_empty() }) &&
342341
match self.fi.current_reader { None => true, Some(r) => r.eof() }
343342

@@ -380,8 +379,7 @@ Fails when attempting to read from a file that can't be opened.
380379
*/
381380
#[cfg(stage0)]
382381
pub fn input(f: &fn(&str) -> bool) {
383-
let mut i = FileInput::from_args();
384-
i.each_line(f);
382+
FileInput::from_args().each_line(f);
385383
}
386384
/**
387385
Iterate directly over the command line arguments (no arguments implies
@@ -404,8 +402,7 @@ Fails when attempting to read from a file that can't be opened.
404402
*/
405403
#[cfg(stage0)]
406404
pub fn input_state(f: &fn(&str, FileInputState) -> bool) {
407-
let mut i = FileInput::from_args();
408-
i.each_line_state(f);
405+
FileInput::from_args().each_line_state(f);
409406
}
410407
/**
411408
Iterate directly over the command line arguments (no arguments
@@ -427,8 +424,7 @@ Fails when attempting to read from a file that can't be opened.
427424
*/
428425
#[cfg(stage0)]
429426
pub fn input_vec(files: ~[Option<Path>], f: &fn(&str) -> bool) {
430-
let mut i = FileInput::from_vec(files);
431-
i.each_line(f);
427+
FileInput::from_vec(files).each_line(f);
432428
}
433429
/**
434430
Iterate over a vector of files (an empty vector implies just `stdin`).
@@ -450,8 +446,7 @@ Fails when attempting to read from a file that can't be opened.
450446
#[cfg(stage0)]
451447
pub fn input_vec_state(files: ~[Option<Path>],
452448
f: &fn(&str, FileInputState) -> bool) {
453-
let mut i = FileInput::from_vec(files);
454-
i.each_line_state(f);
449+
FileInput::from_vec(files).each_line_state(f);
455450
}
456451
/**
457452
Iterate over a vector of files (an empty vector implies just `stdin`)

0 commit comments

Comments
 (0)