about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-22 12:29:30 +0000
committerbors <bors@rust-lang.org>2021-07-22 12:29:30 +0000
commit1158367a6d60d3e2a8c68d6212a8007992b1dbf0 (patch)
tree6f92df24a03ad09f494a72e1be383c947e400568 /src/test
parentf913a4fe901d6aeb84941fa06c17916d4e6d1dd7 (diff)
parentab9ea543f8637e0e01cef5e71d6e314999049b28 (diff)
Auto merge of #87366 - GuillaumeGomez:rollup-7muueab, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #87270 (Don't display <table> in item summary)
 - #87281 (Normalize generic_ty before checking if bound is met)
 - #87288 (rustdoc: Restore --default-theme, etc, by restoring varname escaping)
 - #87307 (Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC.)
 - #87343 (Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations)
 - #87357 (Update my name/email in .mailmap)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
-rw-r--r--src/test/codegen/pgo-instrumentation.rs3
-rw-r--r--src/test/run-make-fulldeps/pgo-branch-weights/Makefile13
-rw-r--r--src/test/run-make-fulldeps/pgo-gen-lto/Makefile8
-rw-r--r--src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile8
-rw-r--r--src/test/run-make-fulldeps/pgo-gen/Makefile8
-rw-r--r--src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile14
-rw-r--r--src/test/run-make-fulldeps/pgo-use/Makefile8
-rw-r--r--src/test/rustdoc-gui/default-settings.goml8
-rw-r--r--src/test/rustdoc-gui/item-summary-table.goml6
-rw-r--r--src/test/rustdoc-gui/src/Cargo.toml6
-rw-r--r--src/test/rustdoc-gui/src/lib2/Cargo.lock (renamed from src/test/rustdoc-gui/src/Cargo.lock)4
-rw-r--r--src/test/rustdoc-gui/src/lib2/Cargo.toml2
-rw-r--r--src/test/rustdoc-gui/src/lib2/implementors/Cargo.lock7
-rw-r--r--src/test/rustdoc-gui/src/lib2/implementors/Cargo.toml (renamed from src/test/rustdoc-gui/src/implementors/Cargo.toml)0
-rw-r--r--src/test/rustdoc-gui/src/lib2/implementors/lib.rs (renamed from src/test/rustdoc-gui/src/implementors/lib.rs)0
-rw-r--r--src/test/rustdoc-gui/src/lib2/lib.rs7
-rw-r--r--src/test/rustdoc-gui/src/settings/.cargo/config.toml2
-rw-r--r--src/test/rustdoc-gui/src/settings/Cargo.lock7
-rw-r--r--src/test/rustdoc-gui/src/settings/Cargo.toml7
-rw-r--r--src/test/rustdoc-gui/src/settings/lib.rs1
-rw-r--r--src/test/rustdoc-gui/src/test_docs/Cargo.lock7
-rw-r--r--src/test/rustdoc/default-theme.rs7
-rw-r--r--src/test/ui/generic-associated-types/issue-81487.rs19
23 files changed, 80 insertions, 72 deletions
diff --git a/src/test/codegen/pgo-instrumentation.rs b/src/test/codegen/pgo-instrumentation.rs
index c085f3c829e..05c2d2fc0d8 100644
--- a/src/test/codegen/pgo-instrumentation.rs
+++ b/src/test/codegen/pgo-instrumentation.rs
@@ -1,8 +1,7 @@
 // Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR.
-// Compiling with `-Cpanic=abort` because PGO+unwinding isn't supported on all platforms.
 
 // needs-profiler-support
-// compile-flags: -Cprofile-generate -Ccodegen-units=1 -Cpanic=abort
+// compile-flags: -Cprofile-generate -Ccodegen-units=1
 
 // CHECK: @__llvm_profile_raw_version =
 // CHECK-DAG: @__profc_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = {{.*}}global
diff --git a/src/test/run-make-fulldeps/pgo-branch-weights/Makefile b/src/test/run-make-fulldeps/pgo-branch-weights/Makefile
index 18828b66ce8..9773e3f1fdf 100644
--- a/src/test/run-make-fulldeps/pgo-branch-weights/Makefile
+++ b/src/test/run-make-fulldeps/pgo-branch-weights/Makefile
@@ -6,19 +6,6 @@
 
 -include ../tools.mk
 
