rollup merge of #21441: alexcrichton/rustc-opts
This is a bit of cleanup work to clean out some old deprecated flags and deprecated lint names from the compiler (they've been deprecated for quite awhile now). This also notably puts `--pretty` behind the `-Z unstable-options` flag (where it was supposed to be previously).
This commit is contained in:
commit
b5de8333b3
28 changed files with 49 additions and 238 deletions
|
|
@ -1,16 +0,0 @@
|
|||
// Copyright 2014 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Check that lint deprecation works
|
||||
|
||||
#[deny(unused_variable)] //~ warning: lint unused_variable has been renamed to unused_variables
|
||||
pub fn main() {
|
||||
let x = 0u8; //~ error: unused variable:
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#![allow(dead_code)]
|
||||
|
||||
// compile-flags: -D type-limits
|
||||
// compile-flags: -D unused-comparisons
|
||||
fn main() { }
|
||||
|
||||
fn foo() {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -D path-statement
|
||||
// compile-flags: -D path-statements
|
||||
fn main() {
|
||||
|
||||
let x = 10is;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags:--debuginfo=1
|
||||
// compile-flags:-C debuginfo=1
|
||||
// min-lldb-version: 310
|
||||
|
||||
pub trait TraitWithDefaultMethod : Sized {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// ignore-android: FIXME(#10381)
|
||||
// min-lldb-version: 310
|
||||
|
||||
// compile-flags:--debuginfo=1
|
||||
// compile-flags:-C debuginfo=1
|
||||
|
||||
// gdb-command:run
|
||||
// lldb-command:run
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
// ignore-lldb
|
||||
|
||||
// compile-flags:--debuginfo=1
|
||||
// compile-flags:-C debuginfo=1
|
||||
|
||||
// Make sure functions have proper names
|
||||
// gdb-command:info functions
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
[ `$(RUSTC) --print-crate-name crate.rs` = "foo" ]
|
||||
[ `$(RUSTC) --print-file-name crate.rs` = "$(call BIN,foo)" ]
|
||||
[ `$(RUSTC) --print-file-name --crate-type=lib \
|
||||
[ `$(RUSTC) --print crate-name crate.rs` = "foo" ]
|
||||
[ `$(RUSTC) --print file-names crate.rs` = "$(call BIN,foo)" ]
|
||||
[ `$(RUSTC) --print file-names --crate-type=lib \
|
||||
--test crate.rs` = "$(call BIN,foo)" ]
|
||||
[ `$(RUSTC) --print-file-name --test lib.rs` = "$(call BIN,mylib)" ]
|
||||
$(RUSTC) --print-file-name lib.rs
|
||||
$(RUSTC) --print-file-name rlib.rs
|
||||
[ `$(RUSTC) --print file-names --test lib.rs` = "$(call BIN,mylib)" ]
|
||||
$(RUSTC) --print file-names lib.rs
|
||||
$(RUSTC) --print file-names rlib.rs
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
-include ../tools.mk
|
||||
|
||||
# FIXME: ignore freebsd/windows
|
||||
# (windows: see `../dep-info/Makefile`)
|
||||
ifneq ($(shell uname),FreeBSD)
|
||||
ifndef IS_WINDOWS
|
||||
all:
|
||||
$(RUSTC) --dep-info $(TMPDIR)/custom-deps-file.d --crate-type=lib lib.rs
|
||||
sleep 1
|
||||
touch foo.rs
|
||||
-rm -f $(TMPDIR)/done
|
||||
$(MAKE) -drf Makefile.foo
|
||||
rm $(TMPDIR)/done
|
||||
pwd
|
||||
$(MAKE) -drf Makefile.foo
|
||||
rm $(TMPDIR)/done && exit 1 || exit 0
|
||||
else
|
||||
all:
|
||||
|
||||
endif
|
||||
|
||||
else
|
||||
all:
|
||||
|
||||
endif
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
LIB := $(shell $(RUSTC) --print file-names --crate-type=lib lib.rs)
|
||||
|
||||
$(TMPDIR)/$(LIB):
|
||||
$(RUSTC) --dep-info $(TMPDIR)/custom-deps-file.d --crate-type=lib lib.rs
|
||||
touch $(TMPDIR)/done
|
||||
|
||||
-include $(TMPDIR)/custom-deps-file.d
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
// Copyright 2014 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn bar() {}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
// Copyright 2014 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub fn foo() {}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2014 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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![crate_name="foo"]
|
||||
|
||||
pub mod foo;
|
||||
pub mod bar;
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
ifneq ($(shell uname),FreeBSD)
|
||||
ifndef IS_WINDOWS
|
||||
all:
|
||||
$(RUSTC) --dep-info $(TMPDIR)/custom-deps-file.d --crate-type=lib lib.rs
|
||||
$(RUSTC) --emit link,dep-info --crate-type=lib lib.rs
|
||||
sleep 1
|
||||
touch 'foo foo.rs'
|
||||
-rm -f $(TMPDIR)/done
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
LIB := $(shell $(RUSTC) --print-file-name --crate-type=lib lib.rs)
|
||||
LIB := $(shell $(RUSTC) --print file-names --crate-type=lib lib.rs)
|
||||
|
||||
$(TMPDIR)/$(LIB):
|
||||
$(RUSTC) --dep-info $(TMPDIR)/custom-deps-file.d --crate-type=lib lib.rs
|
||||
$(RUSTC) --emit link,dep-info --crate-type=lib lib.rs
|
||||
touch $(TMPDIR)/done
|
||||
|
||||
-include $(TMPDIR)/custom-deps-file.d
|
||||
-include $(TMPDIR)/lib.d
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
ifneq ($(shell uname),FreeBSD)
|
||||
ifndef IS_WINDOWS
|
||||
all:
|
||||
$(RUSTC) --dep-info --crate-type=lib lib.rs
|
||||
$(RUSTC) --emit dep-info,link --crate-type=lib lib.rs
|
||||
sleep 2
|
||||
touch foo.rs
|
||||
-rm -f $(TMPDIR)/done
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
all:
|
||||
# Let's get a nice error message
|
||||
$(RUSTC) foo.rs --dep-info foo/bar/baz 2>&1 | \
|
||||
$(BARE_RUSTC) foo.rs --emit dep-info --out-dir foo/bar/baz 2>&1 | \
|
||||
grep "error writing dependencies"
|
||||
# Make sure the filename shows up
|
||||
$(RUSTC) foo.rs --dep-info foo/bar/baz 2>&1 | grep "baz"
|
||||
$(BARE_RUSTC) foo.rs --emit dep-info --out-dir foo/bar/baz 2>&1 | grep "baz"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ all: $(patsubst %.rs,$(TMPDIR)/%.check,$(FILES))
|
|||
RUSTC_LIB=$(RUSTC) --crate-type=lib
|
||||
|
||||
define FIND_LAST_BLOCK
|
||||
LASTBLOCKNUM_$(1) := $(shell $(RUSTC_LIB) --pretty=expanded,identified $(1) \
|
||||
LASTBLOCKNUM_$(1) := $(shell $(RUSTC_LIB) -Z unstable-options --pretty=expanded,identified $(1) \
|
||||
| grep block
|
||||
| tail -1
|
||||
| sed -e 's@.*/\* block \([0-9]*\) \*/.*@\1@')
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
REPLACEMENT := s/[0-9][0-9]*\#[0-9][0-9]*/$(shell date)/g
|
||||
|
||||
all:
|
||||
$(RUSTC) -o $(TMPDIR)/input.out --pretty expanded,hygiene input.rs
|
||||
$(RUSTC) -o $(TMPDIR)/input.out -Z unstable-options \
|
||||
--pretty expanded,hygiene input.rs
|
||||
|
||||
# the name/ctxt numbers are very internals-dependent and thus
|
||||
# change relatively frequently, and testing for their exact values
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) -o $(TMPDIR)/input.expanded.rs --pretty=expanded input.rs
|
||||
$(RUSTC) -o $(TMPDIR)/input.expanded.rs -Z unstable-options \
|
||||
--pretty=expanded input.rs
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) -o $(TMPDIR)/foo.out --pretty normal=foo input.rs
|
||||
$(RUSTC) -o $(TMPDIR)/nest_foo.out --pretty normal=nest::foo input.rs
|
||||
$(RUSTC) -o $(TMPDIR)/foo_method.out --pretty normal=foo_method input.rs
|
||||
$(RUSTC) -o $(TMPDIR)/foo.out -Z unstable-options --pretty normal=foo input.rs
|
||||
$(RUSTC) -o $(TMPDIR)/nest_foo.out -Z unstable-options --pretty normal=nest::foo input.rs
|
||||
$(RUSTC) -o $(TMPDIR)/foo_method.out -Z unstable-options --pretty normal=foo_method input.rs
|
||||
diff -u $(TMPDIR)/foo.out foo.pp
|
||||
diff -u $(TMPDIR)/nest_foo.out nest_foo.pp
|
||||
diff -u $(TMPDIR)/foo_method.out foo_method.pp
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) -o $(TMPDIR)/input.out --pretty=normal input.rs
|
||||
$(RUSTC) -o $(TMPDIR)/input.out --pretty=normal -Z unstable-options input.rs
|
||||
diff -u $(TMPDIR)/input.out input.pp
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ HOST_RPATH_ENV = \
|
|||
TARGET_RPATH_ENV = \
|
||||
$(LD_LIB_PATH_ENVVAR)="$(TMPDIR):$(TARGET_RPATH_DIR):$($(LD_LIB_PATH_ENVVAR))"
|
||||
|
||||
RUSTC := $(HOST_RPATH_ENV) $(RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
|
||||
BARE_RUSTC := $(HOST_RPATH_ENV) $(RUSTC)
|
||||
RUSTC := $(BARE_RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
|
||||
CC := $(CC) -L $(TMPDIR)
|
||||
HTMLDOCCK := $(PYTHON) $(S)/src/etc/htmldocck.py
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags:--crate-name crate-name-attr-used -F unused-attribute
|
||||
// compile-flags:--crate-name crate-name-attr-used -F unused-attributes
|
||||
|
||||
#![crate_name = "crate-name-attr-used"]
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags:-D ctypes
|
||||
// compile-flags:-D improper-ctypes
|
||||
|
||||
#![allow(ctypes)]
|
||||
#![allow(improper_ctypes)]
|
||||
|
||||
mod libc {
|
||||
extern {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue