about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-08 22:00:40 +0000
committerbors <bors@rust-lang.org>2023-08-08 22:00:40 +0000
commite3590fccfbdb6284bded9b70eca2e72b0c57e070 (patch)
tree6b0ef3943c464411c0901a8d3dc0b35464faf914 /tests
parentf88a8b71cebb730cbd5058c45ebcae1d4d9be377 (diff)
parenta5e91edaa0c047dcf30d8697efc356a3a85191c2 (diff)
Auto merge of #114637 - matthiaskrgr:rollup-544y8p5, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #106425 (Make ExitStatus implement Default)
 - #113480 (add aarch64-unknown-teeos target)
 - #113586 (Mention style for new syntax in tracking issue template)
 - #113593 (CFI: Fix error compiling core with LLVM CFI enabled)
 - #114612 (update llvm-wrapper include to silence deprecation warning)
 - #114613 (Prevent constant rebuilds of `rustc-main` (and thus everything else))
 - #114615 (interpret: remove incomplete protection against invalid where clauses)
 - #114628 (Allowing re-implementation of mir_drops_elaborated query)
 - #114629 (tests: Uncomment now valid GAT code behind FIXME)
 - #114630 (Migrate GUI colors test to original CSS color format)
 - #114631 (add provisional cache test for new solver)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc-gui/links-color.goml72
-rw-r--r--tests/ui/check-cfg/values-target-json.stderr2
-rw-r--r--tests/ui/check-cfg/well-known-values.stderr2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-80742.rs8
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-80742.stderr75
-rw-r--r--tests/ui/generic-associated-types/streaming_iterator.rs3
-rw-r--r--tests/ui/lto/issue-100772.rs4
-rw-r--r--tests/ui/sanitize/issue-111184-generator-witness.rs4
-rw-r--r--tests/ui/sanitize/sanitizer-cfi-requires-lto.rs2
-rw-r--r--tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr2
-rw-r--r--tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.rs8
-rw-r--r--tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.stderr4
-rw-r--r--tests/ui/traits/new-solver/cycles/inductive-not-on-stack.rs46
-rw-r--r--tests/ui/traits/new-solver/cycles/inductive-not-on-stack.stderr29
14 files changed, 145 insertions, 116 deletions
diff --git a/tests/rustdoc-gui/links-color.goml b/tests/rustdoc-gui/links-color.goml
index 2ee4bce1015..0789d785f58 100644
--- a/tests/rustdoc-gui/links-color.goml
+++ b/tests/rustdoc-gui/links-color.goml
@@ -46,53 +46,53 @@ call-function: (
     "check-colors",
     {
         "theme": "ayu",
-        "mod": "rgb(57, 175, 215)",
-        "macro": "rgb(163, 122, 204)",
-        "struct": "rgb(255, 160, 165)",
-        "enum": "rgb(255, 160, 165)",
-        "trait": "rgb(57, 175, 215)",
-        "fn": "rgb(253, 214, 135)",
-        "type": "rgb(255, 160, 165)",
-        "union": "rgb(255, 160, 165)",
-        "keyword": "rgb(57, 175, 215)",
-        "sidebar": "rgb(83, 177, 219)",
-        "sidebar_current": "rgb(255, 180, 76)",
-        "sidebar_current_background": "rgba(0, 0, 0, 0)",
+        "mod": "#39afd7",
+        "macro": "#a37acc",
+        "struct": "#ffa0a5",
+        "enum": "#ffa0a5",
+        "trait": "#39afd7",
+        "fn": "#fdd687",
+        "type": "#ffa0a5",
+        "union": "#ffa0a5",
+        "keyword": "#39afd7",
+        "sidebar": "#53b1db",
+        "sidebar_current": "#ffb44c",
+        "sidebar_current_background": "transparent",
     },
 )
 call-function: (
     "check-colors",
     {
         "theme": "dark",
-        "mod": "rgb(210, 153, 29)",
-        "macro": "rgb(9, 189, 0)",
-        "struct": "rgb(45, 191, 184)",
-        "enum": "rgb(45, 191, 184)",
-        "trait": "rgb(183, 140, 242)",
-        "fn": "rgb(43, 171, 99)",
-        "type": "rgb(45, 191, 184)",
-        "union": "rgb(45, 191, 184)",
-        "keyword": "rgb(210, 153, 29)",
-        "sidebar": "rgb(253, 191, 53)",
-        "sidebar_current": "rgb(253, 191, 53)",
-        "sidebar_current_background": "rgb(68, 68, 68)",
+        "mod": "#d2991d",
+        "macro": "#09bd00",
+        "struct": "#2dbfb8",
+        "enum": "#2dbfb8",
+        "trait": "#b78cf2",
+        "fn": "#2bab63",
+        "type": "#2dbfb8",
+        "union": "#2dbfb8",
+        "keyword": "#d2991d",
+        "sidebar": "#fdbf35",
+        "sidebar_current": "#fdbf35",
+        "sidebar_current_background": "#444",
     },
 )
 call-function: (
     "check-colors",
     {
         "theme": "light",
-        "mod": "rgb(56, 115, 173)",
-        "macro": "rgb(6, 128, 0)",
-        "struct": "rgb(173, 55, 138)",
-        "enum": "rgb(173, 55, 138)",
-        "trait": "rgb(110, 79, 201)",
-        "fn": "rgb(173, 124, 55)",
-        "type": "rgb(173, 55, 138)",
-        "union": "rgb(173, 55, 138)",
-        "keyword": "rgb(56, 115, 173)",
-        "sidebar": "rgb(53, 109, 164)",
-        "sidebar_current": "rgb(53, 109, 164)",
-        "sidebar_current_background": "rgb(255, 255, 255)",
+        "mod": "#3873ad",
+        "macro": "#068000",
+        "struct": "#ad378a",
+        "enum": "#ad378a",
+        "trait": "#6e4fc9",
+        "fn": "#ad7c37",
+        "type": "#ad378a",
+        "union": "#ad378a",
+        "keyword": "#3873ad",
+        "sidebar": "#356da4",
+        "sidebar_current": "#356da4",
+        "sidebar_current_background": "#fff",
     },
 )
diff --git a/tests/ui/check-cfg/values-target-json.stderr b/tests/ui/check-cfg/values-target-json.stderr
index eb81535e3ed..e773d5d83cc 100644
--- a/tests/ui/check-cfg/values-target-json.stderr
+++ b/tests/ui/check-cfg/values-target-json.stderr
@@ -6,7 +6,7 @@ LL | #[cfg(target_os = "linuz")]
    |                   |
    |                   help: there is a expected value with a similar name: `"linux"`
    |
-   = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `ericos`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `openbsd`, `psp`, `redox`, `solaris`, `solid_asp3`, `tvos`, `uefi`, `unknown`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`
+   = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `ericos`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `openbsd`, `psp`, `redox`, `solaris`, `solid_asp3`, `teeos`, `tvos`, `uefi`, `unknown`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`
    = note: `#[warn(unexpected_cfgs)]` on by default
 
 warning: 1 warning emitted
diff --git a/tests/ui/check-cfg/well-known-values.stderr b/tests/ui/check-cfg/well-known-values.stderr
index 2d18cb82e03..1f775814656 100644
--- a/tests/ui/check-cfg/well-known-values.stderr
+++ b/tests/ui/check-cfg/well-known-values.stderr
@@ -6,7 +6,7 @@ LL | #[cfg(target_os = "linuz")]
    |                   |
    |                   help: there is a expected value with a similar name: `"linux"`
    |
-   = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `openbsd`, `psp`, `redox`, `solaris`, `solid_asp3`, `tvos`, `uefi`, `unknown`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`
+   = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `openbsd`, `psp`, `redox`, `solaris`, `solid_asp3`, `teeos`, `tvos`, `uefi`, `unknown`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`
    = note: `#[warn(unexpected_cfgs)]` on by default
 
 warning: unexpected `cfg` condition value
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-80742.rs b/tests/ui/const-generics/generic_const_exprs/issue-80742.rs
index 275f6995302..6b2a0153f51 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-80742.rs
+++ b/tests/ui/const-generics/generic_const_exprs/issue-80742.rs
@@ -1,4 +1,9 @@
 // check-fail
+// known-bug: #97477
+// failure-status: 101
+// normalize-stderr-test "note: .*\n\n" -> ""
+// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
+// rustc-env:RUST_BACKTRACE=0
 
 // This test used to cause an ICE in rustc_mir::interpret::step::eval_rvalue_into_place
 
@@ -27,6 +32,5 @@ where
 }
 
 fn main() {
-    let dst = Inline::<dyn Debug>::new(0); //~ ERROR
-    //~^ ERROR
+    let dst = Inline::<dyn Debug>::new(0);
 }
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr
index dc3a400cbaa..79ed82e02e0 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr
@@ -1,71 +1,10 @@
-error[E0080]: evaluation of `Inline::<dyn Debug>::{constant#0}` failed
+error: internal compiler error: compiler/rustc_const_eval/src/interpret/step.rs:272:21: SizeOf MIR operator called for unsized type dyn Debug
   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
-   |
-   = note: size_of called on unsized type `dyn Debug`
-   |
-note: inside `std::mem::size_of::<dyn Debug>`
-  --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
-note: inside `Inline::<dyn Debug>::{constant#0}`
-  --> $DIR/issue-80742.rs:22:10
-   |
-LL |     [u8; size_of::<T>() + 1]: ,
-   |          ^^^^^^^^^^^^^^
-
-error[E0599]: the function or associated item `new` exists for struct `Inline<dyn Debug>`, but its trait bounds were not satisfied
-  --> $DIR/issue-80742.rs:30:36
-   |
-LL | struct Inline<T>
-   | ---------------- function or associated item `new` not found for this struct
-...
-LL |     let dst = Inline::<dyn Debug>::new(0);
-   |                                    ^^^ function or associated item cannot be called on `Inline<dyn Debug>` due to unsatisfied trait bounds
-  --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
-   |
-   = note: doesn't satisfy `dyn Debug: Sized`
-   |
-note: trait bound `dyn Debug: Sized` was not satisfied
-  --> $DIR/issue-80742.rs:20:6
-   |
-LL | impl<T> Inline<T>
-   |      ^  ---------
-   |      |
-   |      unsatisfied trait bound introduced here
-help: consider relaxing the type parameter's implicit `Sized` bound
-   |
-LL | impl<T: ?Sized> Inline<T>
-   |       ++++++++
-
-error[E0080]: evaluation of `Inline::<dyn Debug>::{constant#0}` failed
-  --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
-   |
-   = note: size_of called on unsized type `dyn Debug`
-   |
-note: inside `std::mem::size_of::<dyn Debug>`
-  --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
-note: inside `Inline::<dyn Debug>::{constant#0}`
-  --> $DIR/issue-80742.rs:14:10
-   |
-LL |     [u8; size_of::<T>() + 1]: ,
-   |          ^^^^^^^^^^^^^^
-
-error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
-  --> $DIR/issue-80742.rs:30:15
-   |
-LL |     let dst = Inline::<dyn Debug>::new(0);
-   |               ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `dyn Debug`
-note: required by a bound in `Inline`
-  --> $DIR/issue-80742.rs:12:15
-   |
-LL | struct Inline<T>
-   |               ^ required by this bound in `Inline`
-help: consider relaxing the implicit `Sized` restriction
-   |
-LL | struct Inline<T: ?Sized>
-   |                ++++++++
 