-# This test makes sure that instrumented binaries record the right counts for
-# functions being called and branches being taken. We run an instrumented binary
-# with an argument that causes a know path through the program and then check
-# that the expected counts get added to the use-phase LLVM IR.
-
-# LLVM doesn't support instrumenting binaries that use SEH:
-# https://github.com/rust-lang/rust/issues/61002
-#
-# Things work fine with -Cpanic=abort though.
-ifdef IS_MSVC
-COMMON_FLAGS=-Cpanic=abort
-endif
-
 # For some very small programs GNU ld seems to not properly handle
 # instrumentation sections correctly. Neither Gold nor LLD have that problem.
 ifeq ($(UNAME),Linux)
diff --git a/src/test/run-make-fulldeps/pgo-gen-lto/Makefile b/src/test/run-make-fulldeps/pgo-gen-lto/Makefile
index f1ac39aa0ea..a7d5c561632 100644
--- a/src/test/run-make-fulldeps/pgo-gen-lto/Makefile
+++ b/src/test/run-make-fulldeps/pgo-gen-lto/Makefile
@@ -8,14 +8,6 @@
 
 COMPILE_FLAGS=-Copt-level=3 -Clto=fat -Cprofile-generate="$(TMPDIR)"
 
-# LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC:
-# https://github.com/rust-lang/rust/issues/61002
-#
-# Things work fine with -Cpanic=abort though.
-ifdef IS_MSVC
-COMPILE_FLAGS+= -Cpanic=abort
-endif
-
 all:
 	$(RUSTC) $(COMPILE_FLAGS) test.rs
 	$(call RUN,test) || exit 1
diff --git a/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile b/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
index 3fbfeb09eb3..425bfc28a97 100644
--- a/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
+++ b/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
@@ -4,14 +4,6 @@
 
 COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)"
 
-# LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC:
-# https://github.com/rust-lang/rust/issues/61002
-#
-# Things work fine with -Cpanic=abort though.
-ifdef IS_MSVC
-COMPILE_FLAGS+= -Cpanic=abort
-endif
-
 all:
 	$(RUSTC) $(COMPILE_FLAGS) --emit=llvm-ir test.rs
 	# We expect symbols starting with "__llvm_profile_".
diff --git a/src/test/run-make-fulldeps/pgo-gen/Makefile b/src/test/run-make-fulldeps/pgo-gen/Makefile
index 69b19801bf0..6533355be34 100644
--- a/src/test/run-make-fulldeps/pgo-gen/Makefile
+++ b/src/test/run-make-fulldeps/pgo-gen/Makefile
@@ -8,14 +8,6 @@
 
 COMPILE_FLAGS=-g -Cprofile-generate="$(TMPDIR)"
 
-# LLVM doesn't yet support instrumenting binaries that use unwinding on MSVC:
-# https://github.com/rust-lang/rust/issues/61002
-#
-# Things work fine with -Cpanic=abort though.
-ifdef IS_MSVC
-COMPILE_FLAGS+= -Cpanic=abort
-endif
-
 all:
 	$(RUSTC) $(COMPILE_FLAGS) test.rs
 	$(call RUN,test) || exit 1
diff --git a/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile b/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile
index 876a9b2c439..c0195dcbb31 100644
--- a/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile
+++ b/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile
@@ -6,20 +6,6 @@
 
 -include ../tools.mk
 
-# This test makes sure that indirect call promotion is performed. The test
-# programs calls the same function a thousand times through a function pointer.
-# Only PGO data provides the information that it actually always is the same
-# function. We verify that the indirect call promotion pass inserts a check
-# whether it can make a direct call instead of the indirect call.
-
-# LLVM doesn't support instrumenting binaries that use SEH:
-# https://github.com/rust-lang/rust/issues/61002
-#
-# Things work fine with -Cpanic=abort though.
-ifdef IS_MSVC
-COMMON_FLAGS=-Cpanic=abort
-endif
-
 all:
 	# We don't compile `opaque` with either optimizations or instrumentation.
 	# We don't compile `opaque` with either optimizations or instrumentation.
diff --git a/src/test/run-make-fulldeps/pgo-use/Makefile b/src/test/run-make-fulldeps/pgo-use/Makefile
index 01bc211df16..d7863c9c587 100644
--- a/src/test/run-make-fulldeps/pgo-use/Makefile
+++ b/src/test/run-make-fulldeps/pgo-use/Makefile
@@ -18,14 +18,6 @@
 
 COMMON_FLAGS=-Copt-level=2 -Ccodegen-units=1 -Cllvm-args=-disable-preinline
 
