Skip to content

Commit 87414e8

Browse files
committed
---
yaml --- r: 131738 b: refs/heads/dist-snap c: 8aa8ca7 h: refs/heads/master v: v3
1 parent 8227cf2 commit 87414e8

Some content is hidden

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

46 files changed

+224
-689
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 0e80dbe59ea986ea53cc3caabffd40b2eaee4dc6
9+
refs/heads/dist-snap: 8aa8ca7991412b6d326b131e17177b8610239841
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/src/librustc/diagnostics.rs

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

branches/dist-snap/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/dist-snap/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
}

branches/dist-snap/src/librustc/driver/mod.rs

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use std::task::TaskBuilder;
2626
use syntax::ast;
2727
use syntax::parse;
2828
use syntax::diagnostic::Emitter;
29-
use syntax::diagnostics;
3029

3130
use getopts;
3231

@@ -50,24 +49,8 @@ fn run_compiler(args: &[String]) {
5049
Some(matches) => matches,
5150
None => return
5251
};
53-
54-
let descriptions = diagnostics::registry::Registry::new(super::DIAGNOSTICS);
55-
match matches.opt_str("explain") {
56-
Some(ref code) => {
57-
match descriptions.find_description(code.as_slice()) {
58-
Some(ref description) => {
59-
println!("{}", description);
60-
}
61-
None => {
62-
early_error(format!("no extended information for {}", code).as_slice());
63-
}
64-
}
65-
return;
66-
},
67-
None => ()
68-
}
69-
7052
let sopts = config::build_session_options(&matches);
53+
7154
let (input, input_file_path) = match matches.free.len() {
7255
0u => {
7356
if sopts.describe_lints {
@@ -92,7 +75,7 @@ fn run_compiler(args: &[String]) {
9275
_ => early_error("multiple input filenames provided")
9376
};
9477

95-
let sess = build_session(sopts, input_file_path, descriptions);
78+
let sess = build_session(sopts, input_file_path);
9679
let cfg = config::build_configuration(&sess);
9780
let odir = matches.opt_str("out-dir").map(|o| Path::new(o));
9881
let ofile = matches.opt_str("o").map(|o| Path::new(o));
@@ -400,14 +383,14 @@ fn parse_crate_attrs(sess: &Session, input: &Input) ->
400383
}
401384

402385
pub fn early_error(msg: &str) -> ! {
403-
let mut emitter = diagnostic::EmitterWriter::stderr(diagnostic::Auto, None);
404-
emitter.emit(None, msg, None, diagnostic::Fatal);
386+
let mut emitter = diagnostic::EmitterWriter::stderr(diagnostic::Auto);
387+
emitter.emit(None, msg, diagnostic::Fatal);
405388
fail!(diagnostic::FatalError);
406389
}
407390

408391
pub fn early_warn(msg: &str) {
409-
let mut emitter = diagnostic::EmitterWriter::stderr(diagnostic::Auto, None);
410-
emitter.emit(None, msg, None, diagnostic::Warning);
392+
let mut emitter = diagnostic::EmitterWriter::stderr(diagnostic::Auto);
393+
emitter.emit(None, msg, diagnostic::Warning);
411394
}
412395

413396
pub fn list_metadata(sess: &Session, path: &Path,
@@ -446,15 +429,14 @@ fn monitor(f: proc():Send) {
446429
Err(value) => {
447430
// Task failed without emitting a fatal diagnostic
448431
if !value.is::<diagnostic::FatalError>() {
449-
let mut emitter = diagnostic::EmitterWriter::stderr(diagnostic::Auto, None);
432+
let mut emitter = diagnostic::EmitterWriter::stderr(diagnostic::Auto);
450433

451434
// a .span_bug or .bug call has already printed what
452435
// it wants to print.
453436
if !value.is::<diagnostic::ExplicitBug>() {
454437
emitter.emit(
455438
None,
456439
"unexpected failure",
457-
None,
458440
diagnostic::Bug);
459441
}
460442

@@ -465,7 +447,7 @@ fn monitor(f: proc():Send) {
465447
"run with `RUST_BACKTRACE=1` for a backtrace".to_string(),
466448
];
467449
for note in xs.iter() {
468-
emitter.emit(None, note.as_slice(), None, diagnostic::Note)
450+
emitter.emit(None, note.as_slice(), diagnostic::Note)
469451
}
470452

471453
match r.read_to_string() {
@@ -475,7 +457,6 @@ fn monitor(f: proc():Send) {
475457
format!("failed to read internal \
476458
stderr: {}",
477459
e).as_slice(),
478-
None,
479460
diagnostic::Error)
480461
}
481462
}

branches/dist-snap/src/librustc/driver/session.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use util::nodemap::NodeMap;
2020
use syntax::ast::NodeId;
2121
use syntax::codemap::Span;
2222
use syntax::diagnostic;
23-
use syntax::diagnostics;
2423
use syntax::parse;
2524
use syntax::parse::token;
2625
use syntax::parse::ParseSess;
@@ -66,9 +65,6 @@ impl Session {
6665
pub fn span_err(&self, sp: Span, msg: &str) {
6766
self.diagnostic().span_err(sp, msg)
6867
}
69-
pub fn span_err_with_code(&self, sp: Span, msg: &str, code: &str) {
70-
self.diagnostic().span_err_with_code(sp, msg, code)
71-
}
7268
pub fn err(&self, msg: &str) {
7369
self.diagnostic().handler().err(msg)
7470
}
@@ -201,12 +197,11 @@ impl Session {
201197
}
202198

203199
pub fn build_session(sopts: config::Options,
204-
local_crate_source_file: Option<Path>,
205-
registry: diagnostics::registry::Registry)
200+
local_crate_source_file: Option<Path>)
206201
-> Session {
207202
let codemap = codemap::CodeMap::new();
208203
let diagnostic_handler =
209-
diagnostic::default_handler(sopts.color, Some(registry));
204+
diagnostic::default_handler(sopts.color);
210205
let span_diagnostic_handler =
211206
diagnostic::mk_span_handler(diagnostic_handler, codemap);
212207

branches/dist-snap/src/librustc/front/feature_gate.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
6666

6767
("quad_precision_float", Removed),
6868

69-
("rustc_diagnostic_macros", Active),
70-
7169
// A temporary feature gate used to enable parser extensions needed
7270
// to bootstrap fix for #5723.
7371
("issue_5723_bootstrap", Active),
@@ -95,7 +93,6 @@ pub struct Features {
9593
pub default_type_params: Cell<bool>,
9694
pub issue_5723_bootstrap: Cell<bool>,
9795
pub overloaded_calls: Cell<bool>,
98-
pub rustc_diagnostic_macros: Cell<bool>
9996
}
10097

10198
impl Features {
@@ -104,7 +101,6 @@ impl Features {
104101
default_type_params: Cell::new(false),
105102
issue_5723_bootstrap: Cell::new(false),
106103
overloaded_calls: Cell::new(false),
107-
rustc_diagnostic_macros: Cell::new(false)
108104
}
109105
}
110106
}
@@ -429,5 +425,4 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
429425
sess.features.default_type_params.set(cx.has_feature("default_type_params"));
430426
sess.features.issue_5723_bootstrap.set(cx.has_feature("issue_5723_bootstrap"));
431427
sess.features.overloaded_calls.set(cx.has_feature("overloaded_calls"));
432-
sess.features.rustc_diagnostic_macros.set(cx.has_feature("rustc_diagnostic_macros"));
433428
}

0 commit comments

Comments
 (0)