Skip to content

Commit 928db82

Browse files
committed
---
yaml --- r: 190263 b: refs/heads/tmp c: bb18a3c h: refs/heads/master i: 190261: a8d94b5 190259: 640cbfa 190255: 653a454 v: v3
1 parent 21ab01b commit 928db82

Some content is hidden

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

96 files changed

+1090
-1206
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 6af2721466018be0fcff43b56730073332eac160
37+
refs/heads/tmp: bb18a3cfe7554143622af4911028605e89c80104
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3939
refs/tags/homu-tmp: d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf

branches/tmp/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,11 @@ then
823823
LLVM_VERSION=$($LLVM_CONFIG --version)
824824

825825
case $LLVM_VERSION in
826-
(3.[2-6]*)
826+
(3.[5-6]*)
827827
msg "found ok version of LLVM: $LLVM_VERSION"
828828
;;
829829
(*)
830-
err "bad LLVM version: $LLVM_VERSION, need >=3.0svn"
830+
err "bad LLVM version: $LLVM_VERSION, need >=3.5"
831831
;;
832832
esac
833833
fi

branches/tmp/mk/main.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
290290
LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
291291
LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
292292
LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
293-
LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))"
294293
LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
295294
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
296295
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),

branches/tmp/mk/target.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8484
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) \
8585
$$(RUST_LIB_FLAGS_ST$(1)) \
8686
-L "$$(RT_OUTPUT_DIR_$(2))" \
87-
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
87+
-L "$$(LLVM_LIBDIR_$(2))" \
8888
$$(LLVM_STDCPP_RUSTFLAGS_$(2)) \
8989
$$(RUSTFLAGS_$(4)) \
9090
--out-dir $$(@D) \

branches/tmp/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
372372
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
373373
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
374374
-L "$$(RT_OUTPUT_DIR_$(2))" \
375-
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
375+
-L "$$(LLVM_LIBDIR_$(2))" \
376376
$$(RUSTFLAGS_$(4))
377377

378378
endef

branches/tmp/src/compiletest/compiletest.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#![feature(std_misc)]
2121
#![feature(test)]
2222
#![feature(core)]
23+
#![feature(io)]
2324
#![feature(net)]
2425
#![feature(path_ext)]
2526

@@ -33,6 +34,7 @@ extern crate log;
3334