-# LLVM doesn't support instrumenting binaries that use SEH:
-# https://github.com/rust-lang/rust/issues/61002
-#
-# Things work fine with -Cpanic=abort though.
-ifdef IS_MSVC
-COMMON_FLAGS+= -Cpanic=abort
-endif
-
 ifeq ($(UNAME),Darwin)
 # macOS does not have the `tac` command, but `tail -r` does the same thing
 TAC := tail -r
diff --git a/src/test/rustdoc-gui/default-settings.goml b/src/test/rustdoc-gui/default-settings.goml
new file mode 100644
index 00000000000..68b674a11f2
--- /dev/null
+++ b/src/test/rustdoc-gui/default-settings.goml
@@ -0,0 +1,8 @@
+// This test ensures that the default settings are correctly applied.
+//
+// The "settings" crate uses "ayu" as default setting, which is what we will
+// check.
+goto: file://|DOC_PATH|/settings/index.html
+// Wait a bit to be sure the default theme is applied.
+wait-for: 1000
+assert-css: ("body", {"background-color": "rgb(15, 20, 25)"})
diff --git a/src/test/rustdoc-gui/item-summary-table.goml b/src/test/rustdoc-gui/item-summary-table.goml
new file mode 100644
index 00000000000..6bf4e288c43
--- /dev/null
+++ b/src/test/rustdoc-gui/item-summary-table.goml
@@ -0,0 +1,6 @@
+// This test ensures that <table> elements aren't display in items summary.
+goto: file://|DOC_PATH|/lib2/summary_table/index.html
+// We check that we picked the right item first.
+assert-text: (".item-table .item-left", "Foo")
+// Then we check that its summary is empty.
+assert-text: (".item-table .item-right", "")
diff --git a/src/test/rustdoc-gui/src/Cargo.toml b/src/test/rustdoc-gui/src/Cargo.toml
deleted file mode 100644
index 9c8c0c636f0..00000000000
--- a/src/test/rustdoc-gui/src/Cargo.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[workspace]
-members = [
-    "test_docs",
-    "lib2",
-    "implementors",
-]
diff --git a/src/test/rustdoc-gui/src/Cargo.lock b/src/test/rustdoc-gui/src/lib2/Cargo.lock
index a72ccffc6dd..a5873ceb325 100644
--- a/src/test/rustdoc-gui/src/Cargo.lock
+++ b/src/test/rustdoc-gui/src/lib2/Cargo.lock
@@ -12,7 +12,3 @@ version = "0.1.0"
 dependencies = [
  "implementors",
 ]
-
-[[package]]
-name = "test_docs"
-version = "0.1.0"
diff --git a/src/test/rustdoc-gui/src/lib2/Cargo.toml b/src/test/rustdoc-gui/src/lib2/Cargo.toml
index 6041a793f08..2e37f3f667a 100644
--- a/src/test/rustdoc-gui/src/lib2/Cargo.toml
+++ b/src/test/rustdoc-gui/src/lib2/Cargo.toml
@@ -7,4 +7,4 @@ edition = "2018"
 path = "lib.rs"
 
 [dependencies]
-implementors = { path = "../implementors" }
+implementors = { path = "./implementors" }
diff --git a/src/test/rustdoc-gui/src/lib2/implementors/Cargo.lock b/src/test/rustdoc-gui/src/lib2/implementors/Cargo.lock
new file mode 100644
index 00000000000..cad99a991a2
--- /dev/null
+++ b/src/test/rustdoc-gui/src/lib2/implementors/Cargo.lock
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "implementors"
+version = "0.1.0"
diff --git a/src/test/rustdoc-gui/src/implementors/Cargo.toml b/src/test/rustdoc-gui/src/lib2/implementors/Cargo.toml
index 7ef1052c49f..7ef1052c49f 100644
--- a/src/test/rustdoc-gui/src/implementors/Cargo.toml
+++ b/src/test/rustdoc-gui/src/lib2/implementors/Cargo.toml
diff --git a/src/test/rustdoc-gui/src/implementors/lib.rs b/src/test/rustdoc-gui/src/lib2/implementors/lib.rs
index 4b2f6962e30..4b2f6962e30 100644
--- a/src/test/rustdoc-gui/src/implementors/lib.rs
+++ b/src/test/rustdoc-gui/src/lib2/implementors/lib.rs
diff --git a/src/test/rustdoc-gui/src/lib2/lib.rs b/src/test/rustdoc-gui/src/lib2/lib.rs
index 86ae330e009..36373d24971 100644
--- a/src/test/rustdoc-gui/src/lib2/lib.rs
+++ b/src/test/rustdoc-gui/src/lib2/lib.rs
@@ -66,3 +66,10 @@ pub mod long_table {
     /// I wanna sqdkfnqds f dsqf qds f dsqf dsq f dsq f qds f qds f qds f dsqq f dsf sqdf dsq fds f dsq f dq f ds fq sd fqds f dsq f sqd fsq df sd fdsqfqsd fdsq f dsq f dsqfd s dfq
     pub struct Foo;
 }