-error: aborting due to 4 previous errors
+Box<dyn Any>
+query stack during panic:
+#0 [eval_to_allocation_raw] const-evaluating + checking `<impl at $DIR/issue-80742.rs:25:1: 25:18>::{constant#0}`
+#1 [eval_to_valtree] evaluating type-level constant
+end of query stack
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0080, E0277, E0599.
-For more information about an error, try `rustc --explain E0080`.
diff --git a/tests/ui/generic-associated-types/streaming_iterator.rs b/tests/ui/generic-associated-types/streaming_iterator.rs
index 408b8dc99eb..656fb743ee4 100644
--- a/tests/ui/generic-associated-types/streaming_iterator.rs
+++ b/tests/ui/generic-associated-types/streaming_iterator.rs
@@ -15,8 +15,7 @@ struct Foo<T: StreamingIterator + 'static> {
 
 // Users can bound parameters by the type constructed by that trait's associated type constructor
 // of a trait using HRTB. Both type equality bounds and trait bounds of this kind are valid:
-//FIXME(#44265): This next line should parse and be valid
-//fn foo<T: for<'a> StreamingIterator<Item<'a>=&'a [i32]>>(_iter: T) { /* ... */ }
+fn _bar<T: for<'a> StreamingIterator<Item<'a>=&'a [i32]>>(_iter: T) { /* ... */ }
 fn _foo<T>(_iter: T) where T: StreamingIterator, for<'a> T::Item<'a>: Display { /* ... */ }
 
 // Full example of enumerate iterator
diff --git a/tests/ui/lto/issue-100772.rs b/tests/ui/lto/issue-100772.rs
index d6b06719277..eeb51196236 100644
--- a/tests/ui/lto/issue-100772.rs
+++ b/tests/ui/lto/issue-100772.rs
@@ -1,6 +1,6 @@
-// run-pass
+// build-pass
 // needs-sanitizer-cfi
-// compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi
+// compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi
 // no-prefer-dynamic
 // only-x86_64-unknown-linux-gnu
 
diff --git a/tests/ui/sanitize/issue-111184-generator-witness.rs b/tests/ui/sanitize/issue-111184-generator-witness.rs
index 8f4118057ce..d36d8bce561 100644
--- a/tests/ui/sanitize/issue-111184-generator-witness.rs
+++ b/tests/ui/sanitize/issue-111184-generator-witness.rs
@@ -2,10 +2,10 @@
 // encode_ty and caused the compiler to ICE.
 //
 // needs-sanitizer-cfi
-// compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi --edition=2021
+// compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi --edition=2021
 // no-prefer-dynamic
 // only-x86_64-unknown-linux-gnu
-// run-pass
+// build-pass
 
 use std::future::Future;
 
diff --git a/tests/ui/sanitize/sanitizer-cfi-requires-lto.rs b/tests/ui/sanitize/sanitizer-cfi-requires-lto.rs
index 29e32889fcc..e9a49dd3ff1 100644
--- a/tests/ui/sanitize/sanitizer-cfi-requires-lto.rs
+++ b/tests/ui/sanitize/sanitizer-cfi-requires-lto.rs
@@ -1,4 +1,4 @@
-// Verifies that `-Zsanitizer=cfi` requires `-Clto`, `-Clto=thin`, or `-Clinker-plugin-lto`.
+// Verifies that `-Zsanitizer=cfi` requires `-Clto` or `-Clinker-plugin-lto`.
 //
 // needs-sanitizer-cfi
 // compile-flags: -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi
diff --git a/tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr b/tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr
index 5e706b513b9..8cd9c544417 100644
--- a/tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr
+++ b/tests/ui/sanitize/sanitizer-cfi-requires-lto.stderr
@@ -1,4 +1,4 @@
-error: `-Zsanitizer=cfi` requires `-Clto`, `-Clto=thin`, or `-Clinker-plugin-lto`
+error: `-Zsanitizer=cfi` requires `-Clto` or `-Clinker-plugin-lto`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.rs b/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.rs
new file mode 100644
index 00000000000..a13c12c1787
--- /dev/null
+++ b/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.rs
@@ -0,0 +1,8 @@
+// Verifies that `-Zsanitizer=cfi` with `-Clto` or `-Clto=thin` requires `-Ccodegen-units=1`.
+//
+// needs-sanitizer-cfi
+// compile-flags: -Ccodegen-units=2 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi
+
+#![feature(no_core)]
+#![no_core]
+#![no_main]
diff --git a/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.stderr b/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.stderr
new file mode 100644
index 00000000000..136f4936084
--- /dev/null
+++ b/tests/ui/sanitize/sanitizer-cfi-with-rustc-lto-requires-single-codegen-unit.stderr
@@ -0,0 +1,4 @@
+error: `-Zsanitizer=cfi` with `-Clto` requires `-Ccodegen-units=1`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.rs b/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.rs
new file mode 100644
index 00000000000..f06b98a79cf
--- /dev/null
+++ b/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.rs
@@ -0,0 +1,46 @@
+// compile-flags: -Ztrait-solver=next
+#![feature(rustc_attrs, trivial_bounds)]
+
+// We have to be careful here:
+//
+// We either have the provisional result of `A -> B -> A` on the
+// stack, which is a fully coinductive cycle. Accessing the
+// provisional result for `B` as part of the `A -> C -> B -> A` cycle
+// has to make sure we don't just use the result of `A -> B -> A` as the
+// new cycle is inductive.
+//
+// Alternatively, if we have `A -> C -> A` first, then `A -> B -> A` has
+// a purely inductive stack, so something could also go wrong here.
+
+#[rustc_coinductive]
+trait A {}
+#[rustc_coinductive]
+trait B {}
+trait C {}
+
+impl<T: B + C> A for T {}
+impl<T: A> B for T {}
+impl<T: B> C for T {}
+
+fn impls_a<T: A>() {}
+
+// The same test with reordered where clauses to make sure we're actually testing anything.
+#[rustc_coinductive]
+trait AR {}
+#[rustc_coinductive]
+trait BR {}
+trait CR {}
+
+impl<T: CR + BR> AR for T {}
+impl<T: AR> BR for T {}
+impl<T: BR> CR for T {}
+
+fn impls_ar<T: AR>() {}
+
+fn main() {
+    impls_a::<()>();
+    //~^ ERROR overflow evaluating the requirement `(): A`
+
+    impls_ar::<()>();
+    //~^ ERROR overflow evaluating the requirement `(): AR`
+}
diff --git a/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.stderr b/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.stderr
new file mode 100644
index 00000000000..33fac603cbd
--- /dev/null
+++ b/tests/ui/traits/new-solver/cycles/inductive-not-on-stack.stderr
@@ -0,0 +1,29 @@
+error[E0275]: overflow evaluating the requirement `(): A`
+  --> $DIR/inductive-not-on-stack.rs:41:5
+   |
+LL |     impls_a::<()>();
+   |     ^^^^^^^^^^^^^
+   |
+   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`inductive_not_on_stack`)
+note: required by a bound in `impls_a`
+  --> $DIR/inductive-not-on-stack.rs:25:15
+   |
+LL | fn impls_a<T: A>() {}
+   |               ^ required by this bound in `impls_a`
+
+error[E0275]: overflow evaluating the requirement `(): AR`
+  --> $DIR/inductive-not-on-stack.rs:44:5
+   |
+LL |     impls_ar::<()>();
+   |     ^^^^^^^^^^^^^^
+   |
+   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`inductive_not_on_stack`)
+note: required by a bound in `impls_ar`
+  --> $DIR/inductive-not-on-stack.rs:38:16
+   |
+LL | fn impls_ar<T: AR>() {}
+   |                ^^ required by this bound in `impls_ar`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0275`.