Skip to content

Commit 9f14681

Browse files
committed
---
yaml --- r: 153322 b: refs/heads/try2 c: 7bed325 h: refs/heads/master v: v3
1 parent 7a347aa commit 9f14681

Some content is hidden

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

56 files changed

+803
-1292
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: e11e094c0a90e1a518ea996f826abdf3ad0e4cbb
8+
refs/heads/try2: 7bed325254a074b8ff72ed1d037bf8e84aa9888f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ distcheck-tar-bins: dist-tar-bins
259259
$(Q)cd tmp/distcheck && tar -xzf ../../dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz
260260
$(Q)mkdir -p tmp/distcheck/tarbininstall
261261
$(Q)sh tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix=tmp/distcheck/tarbininstall
262+
$(Q)tmp/distcheck/tarbininstall/bin/rustc --version
262263
$(Q)sh tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix=tmp/distcheck/tarbininstall --uninstall
263264
$(Q)rm -Rf tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)
264265
$(Q)rm -Rf tmp/distcheck/tarbininstall

branches/try2/src/compiletest/procsrv.rs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use std::os;
1112
use std::str;
1213
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
1314
use std::dynamic_lib::DynamicLibrary;
1415

15-
fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
16+
fn target_env(lib_path: &str, aux_path: Option<&str>) -> Vec<(String, String)> {
1617
// Need to be sure to put both the lib_path and the aux path in the dylib
1718
// search path for the child.
1819
let mut path = DynamicLibrary::search_path();
@@ -22,11 +23,19 @@ fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
2223
}
2324
path.insert(0, Path::new(lib_path));
2425

25-
// Add the new dylib search path var
26+
// Remove the previous dylib search path var
2627
let var = DynamicLibrary::envvar();
28+
let mut env: Vec<(String,String)> = os::env();
29+
match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
30+
Some(i) => { env.remove(i); }
31+
None => {}
32+
}
33+
34+
// Add the new dylib search path var
2735
let newpath = DynamicLibrary::create_path(path.as_slice());
2836
let newpath = str::from_utf8(newpath.as_slice()).unwrap().to_string();
29-
cmd.env(var.to_string(), newpath);
37+
env.push((var.to_string(), newpath));
38+
return env;
3039
}
3140

