diff --git a/src/librustc/driver/config.rs b/src/librustc/driver/config.rs index 72e2d244ad333..dae6a692fa121 100644 --- a/src/librustc/driver/config.rs +++ b/src/librustc/driver/config.rs @@ -176,7 +176,6 @@ debugging_opts!( SHOW_SPAN, COUNT_TYPE_SIZES, META_STATS, - NO_OPT, GC, PRINT_LINK_ARGS, PRINT_LLVM_PASSES, @@ -212,7 +211,6 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> { ("count-type-sizes", "count the sizes of aggregate types", COUNT_TYPE_SIZES), ("meta-stats", "gather metadata statistics", META_STATS), - ("no-opt", "do not optimize, even if -O is passed", NO_OPT), ("print-link-args", "Print the arguments passed to the linker", PRINT_LINK_ARGS), ("gc", "Garbage collect shared data (experimental)", GC), @@ -714,9 +712,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { let target = matches.opt_str("target").unwrap_or( driver::host_triple().to_string()); let opt_level = { - if (debugging_opts & NO_OPT) != 0 { - No - } else if matches.opt_present("O") { + if matches.opt_present("O") { if matches.opt_present("opt-level") { early_error("-O and --opt-level both provided"); } diff --git a/src/test/run-pass/capture_nil.rs b/src/test/run-pass/capture_nil.rs deleted file mode 100644 index 2113e5d0f4732..0000000000000 --- a/src/test/run-pass/capture_nil.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags:-Z no-opt - -// This test has to be setup just so to trigger -// the condition which was causing us a crash. -// The situation is that we are capturing a -// () value by ref. We generally feel free, -// however, to substitute NULL pointers and -// undefined values for values of () type, and -// so this caused a segfault when we copied into -// the closure. -// -// The fix is just to not emit any actual loads -// or stores for copies of () type (which is of -// course preferable, as the value itself is -// irrelevant). - -use std::task; - -fn foo(x: ()) -> Receiver<()> { - let (tx, rx) = channel::<()>(); - task::spawn(proc() { - tx.send(x); - }); - rx -} - -pub fn main() { - foo(()).recv() -}