diff options
| author | bors <bors@rust-lang.org> | 2019-02-13 05:14:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-02-13 05:14:12 +0000 |
| commit | 827a141466e7bb85eb3c030600878a2c606019e9 (patch) | |
| tree | cbbbb0b46cf4a3694316b2462ae2dcf7321468e4 /src/test | |
| parent | 0f949c2fcc696d0260a99196d5e5400c59a26a54 (diff) | |
| parent | 6562c2860730aee4497f58b00c298d054ff2e0b7 (diff) | |
| download | rust-827a141466e7bb85eb3c030600878a2c606019e9.tar.gz rust-827a141466e7bb85eb3c030600878a2c606019e9.zip | |
Auto merge of #58415 - Centril:rollup, r=Centril
Rollup of 12 pull requests Successful merges: - #57693 (Doc rewording) - #57815 (Speed up the fast path for assert_eq! and assert_ne!) - #58034 (Stabilize the time_checked_add feature) - #58057 (Stabilize linker-plugin based LTO (aka cross-language LTO)) - #58137 (Cleanup: rename node_id_to_type(_opt)) - #58166 (allow shorthand syntax for deprecation reason) - #58200 (fix str mutating through a ptr derived from &self) - #58273 (Rename rustc_errors dependency in rust 2018 crates) - #58289 (impl iter() for dyn Error) - #58387 (Disallow `auto` trait alias syntax) - #58404 (use Ubuntu keyserver for CloudABI ports) - #58405 (Remove some dead code from libcore) Failed merges: r? @ghost
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/codegen/no-dllimport-w-cross-lang-lto.rs | 2 | ||||
| -rw-r--r-- | src/test/codegen/target-cpu-on-functions.rs | 2 | ||||
| -rw-r--r-- | src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile | 4 | ||||
| -rw-r--r-- | src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile | 10 | ||||
| -rw-r--r-- | src/test/run-make-fulldeps/cross-lang-lto/Makefile | 6 | ||||
| -rw-r--r-- | src/test/rustdoc/deprecated.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/deprecation/deprecation-sanity.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/deprecation/deprecation-sanity.stderr | 20 | ||||
| -rw-r--r-- | src/test/ui/deprecation/invalid-literal.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/deprecation/invalid-literal.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/traits/trait-alias-syntax.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/traits/trait-alias-syntax.stderr | 14 |
12 files changed, 72 insertions, 16 deletions
diff --git a/src/test/codegen/no-dllimport-w-cross-lang-lto.rs b/src/test/codegen/no-dllimport-w-cross-lang-lto.rs index c1c1ef6ede2..33fc2bc1540 100644 --- a/src/test/codegen/no-dllimport-w-cross-lang-lto.rs +++ b/src/test/codegen/no-dllimport-w-cross-lang-lto.rs @@ -3,7 +3,7 @@ // no-prefer-dynamic // only-msvc -// compile-flags: -Z cross-lang-lto +// compile-flags: -C linker-plugin-lto #![crate_type = "rlib"] diff --git a/src/test/codegen/target-cpu-on-functions.rs b/src/test/codegen/target-cpu-on-functions.rs index 5692dca1df5..3fdf6ab6d00 100644 --- a/src/test/codegen/target-cpu-on-functions.rs +++ b/src/test/codegen/target-cpu-on-functions.rs @@ -3,7 +3,7 @@ // no-prefer-dynamic // ignore-tidy-linelength -// compile-flags: -C no-prepopulate-passes -C panic=abort -Z cross-lang-lto -Cpasses=name-anon-globals +// compile-flags: -C no-prepopulate-passes -C panic=abort -C linker-plugin-lto -Cpasses=name-anon-globals #![crate_type = "staticlib"] diff --git a/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile b/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile index cf687070bc2..b3c5fb2d796 100644 --- a/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile +++ b/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile @@ -8,7 +8,7 @@ all: cpp-executable rust-executable cpp-executable: - $(RUSTC) -Zcross-lang-lto=on -o $(TMPDIR)/librustlib-xlto.a -Copt-level=2 -Ccodegen-units=1 ./rustlib.rs + $(RUSTC) -Clinker-plugin-lto=on -o $(TMPDIR)/librustlib-xlto.a -Copt-level=2 -Ccodegen-units=1 ./rustlib.rs $(CLANG) -flto=thin -fuse-ld=lld -L $(TMPDIR) -lrustlib-xlto -o $(TMPDIR)/cmain ./cmain.c -O3 # Make sure we don't find a call instruction to the function we expect to # always be inlined. @@ -20,6 +20,6 @@ cpp-executable: rust-executable: $(CLANG) ./clib.c -flto=thin -c -o $(TMPDIR)/clib.o -O2 (cd $(TMPDIR); $(AR) crus ./libxyz.a ./clib.o) - $(RUSTC) -Zcross-lang-lto=on -L$(TMPDIR) -Copt-level=2 -Clinker=$(CLANG) -Clink-arg=-fuse-ld=lld ./main.rs -o $(TMPDIR)/rsmain + $(RUSTC) -Clinker-plugin-lto=on -L$(TMPDIR) -Copt-level=2 -Clinker=$(CLANG) -Clink-arg=-fuse-ld=lld ./main.rs -o $(TMPDIR)/rsmain llvm-objdump -d $(TMPDIR)/rsmain | $(CGREP) -e "call.*c_never_inlined" llvm-objdump -d $(TMPDIR)/rsmain | $(CGREP) -v -e "call.*c_always_inlined" diff --git a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile index 4f33b1c59e0..c9da06ff93f 100644 --- a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile +++ b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile @@ -5,13 +5,13 @@ ifndef IS_WINDOWS # This test makes sure that we don't loose upstream object files when compiling -# staticlibs with -Zcross-lang-lto +# staticlibs with -C linker-plugin-lto all: staticlib.rs upstream.rs - $(RUSTC) upstream.rs -Z cross-lang-lto -Ccodegen-units=1 + $(RUSTC) upstream.rs -C linker-plugin-lto -Ccodegen-units=1 # Check No LTO - $(RUSTC) staticlib.rs -Z cross-lang-lto -Ccodegen-units=1 -L. -o $(TMPDIR)/staticlib.a + $(RUSTC) staticlib.rs -C linker-plugin-lto -Ccodegen-units=1 -L. -o $(TMPDIR)/staticlib.a (cd $(TMPDIR); $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-ar x ./staticlib.a) # Make sure the upstream object file was included ls $(TMPDIR)/upstream.*.rcgu.o @@ -20,8 +20,8 @@ all: staticlib.rs upstream.rs rm $(TMPDIR)/* # Check ThinLTO - $(RUSTC) upstream.rs -Z cross-lang-lto -Ccodegen-units=1 -Clto=thin - $(RUSTC) staticlib.rs -Z cross-lang-lto -Ccodegen-units=1 -Clto=thin -L. -o $(TMPDIR)/staticlib.a + $(RUSTC) upstream.rs -C linker-plugin-lto -Ccodegen-units=1 -Clto=thin + $(RUSTC) staticlib.rs -C linker-plugin-lto -Ccodegen-units=1 -Clto=thin -L. -o $(TMPDIR)/staticlib.a (cd $(TMPDIR); $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-ar x ./staticlib.a) ls $(TMPDIR)/upstream.*.rcgu.o diff --git a/src/test/run-make-fulldeps/cross-lang-lto/Makefile b/src/test/run-make-fulldeps/cross-lang-lto/Makefile index 57a19a0ccb0..43bd05a7359 100644 --- a/src/test/run-make-fulldeps/cross-lang-lto/Makefile +++ b/src/test/run-make-fulldeps/cross-lang-lto/Makefile @@ -7,14 +7,14 @@ ifndef IS_WINDOWS # This test makes sure that the object files we generate are actually # LLVM bitcode files (as used by linker LTO plugins) when compiling with -# -Z cross-lang-lto. +# -Clinker-plugin-lto. # this only succeeds for bitcode files ASSERT_IS_BITCODE_OBJ=($(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-bcanalyzer $(1)) EXTRACT_OBJS=(cd $(TMPDIR); rm -f ./*.o; $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-ar x $(1)) -BUILD_LIB=$(RUSTC) lib.rs -Copt-level=2 -Z cross-lang-lto=on -Ccodegen-units=1 -BUILD_EXE=$(RUSTC) main.rs -Copt-level=2 -Z cross-lang-lto=on -Ccodegen-units=1 --emit=obj +BUILD_LIB=$(RUSTC) lib.rs -Copt-level=2 -Clinker-plugin-lto -Ccodegen-units=1 +BUILD_EXE=$(RUSTC) main.rs -Copt-level=2 -Clinker-plugin-lto -Ccodegen-units=1 --emit=obj all: staticlib staticlib-fat-lto staticlib-thin-lto rlib exe cdylib rdylib diff --git a/src/test/rustdoc/deprecated.rs b/src/test/rustdoc/deprecated.rs index 74bd94548e0..18a33438a23 100644 --- a/src/test/rustdoc/deprecated.rs +++ b/src/test/rustdoc/deprecated.rs @@ -28,3 +28,8 @@ pub struct V; // 'Deprecated$' #[deprecated] pub struct W; + +// @matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \ +// 'Deprecated: shorthand reason$' +#[deprecated = "shorthand reason"] +pub struct X; diff --git a/src/test/ui/deprecation/deprecation-sanity.rs b/src/test/ui/deprecation/deprecation-sanity.rs index 09bae0bdfb1..a559908b792 100644 --- a/src/test/ui/deprecation/deprecation-sanity.rs +++ b/src/test/ui/deprecation/deprecation-sanity.rs @@ -15,6 +15,12 @@ mod bogus_attribute_types_1 { #[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item fn f6() { } + + #[deprecated(note = b"test")] //~ ERROR literal in `deprecated` value must be a string + fn f7() { } + + #[deprecated("test")] //~ ERROR item in `deprecated` must be a key/value pair + fn f8() { } } #[deprecated(since = "a", note = "b")] diff --git a/src/test/ui/deprecation/deprecation-sanity.stderr b/src/test/ui/deprecation/deprecation-sanity.stderr index a8bfcc23cc8..a071a4fc10d 100644 --- a/src/test/ui/deprecation/deprecation-sanity.stderr +++ b/src/test/ui/deprecation/deprecation-sanity.stderr @@ -28,19 +28,31 @@ error[E0551]: incorrect meta item LL | #[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item | ^^^^^^^^ +error[E0565]: literal in `deprecated` value must be a string + --> $DIR/deprecation-sanity.rs:19:25 + | +LL | #[deprecated(note = b"test")] //~ ERROR literal in `deprecated` value must be a string + | ^^^^^^^ help: consider removing the prefix: `"test"` + +error[E0565]: item in `deprecated` must be a key/value pair + --> $DIR/deprecation-sanity.rs:22:18 + | +LL | #[deprecated("test")] //~ ERROR item in `deprecated` must be a key/value pair + | ^^^^^^ + error[E0550]: multiple deprecated attributes - --> $DIR/deprecation-sanity.rs:22:1 + --> $DIR/deprecation-sanity.rs:28:1 | LL | fn multiple1() { } //~ ERROR multiple deprecated attributes | ^^^^^^^^^^^^^^^^^^ error[E0538]: multiple 'since' items - --> $DIR/deprecation-sanity.rs:24:27 + --> $DIR/deprecation-sanity.rs:30:27 | LL | #[deprecated(since = "a", since = "b", note = "c")] //~ ERROR multiple 'since' items | ^^^^^^^^^^^ -error: aborting due to 7 previous errors +error: aborting due to 9 previous errors -Some errors occurred: E0538, E0541, E0550, E0551. +Some errors occurred: E0538, E0541, E0550, E0551, E0565. For more information about an error, try `rustc --explain E0538`. diff --git a/src/test/ui/deprecation/invalid-literal.rs b/src/test/ui/deprecation/invalid-literal.rs new file mode 100644 index 00000000000..7e0d8cdfc2f --- /dev/null +++ b/src/test/ui/deprecation/invalid-literal.rs @@ -0,0 +1,4 @@ +#[deprecated = b"test"] //~ ERROR attribute must be of the form +fn foo() {} + +fn main() {} diff --git a/src/test/ui/deprecation/invalid-literal.stderr b/src/test/ui/deprecation/invalid-literal.stderr new file mode 100644 index 00000000000..f13d599c0b1 --- /dev/null +++ b/src/test/ui/deprecation/invalid-literal.stderr @@ -0,0 +1,8 @@ +error: attribute must be of the form `#[deprecated]` or `#[deprecated(/*opt*/ since = "version", /*opt*/ note = "reason)]` or `#[deprecated = "reason"]` + --> $DIR/invalid-literal.rs:1:1 + | +LL | #[deprecated = b"test"] //~ ERROR attribute must be of the form + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/traits/trait-alias-syntax.rs b/src/test/ui/traits/trait-alias-syntax.rs new file mode 100644 index 00000000000..5948d45b698 --- /dev/null +++ b/src/test/ui/traits/trait-alias-syntax.rs @@ -0,0 +1,7 @@ +#![feature(trait_alias)] + +trait Foo {} +auto trait A = Foo; //~ ERROR trait aliases cannot be `auto` +unsafe trait B = Foo; //~ ERROR trait aliases cannot be `unsafe` + +fn main() {} diff --git a/src/test/ui/traits/trait-alias-syntax.stderr b/src/test/ui/traits/trait-alias-syntax.stderr new file mode 100644 index 00000000000..fc96f627439 --- /dev/null +++ b/src/test/ui/traits/trait-alias-syntax.stderr @@ -0,0 +1,14 @@ +error: trait aliases cannot be `auto` + --> $DIR/trait-alias-syntax.rs:4:19 + | +LL | auto trait A = Foo; //~ ERROR trait aliases cannot be `auto` + | ^ trait aliases cannot be `auto` + +error: trait aliases cannot be `unsafe` + --> $DIR/trait-alias-syntax.rs:5:21 + | +LL | unsafe trait B = Foo; //~ ERROR trait aliases cannot be `unsafe` + | ^ trait aliases cannot be `unsafe` + +error: aborting due to 2 previous errors + |