3435
use std::env;
3536
use std::fs;
37+
use std::old_io;
3638
use std::path::{Path, PathBuf};
3739
use std::thunk::Thunk;
3840
use getopts::{optopt, optflag, reqopt};
@@ -244,11 +246,7 @@ pub fn run_tests(config: &Config) {
244246
// sadly osx needs some file descriptor limits raised for running tests in
245247
// parallel (especially when we have lots and lots of child processes).
246248
// For context, see #8904
247-
#[allow(deprecated)]
248-
fn raise_fd_limit() {
249-
std::old_io::test::raise_fd_limit();
250-
}
251-
raise_fd_limit();
249+
old_io::test::raise_fd_limit();
252250
// Prevent issue #21352 UAC blocking .exe containing 'patch' etc. on Windows
253251
// If #11207 is resolved (adding manifest to .exe) this becomes unnecessary
254252
env::set_var("__COMPAT_LAYER", "RunAsInvoker");

branches/tmp/src/compiletest/runtest.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use std::io::BufReader;
2626
use std::io::prelude::*;
2727
use std::iter::repeat;
2828
use std::net::TcpStream;
29+
use std::old_io::timer;
2930
use std::path::{Path, PathBuf};
3031
use std::process::{Command, Output, ExitStatus};
3132
use std::str;
@@ -451,11 +452,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
451452
.expect(&format!("failed to exec `{:?}`", config.adb_path));
452453
loop {
453454
//waiting 1 second for gdbserver start
454-
#[allow(deprecated)]
455-
fn sleep() {
456-
::std::old_io::timer::sleep(Duration::milliseconds(1000));
457-
}
458-
sleep();
455+
timer::sleep(Duration::milliseconds(1000));
459456
if TcpStream::connect("127.0.0.1:5039").is_ok() {
460457
break
461458
}

branches/tmp/src/libcollections/btree/node.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,14 @@ impl<K, V> Node<K, V> {
348348
#[inline]
349349
pub fn as_slices<'a>(&'a self) -> (&'a [K], &'a [V]) {
350350
unsafe {(
351-
slice::from_raw_parts(*self.keys, self.len()),
352-
slice::from_raw_parts(*self.vals, self.len()),
351+
mem::transmute(raw::Slice {
352+
data: *self.keys as *const K,
353+
len: self.len()
354+
}),
355+
mem::transmute(raw::Slice {
356+
data: *self.vals as *const V,
357+
len: self.len()
358+
})
353359
)}
354360
}
355361

branches/tmp/src/libcollections/string.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::iter::{IntoIterator, FromIterator};
2424
use core::mem;
2525
use core::ops::{self, Deref, Add, Index};
2626
use core::ptr;
27-
use core::slice;
27+
use core::raw::Slice as RawSlice;
2828
use unicode::str as unicode_str;
2929
use unicode::str::Utf16Item;
3030

@@ -468,11 +468,11 @@ impl String {
468468
unsafe {
469469
// Attempt to not use an intermediate buffer by just pushing bytes
470470
// directly onto this string.
471-
let slice = slice::from_raw_parts_mut (
472-
self.vec.as_mut_ptr().offset(cur_len as isize),
473-
4
474-
);
475-
let used = ch.encode_utf8(slice).unwrap_or(0);
471+
let slice = RawSlice {
472+
data: self.vec.as_ptr().offset(cur_len as isize),
473+
len: 4,
474+
};
475+
let used = ch.encode_utf8(mem::transmute(slice)).unwrap_or(0);
476476
self.vec.set_len(cur_len + used);
477477
}
478478
}

branches/tmp/src/libcollections/vec.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ use core::ops::{Index, IndexMut, Deref, Add};
6464
use core::ops;
6565
use core::ptr;
6666
use core::ptr::Unique;
67+
use core::raw::Slice as RawSlice;
6768
use core::slice;
6869
use core::usize;
6970

@@ -434,7 +435,10 @@ impl<T> Vec<T> {
434435
unsafe {
435436
let ptr = *self.ptr;
436437
assume(!ptr.is_null());
437-
slice::from_raw_parts_mut(ptr, self.len)
438+
mem::transmute(RawSlice {
439+
data: ptr,
440+
len: self.len,
441+
})
438442
}
439443
}
440444

@@ -1556,7 +1560,10 @@ impl<T> AsSlice<T> for Vec<T> {
15561560
unsafe {
15571561
let p = *self.ptr;
15581562
assume(p != 0 as *mut T);
1559-
slice::from_raw_parts(p, self.len)
1563+
mem::transmute(RawSlice {
1564+
data: p,
1565+
len: self.len
1566+
})
15601567
}
15611568
}
15621569
}

branches/tmp/src/libcollections/vec_deque.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use core::num::{Int, UnsignedInt};
2929
use core::num::wrapping::WrappingOps;
3030
use core::ops::{Index, IndexMut};
3131
use core::ptr::{self, Unique};
32-
use core::slice;
32+
use core::raw::Slice as RawSlice;
3333

3434
use core::hash::{Hash, Hasher};
3535
use core::cmp;
@@ -91,13 +91,13 @@ impl<T> VecDeque<T> {
9191
/// Turn ptr into a slice
9292
#[inline]
9393
unsafe fn buffer_as_slice(&self) -> &[T] {
94-
slice::from_raw_parts(*self.ptr, self.cap)
94+
mem::transmute(RawSlice { data: *self.ptr as *const T, len: self.cap })
9595
}
9696

9797
/// Turn ptr into a mut slice
9898
#[inline]
9999
unsafe fn buffer_as_mut_slice(&mut self) -> &mut [T] {
100-
slice::from_raw_parts_mut(*self.ptr, self.cap)
100+
mem::transmute(RawSlice { data: *self.ptr as *const T, len: self.cap })
101101
}
102102

103103
/// Moves an element out of the buffer

branches/tmp/src/libcore/panicking.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,8 @@ use fmt;
3535
#[cold] #[inline(never)] // this is the slow path, always
3636
#[lang="panic"]
3737
pub fn panic(expr_file_line: &(&'static str, &'static str, u32)) -> ! {
38-
// Use Arguments::new_v1 instead of format_args!("{}", expr) to potentially
39-
// reduce size overhead. The format_args! macro uses str's Display trait to
40-
// write expr, which calls Formatter::pad, which must accommodate string
41-
// truncation and padding (even though none is used here). Using
42-
// Arguments::new_v1 may allow the compiler to omit Formatter::pad from the
43-
// output binary, saving up to a few kilobytes.
4438
let (expr, file, line) = *expr_file_line;
45-
panic_fmt(fmt::Arguments::new_v1(&[expr], &[]), &(file, line))
39+
panic_fmt(format_args!("{}", expr), &(file, line))
4640
}
4741

4842
#[cold] #[inline(never)]

branches/tmp/src/libcore/slice.rs

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,10 @@ impl<T> ops::Index<ops::Range<usize>> for [T] {
520520
assert!(index.start <= index.end);
521521
assert!(index.end <= self.len());
522522
unsafe {
523-
from_raw_parts (
524-
self.as_ptr().offset(index.start as isize),
525-
index.end - index.start
526-
)
523+
transmute(RawSlice {
524+
data: self.as_ptr().offset(index.start as isize),
525+
len: index.end - index.start
526+
})
527527
}
528528
}
529529
}
@@ -559,10 +559,10 @@ impl<T> ops::IndexMut<ops::Range<usize>> for [T] {
559559
assert!(index.start <= index.end);
560560
assert!(index.end <= self.len());
561561
unsafe {
562-
from_raw_parts_mut(
563-
self.as_mut_ptr().offset(index.start as isize),
564-
index.end - index.start
565-
)
562+
transmute(RawSlice {
563+
data: self.as_ptr().offset(index.start as isize),
564+
len: index.end - index.start
565+
})
566566
}
567567
}
568568
}
@@ -731,21 +731,7 @@ macro_rules! make_slice {
731731
diff / mem::size_of::<$t>()
732732
};
733733
unsafe {
734-
from_raw_parts($start, len)
735-
}
736-
}}
737-
}
738-
739-
macro_rules! make_mut_slice {
740-
($t: ty => $result: ty: $start: expr, $end: expr) => {{
741-
let diff = $end as usize - $start as usize;
742-
let len = if mem::size_of::<T>() == 0 {
743-
diff
744-
} else {
745-
diff / mem::size_of::<$t>()
746-
};
747-
unsafe {
748-
from_raw_parts_mut($start, len)
734+
transmute::<_, $result>(RawSlice { data: $start, len: len })
749735
}
750736
}}
751737
}
@@ -912,7 +898,7 @@ impl<'a, T> ops::IndexMut<ops::RangeFrom<usize>> for IterMut<'a, T> {
912898
impl<'a, T> ops::IndexMut<RangeFull> for IterMut<'a, T> {
913899
#[inline]
914900
fn index_mut(&mut self, _index: &RangeFull) -> &mut [T] {
915-
make_mut_slice!(T => &mut [T]: self.ptr, self.end)
901+
make_slice!(T => &mut [T]: self.ptr, self.end)
916902
}
917903
}
918904

@@ -926,7 +912,7 @@ impl<'a, T> IterMut<'a, T> {
926912
/// restricted lifetimes that do not consume the iterator.
927913
#[unstable(feature = "core")]
928914
pub fn into_slice(self) -> &'a mut [T] {
929-
make_mut_slice!(T => &'a mut [T]: self.ptr, self.end)
915+
make_slice!(T => &'a mut [T]: self.ptr, self.end)
930916
}
931917
}
932918

@@ -1418,15 +1404,16 @@ impl<'a, T> ExactSizeIterator for ChunksMut<'a, T> {}
14181404
#[unstable(feature = "core")]
14191405
pub fn ref_slice<'a, A>(s: &'a A) -> &'a [A] {
14201406
unsafe {
1421-
from_raw_parts(s, 1)
1407+
transmute(RawSlice { data: s, len: 1 })
14221408
}
14231409
}
14241410

14251411
/// Converts a pointer to A into a slice of length 1 (without copying).
14261412
#[unstable(feature = "core")]
14271413
pub fn mut_ref_slice<'a, A>(s: &'a mut A) -> &'a mut [A] {
14281414
unsafe {
1429-
from_raw_parts_mut(s, 1)
1415+
let ptr: *const A = transmute(s);
1416+
transmute(RawSlice { data: ptr, len: 1 })
14301417
}
14311418
}
14321419

0 commit comments

Comments
 (0)