3241
pub struct Result {pub status: ProcessExit, pub out: String, pub err: String}
@@ -38,14 +47,8 @@ pub fn run(lib_path: &str,
3847
env: Vec<(String, String)> ,
3948
input: Option<String>) -> Option<Result> {
4049

41-
let mut cmd = Command::new(prog);
42-
cmd.args(args);
43-
add_target_env(&mut cmd, lib_path, aux_path);
44-
for (key, val) in env.move_iter() {
45-
cmd.env(key, val);
46-
}
47-
48-
match cmd.spawn() {
50+
let env = env.clone().append(target_env(lib_path, aux_path).as_slice());
51+
match Command::new(prog).args(args).env(env.as_slice()).spawn() {
4952
Ok(mut process) => {
5053
for input in input.iter() {
5154
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();
@@ -70,14 +73,8 @@ pub fn run_background(lib_path: &str,
7073
env: Vec<(String, String)> ,
7174
input: Option<String>) -> Option<Process> {
7275

73-
let mut cmd = Command::new(prog);
74-
cmd.args(args);
75-
add_target_env(&mut cmd, lib_path, aux_path);
76-
for (key, val) in env.move_iter() {
77-
cmd.env(key, val);
78-
}
79-
80-
match cmd.spawn() {
76+
let env = env.clone().append(target_env(lib_path, aux_path).as_slice());
77+
match Command::new(prog).args(args).env(env.as_slice()).spawn() {
8178
Ok(mut process) => {
8279
for input in input.iter() {
8380
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();

branches/try2/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
574574
cmd.arg("./src/etc/lldb_batchmode.py")
575575
.arg(test_executable)
576576
.arg(debugger_script)
577-
.env_set_all([("PYTHONPATH", config.lldb_python_dir.clone().unwrap().as_slice())]);
577+
.env([("PYTHONPATH", config.lldb_python_dir.clone().unwrap().as_slice())]);
578578

579579
let (status, out, err) = match cmd.spawn() {
580580
Ok(process) => {

branches/try2/src/libcollections/hash/sip.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ pub fn hash_with_keys<T: Hash<SipState>>(k0: u64, k1: u64, value: &T) -> u64 {
269269
mod tests {
270270
use test::Bencher;
271271
use std::prelude::*;
272-
use std::fmt;
272+
use std::num::ToStrRadix;
273273

274274
use str::Str;
275275
use string::String;
@@ -370,7 +370,7 @@ mod tests {
370370
fn to_hex_str(r: &[u8, ..8]) -> String {
371371
let mut s = String::new();
372372
for b in r.iter() {
373-
s.push_str(format!("{}", fmt::radix(*b, 16)).as_slice());
373+
s.push_str((*b as uint).to_str_radix(16u).as_slice());
374374
}
375375
s
376376
}
@@ -391,7 +391,7 @@ mod tests {
391391
let r = result_bytes(h);
392392
let mut s = String::new();
393393
for b in r.iter() {
394-
s.push_str(format!("{}", fmt::radix(*b, 16)).as_slice());
394+
s.push_str((*b as uint).to_str_radix(16u).as_slice());
395395
}
396396
s
397397
}

branches/try2/src/libcore/intrinsics.rs

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -326,73 +326,19 @@ extern "rust-intrinsic" {
326326
/// integer, since the conversion would throw away aliasing information.
327327
pub fn offset<T>(dst: *const T, offset: int) -> *const T;
328328

329-
/// Copies data from one location to another.
330-
///
331-
/// Copies `count` elements (not bytes) from `src` to `dst`. The source
332-
/// and destination may *not* overlap.
333-
///
334-
/// `copy_nonoverlapping_memory` is semantically equivalent to C's `memcpy`.
335-
///
336-
/// # Example
337-
///
338-
/// A safe swap function:
339-
///
340-
/// ```
341-
/// use std::mem;
342-
/// use std::ptr;
343-
///
344-
/// fn swap<T>(x: &mut T, y: &mut T) {
345-
/// unsafe {
346-
/// // Give ourselves some scratch space to work with
347-
/// let mut t: T = mem::uninitialized();
348-
///
349-
/// // Perform the swap, `&mut` pointers never alias
350-
/// ptr::copy_nonoverlapping_memory(&mut t, &*x, 1);
351-
/// ptr::copy_nonoverlapping_memory(x, &*y, 1);
352-
/// ptr::copy_nonoverlapping_memory(y, &t, 1);
353-
///
354-
/// // y and t now point to the same thing, but we need to completely forget `tmp`
355-
/// // because it's no longer relevant.
356-
/// mem::forget(t);
357-
/// }
358-
/// }
359-
/// ```
360-
///
361-
/// # Safety Note
362-
///
363-
/// If the source and destination overlap then the behavior of this
364-
/// function is undefined.
365-
#[unstable]
329+
/// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with
330+
/// a size of `count` * `size_of::<T>()` and an alignment of
331+
/// `min_align_of::<T>()`
366332
pub fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: uint);
367333

368-
/// Copies data from one location to another.
369-
///
370-
/// Copies `count` elements (not bytes) from `src` to `dst`. The source
371-
/// and destination may overlap.
372-
///
373-
/// `copy_memory` is semantically equivalent to C's `memmove`.
374-
///
375-
/// # Example
376-
///
377-
/// Efficiently create a Rust vector from an unsafe buffer:
378-
///
379-
/// ```
380-
/// use std::ptr;
381-
///
382-
/// unsafe fn from_buf_raw<T>(ptr: *const T, elts: uint) -> Vec<T> {
383-
/// let mut dst = Vec::with_capacity(elts);
384-
/// dst.set_len(elts);
385-
/// ptr::copy_memory(dst.as_mut_ptr(), ptr, elts);
386-
/// dst
387-
/// }
388-
/// ```
389-
///
390-
#[unstable]
334+
/// Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with
335+
/// a size of `count` * `size_of::<T>()` and an alignment of
336+
/// `min_align_of::<T>()`
391337
pub fn copy_memory<T>(dst: *mut T, src: *const T, count: uint);
392338

393-
/// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
394-
/// bytes of memory starting at `dst` to `c`.
395-
#[experimental = "uncertain about naming and semantics"]
339+
/// Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a
340+
/// size of `count` * `size_of::<T>()` and an alignment of
341+
/// `min_align_of::<T>()`
396342
pub fn set_memory<T>(dst: *mut T, val: u8, count: uint);
397343

398344
/// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with

branches/try2/src/libcore/num/f32.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
//! Operations and constants for 32-bits floats (`f32` type)
1212
1313
#![doc(primitive = "f32")]
14-
// FIXME: MIN_VALUE and MAX_VALUE literals are parsed as -inf and inf #14353
15-
#![allow(type_overflow)]
1614

1715
use intrinsics;
1816
use mem;

branches/try2/src/libcore/num/f64.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
//! Operations and constants for 64-bits floats (`f64` type)
1212
1313
#![doc(primitive = "f64")]
14-
// FIXME: MIN_VALUE and MAX_VALUE literals are parsed as -inf and inf #14353
15-
#![allow(type_overflow)]
1614

1715
use intrinsics;
1816
use mem;

branches/try2/src/libcore/ptr.rs

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ use option::{Some, None, Option};
9595

9696
use cmp::{PartialEq, Eq, PartialOrd, Equiv, Ordering, Less, Equal, Greater};
9797

98-
pub use intrinsics::copy_memory;
99-
pub use intrinsics::copy_nonoverlapping_memory;
100-
pub use intrinsics::set_memory;
101-
10298
/// Create a null pointer.
10399
///
104100
/// # Example
@@ -127,6 +123,86 @@ pub fn null<T>() -> *const T { 0 as *const T }
127123
#[unstable = "may need a different name after pending changes to pointer types"]
128124
pub fn mut_null<T>() -> *mut T { 0 as *mut T }
129125

126+
/// Copies data from one location to another.
127+
///
128+
/// Copies `count` elements (not bytes) from `src` to `dst`. The source
129+
/// and destination may overlap.
130+
///
131+
/// `copy_memory` is semantically equivalent to C's `memmove`.
132+
///
133+
/// # Example
134+
///
135+
/// Efficiently create a Rust vector from an unsafe buffer:
136+
///
137+
/// ```
138+
/// use std::ptr;
139+
///
140+
/// unsafe fn from_buf_raw<T>(ptr: *const T, elts: uint) -> Vec<T> {
141+
/// let mut dst = Vec::with_capacity(elts);
142+
/// dst.set_len(elts);
143+
/// ptr::copy_memory(dst.as_mut_ptr(), ptr, elts);
144+
/// dst
145+
/// }
146+
/// ```
147+
///
148+
#[inline]
149+
#[unstable]
150+
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
151+
intrinsics::copy_memory(dst, src, count)
152+
}
153+
154+
/// Copies data from one location to another.
155+
///
156+
/// Copies `count` elements (not bytes) from `src` to `dst`. The source
157+
/// and destination may *not* overlap.
158+
///
159+
/// `copy_nonoverlapping_memory` is semantically equivalent to C's `memcpy`.
160+
///
161+
/// # Example
162+
///
163+
/// A safe swap function:
164+
///
165+
/// ```
166+
/// use std::mem;
167+
/// use std::ptr;
168+
///
169+
/// fn swap<T>(x: &mut T, y: &mut T) {
170+
/// unsafe {
171+
/// // Give ourselves some scratch space to work with
172+
/// let mut t: T = mem::uninitialized();
173+
///
174+
/// // Perform the swap, `&mut` pointers never alias
175+
/// ptr::copy_nonoverlapping_memory(&mut t, &*x, 1);
176+
/// ptr::copy_nonoverlapping_memory(x, &*y, 1);
177+
/// ptr::copy_nonoverlapping_memory(y, &t, 1);
178+
///
179+
/// // y and t now point to the same thing, but we need to completely forget `tmp`
180+
/// // because it's no longer relevant.
181+
/// mem::forget(t);
182+
/// }
183+
/// }
184+
/// ```
185+
///
186+
/// # Safety Note
187+
///
188+
/// If the source and destination overlap then the behavior of this
189+
/// function is undefined.
190+
#[inline]
191+
#[unstable]
192+
pub unsafe fn copy_nonoverlapping_memory<T>(dst: *mut T,
193+
src: *const T,
194+
count: uint) {
195+
intrinsics::copy_nonoverlapping_memory(dst, src, count)
196+
}
197+
198+
/// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
199+
/// bytes of memory starting at `dst` to `c`.
200+
#[inline]
201+
#[experimental = "uncertain about naming and semantics"]
202+
pub unsafe fn set_memory<T>(dst: *mut T, c: u8, count: uint) {
203+
intrinsics::set_memory(dst, c, count)
204+
}
205+
130206
/// Zeroes out `count * size_of::<T>` bytes of memory at `dst`
131207
#[inline]
132208
#[experimental = "uncertain about naming and semantics"]

branches/try2/src/libnative/io/process.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ fn with_argv<T>(prog: &CString, args: &[CString],
729729
}
730730

731731
#[cfg(unix)]
732-
fn with_envp<T>(env: Option<&[(&CString, &CString)]>,
732+
fn with_envp<T>(env: Option<&[(CString, CString)]>,
733733
cb: proc(*const c_void) -> T) -> T {
734734
// On posixy systems we can pass a char** for envp, which is a
735735
// null-terminated array of "k=v\0" strings. Since we must create
@@ -762,7 +762,7 @@ fn with_envp<T>(env: Option<&[(&CString, &CString)]>,
762762
}
763763

764764
#[cfg(windows)]
765-
fn with_envp<T>(env: Option<&[(&CString, &CString)]>, cb: |*mut c_void| -> T) -> T {
765+
fn with_envp<T>(env: Option<&[(CString, CString)]>, cb: |*mut c_void| -> T) -> T {
766766
// On win32 we pass an "environment block" which is not a char**, but
767767
// rather a concatenation of null-terminated k=v\0 sequences, with a final
768768
// \0 to terminate.

branches/try2/src/librustc/diagnostics.rs

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

branches/try2/src/librustc/driver/config.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,6 @@ pub fn optgroups() -> Vec<getopts::OptGroup> {
532532
optopt("", "opt-level", "Optimize with possible levels 0-3", "LEVEL"),
533533
optopt( "", "out-dir", "Write output to compiler-chosen filename in <dir>", "DIR"),
534534
optflag("", "parse-only", "Parse only; do not compile, assemble, or link"),
535-
optopt("", "explain", "Provide a detailed explanation of an error message", "OPT"),
536535
optflagopt("", "pretty",
537536
"Pretty-print the input instead of compiling;
538537
valid types are: `normal` (un-annotated source),
@@ -808,7 +807,6 @@ mod test {
808807
use getopts::getopts;
809808
use syntax::attr;
810809
use syntax::attr::AttrMetaMethods;
811-
use syntax::diagnostics;
812810

813811
// When the user supplies --test we should implicitly supply --cfg test
814812
#[test]
@@ -818,9 +816,8 @@ mod test {
818816
Ok(m) => m,
819817
Err(f) => fail!("test_switch_implies_cfg_test: {}", f)
820818
};
821-
let registry = diagnostics::registry::Registry::new([]);
822819
let sessopts = build_session_options(matches);
823-
let sess = build_session(sessopts, None, registry);
820+
let sess = build_session(sessopts, None);
824821
let cfg = build_configuration(&sess);
825822
assert!((attr::contains_name(cfg.as_slice(), "test")));
826823
}
@@ -837,9 +834,8 @@ mod test {
837834
fail!("test_switch_implies_cfg_test_unless_cfg_test: {}", f)
838835
}
839836
};
840-
let registry = diagnostics::registry::Registry::new([]);
841837
let sessopts = build_session_options(matches);
842-
let sess = build_session(sessopts, None, registry);
838+
let sess = build_session(sessopts, None);
843839
let cfg = build_configuration(&sess);
844840
let mut test_items = cfg.iter().filter(|m| m.name().equiv(&("test")));
845841
assert!(test_items.next().is_some());

0 commit comments

Comments
 (0)