Skip to content

Commit 3f54e92

Browse files
committed
---
yaml --- r: 153339 b: refs/heads/try2 c: 175d215 h: refs/heads/master i: 153337: ff9799e 153335: 5da949b v: v3
1 parent b3cf888 commit 3f54e92

Some content is hidden

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

73 files changed

+523
-1482
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: 1e401159c17c473132e81c039c995a38b933bbf9
8+
refs/heads/try2: 175d215eb63a755d7cc68203023622e25cd0b69d
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/man/rustc.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ This program is a compiler for the Rust language, available at
1111

1212
.SH OPTIONS
1313

14+
.TP
15+
\fB\-\-crate-name NAME\fR
16+
Specify the name of the crate being built
1417
.TP
1518
\fB\-\-crate-type=[bin|lib|dylib|rlib|staticlib]\fR
1619
Configure the flavor of rust crate that is generated (default `bin`)

branches/try2/mk/install.mk

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ else
1414
MAYBE_DISABLE_VERIFY=
1515
endif
1616

17-
install: dist-install-dir-$(CFG_BUILD)-with-target-libs | tmp/empty_dir
18-
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
17+
install: dist-install-dir-$(CFG_BUILD)-with-target-libs
18+
$(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
1919
# Remove tmp files while we can because they may have been created under sudo
2020
$(Q)rm -R tmp/dist
2121

22-
uninstall: dist-install-dir-$(CFG_BUILD)-with-target-libs | tmp/empty_dir
23-
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
22+
uninstall: dist-install-dir-$(CFG_BUILD)-with-target-libs
23+
$(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
2424
# Remove tmp files while we can because they may have been created under sudo
2525
$(Q)rm -R tmp/dist
2626

27-
tmp/empty_dir:
28-
mkdir -p $@
2927

3028
######################################################################
3129
# Android remote installation

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/etc/zsh/_rust

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ _rustc_opts_switches=(
99
-c'[Compile and assemble, but do not link]'
1010
--cfg'[Configure the compilation environment]'
1111
--crate-id'[Output the crate id and exit]'
12-
--crate-file-name'[Output the file(s) that would be written if compilation continued and exit]'
13-
--crate-name'[Output the crate name and exit]'
14-
--dep-info'[Output dependency info to <filename> after compiling]'
12+
--crate-file-name'[deprecated in favor of --print-file-name]'
13+
--crate-name'[Specify the name of the crate being built]'
1514
--crate-type'[Specify the type of crate to crate]'
15+
--debuginfo'[Emit DWARF debug info to the objects created: 0 = no debug info, 1 = line-tables only (for stacktraces and breakpoints), 2 = full debug info with variable and type information (same as -g)]'
16+
--dep-info'[Output dependency info to <filename> after compiling]'
17+
-g'[Equivalent to --debuginfo=2]'
1618
{-h,--help}'[Display this message]'
1719
-L'[Add a directory to the library search path]'
1820
--linker'[Program to use for linking instead of the default.]'
@@ -29,6 +31,8 @@ _rustc_opts_switches=(
2931
--parse-only'[Parse only; do not compile, assemble, or link]'
3032
--passes'[Comma or space separated list of pass names to use]'
3133
--pretty'[Pretty-print the input instead of compiling]'
34+
--print-crate-name'[Output the crate name and exit]'
35+
--print-file-name'[Output the file(s) that would be written if compilation continued and exit]'
3236
--save-temps'[Write intermediate files (.bc, .opt.bc, .o) in addition to normal output]'
3337
--sysroot'[Override the system root]'
3438
--test'[Build a test harness]'

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/atomics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl AtomicBool {
141141
///
142142
/// fn with_lock(spinlock: &Arc<AtomicBool>, f: || -> ()) {
143143
/// // CAS loop until we are able to replace `false` with `true`
144-
/// while spinlock.compare_and_swap(false, true, SeqCst) != false {
144+
/// while spinlock.compare_and_swap(false, true, SeqCst) == false {
145145
/// // Since tasks may not be preemptive (if they are green threads)
146146
/// // yield to the scheduler to let the other task run. Low level
147147
/// // concurrent code needs to take into account Rust's two threading

branches/try2/src/libgreen/lib.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,10 @@
164164
//! possibly pinned to a particular scheduler thread:
165165
//!
166166
//! ```rust
167-
//! extern crate green;
168-
//! extern crate rustuv;
169-
//!
170-
//! # fn main() {
171167
//! use std::task::TaskBuilder;
172168
//! use green::{SchedPool, PoolConfig, GreenTaskBuilder};
173169
//!
174-
//! let mut config = PoolConfig::new();
175-
//!
176-
//! // Optional: Set the event loop to be rustuv's to allow I/O to work
177-
//! config.event_loop_factory = rustuv::event_loop;
178-
//!
170+
//! let config = PoolConfig::new();
179171
//! let mut pool = SchedPool::new(config);
180172
//!
181173
//! // Spawn tasks into the pool of schedulers
@@ -203,7 +195,6 @@
203195
//! // Required to shut down this scheduler pool.
204196
//! // The task will fail if `shutdown` is not called.
205197
//! pool.shutdown();
206-
//! # }
207198
//! ```
208199
209200
#![crate_name = "green"]

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());

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use driver::{PpmFlowGraph, PpmExpanded, PpmExpandedIdentified, PpmTyped};
1616
use driver::{PpmIdentified};
1717
use front;
1818
use lib::llvm::{ContextRef, ModuleRef};
19-
use lint;
2019
use metadata::common::LinkMeta;
2120
use metadata::creader;
2221
use middle::cfg;
@@ -27,7 +26,7 @@ use middle;
2726
use plugin::load::Plugins;
2827
use plugin::registry::Registry;
2928
use plugin;
30-
29+
use lint;
3130
use util::common::time;
3231
use util::ppaux;
3332
use util::nodemap::{NodeSet};
@@ -42,7 +41,6 @@ use std::io::MemReader;
4241
use syntax::ast;
4342
use syntax::attr;
4443
use syntax::attr::{AttrMetaMethods};
45-
use syntax::diagnostics;
4644
use syntax::parse;
4745
use syntax::parse::token;
4846
use syntax::print::{pp, pprust};
@@ -215,15 +213,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
215213
let mut registry = Registry::new(&krate);
216214

217215
time(time_passes, "plugin registration", (), |_| {
218-
if sess.features.rustc_diagnostic_macros.get() {
219-
registry.register_macro("__diagnostic_used",
220-
diagnostics::plugin::expand_diagnostic_used);
221-
registry.register_macro("__register_diagnostic",
222-
diagnostics::plugin::expand_register_diagnostic);
223-
registry.register_macro("__build_diagnostic_array",
224-
diagnostics::plugin::expand_build_diagnostic_array);
225-
}
226-
227216
for &registrar in registrars.iter() {
228217
registrar(&mut registry);
229218
}

0 commit comments

Comments
 (0)