+
+pub mod summary_table {
+    /// | header 1 | header 2 |
+    /// | -------- | -------- |
+    /// | content | content |
+    pub struct Foo;
+}
diff --git a/src/test/rustdoc-gui/src/settings/.cargo/config.toml b/src/test/rustdoc-gui/src/settings/.cargo/config.toml
new file mode 100644
index 00000000000..bbb8d11a2ed
--- /dev/null
+++ b/src/test/rustdoc-gui/src/settings/.cargo/config.toml
@@ -0,0 +1,2 @@
+[build]
+rustdocflags = ["--default-theme", "ayu"]
diff --git a/src/test/rustdoc-gui/src/settings/Cargo.lock b/src/test/rustdoc-gui/src/settings/Cargo.lock
new file mode 100644
index 00000000000..6f0de1ac1e8
--- /dev/null
+++ b/src/test/rustdoc-gui/src/settings/Cargo.lock
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "settings"
+version = "0.1.0"
diff --git a/src/test/rustdoc-gui/src/settings/Cargo.toml b/src/test/rustdoc-gui/src/settings/Cargo.toml
new file mode 100644
index 00000000000..c8a211a47ca
--- /dev/null
+++ b/src/test/rustdoc-gui/src/settings/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "settings"
+version = "0.1.0"
+edition = "2018"
+
+[lib]
+path = "lib.rs"
diff --git a/src/test/rustdoc-gui/src/settings/lib.rs b/src/test/rustdoc-gui/src/settings/lib.rs
new file mode 100644
index 00000000000..b76b4321d62
--- /dev/null
+++ b/src/test/rustdoc-gui/src/settings/lib.rs
@@ -0,0 +1 @@
+pub fn foo() {}
diff --git a/src/test/rustdoc-gui/src/test_docs/Cargo.lock b/src/test/rustdoc-gui/src/test_docs/Cargo.lock
new file mode 100644
index 00000000000..6b80f6e88ef
--- /dev/null
+++ b/src/test/rustdoc-gui/src/test_docs/Cargo.lock
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "test_docs"
+version = "0.1.0"
diff --git a/src/test/rustdoc/default-theme.rs b/src/test/rustdoc/default-theme.rs
new file mode 100644
index 00000000000..ecb8f0b3b48
--- /dev/null
+++ b/src/test/rustdoc/default-theme.rs
@@ -0,0 +1,7 @@
+// compile-flags: --default-theme ayu
+
+// @has default_theme/index.html
+// @has - '//script[@id="default-settings"]/@data-theme' 'ayu'
+// @has - '//script[@id="default-settings"]/@data-use_system_theme' 'false'
+
+pub fn whatever() {}
diff --git a/src/test/ui/generic-associated-types/issue-81487.rs b/src/test/ui/generic-associated-types/issue-81487.rs
new file mode 100644
index 00000000000..7f399c4f9a2
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-81487.rs
@@ -0,0 +1,19 @@
+// build-pass
+
+#![feature(generic_associated_types)]
+
+trait Trait {
+    type Ref<'a>;
+}
+
+impl Trait for () {
+    type Ref<'a> = &'a i8;
+}
+
+struct RefRef<'a, T: Trait>(&'a <T as Trait>::Ref<'a>);
+
+fn wrap<'a, T: Trait>(reff: &'a <T as Trait>::Ref<'a>) -> RefRef<'a, T> {
+    RefRef(reff)
+}
+
+fn main() {}