about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-fulldeps/missing-rustc-driver-error.rs4
-rw-r--r--tests/ui-fulldeps/missing-rustc-driver-error.stderr12
-rw-r--r--tests/ui/inference/issue-113354.fixed4
-rw-r--r--tests/ui/inference/issue-113354.rs4
-rw-r--r--tests/ui/inference/issue-113354.stderr14
-rw-r--r--tests/ui/inference/need_type_info/issue-113264-incorrect-impl-trait-in-path-suggestion.rs12
-rw-r--r--tests/ui/inference/need_type_info/issue-113264-incorrect-impl-trait-in-path-suggestion.stderr14
-rw-r--r--tests/ui/panics/abort-on-panic.rs2
-rw-r--r--tests/ui/sanitize/address.rs3
-rw-r--r--tests/ui/sanitize/badfree.rs1
-rw-r--r--tests/ui/sanitize/issue-72154-lifetime-markers.rs1
-rw-r--r--tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs1
-rw-r--r--tests/ui/sanitize/use-after-scope.rs1
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs5
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.stderr25
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types.rs5
-rw-r--r--tests/ui/transmutability/references/recursive-wrapper-types.stderr25
-rw-r--r--tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.fixed (renamed from tests/ui/parser/type-alias-where-fixable.fixed)0
-rw-r--r--tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.rs (renamed from tests/ui/parser/type-alias-where-fixable.rs)0
-rw-r--r--tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.stderr (renamed from tests/ui/parser/type-alias-where-fixable.stderr)6
-rw-r--r--tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.fixed15
-rw-r--r--tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.rs15
-rw-r--r--tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.stderr29
-rw-r--r--tests/ui/where-clauses/where-clause-placement-type-alias.rs (renamed from tests/ui/parser/type-alias-where.rs)0
-rw-r--r--tests/ui/where-clauses/where-clause-placement-type-alias.stderr (renamed from tests/ui/parser/type-alias-where.stderr)4
25 files changed, 127 insertions, 75 deletions
diff --git a/tests/ui-fulldeps/missing-rustc-driver-error.rs b/tests/ui-fulldeps/missing-rustc-driver-error.rs
index 654cd6f6dc9..b627a207c98 100644
--- a/tests/ui-fulldeps/missing-rustc-driver-error.rs
+++ b/tests/ui-fulldeps/missing-rustc-driver-error.rs
@@ -1,8 +1,8 @@
 // Test that we get the following hint when trying to use a compiler crate without rustc_driver.
 // error-pattern: try adding `extern crate rustc_driver;` at the top level of this crate
 // compile-flags: --emit link
-// The exactly list of required crates depends on the target. as such only test Unix targets.
-// only-unix
+// normalize-stderr-test ".*crate .* required.*\n\n" -> ""
+// normalize-stderr-test: "aborting due to [0-9]+" -> "aborting due to NUMBER"
 
 #![feature(rustc_private)]
 
diff --git a/tests/ui-fulldeps/missing-rustc-driver-error.stderr b/tests/ui-fulldeps/missing-rustc-driver-error.stderr
index 939e888e5cb..d7bf27d6349 100644
--- a/tests/ui-fulldeps/missing-rustc-driver-error.stderr
+++ b/tests/ui-fulldeps/missing-rustc-driver-error.stderr
@@ -2,15 +2,5 @@ error: crate `rustc_serialize` required to be available in rlib format, but was
    |
    = help: try adding `extern crate rustc_driver;` at the top level of this crate
 
-error: crate `smallvec` required to be available in rlib format, but was not found in this form
-
-error: crate `thin_vec` required to be available in rlib format, but was not found in this form
-
-error: crate `indexmap` required to be available in rlib format, but was not found in this form
-
-error: crate `hashbrown` required to be available in rlib format, but was not found in this form
-
-error: crate `equivalent` required to be available in rlib format, but was not found in this form
-
-error: aborting due to 6 previous errors
+error: aborting due to NUMBER previous errors
 
diff --git a/tests/ui/inference/issue-113354.fixed b/tests/ui/inference/issue-113354.fixed
new file mode 100644
index 00000000000..804db985ae1
--- /dev/null
+++ b/tests/ui/inference/issue-113354.fixed
@@ -0,0 +1,4 @@
+//run-rustfix
+fn main() {
+    let _ = || { while let Some(_) = Some(1) { } }; //~ ERROR mismatched types
+}
diff --git a/tests/ui/inference/issue-113354.rs b/tests/ui/inference/issue-113354.rs
new file mode 100644
index 00000000000..ec33d1f8b84
--- /dev/null
+++ b/tests/ui/inference/issue-113354.rs
@@ -0,0 +1,4 @@
+//run-rustfix
+fn main() {
+    let _ = || { while Some(_) = Some(1) { } }; //~ ERROR mismatched types
+}
diff --git a/tests/ui/inference/issue-113354.stderr b/tests/ui/inference/issue-113354.stderr
new file mode 100644
index 00000000000..045a5aa7bf0
--- /dev/null
+++ b/tests/ui/inference/issue-113354.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-113354.rs:3:24
+   |
+LL |     let _ = || { while Some(_) = Some(1) { } };
+   |                        ^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
+   |
+help: consider adding `let`
+   |
+LL |     let _ = || { while let Some(_) = Some(1) { } };
+   |                        +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/inference/need_type_info/issue-113264-incorrect-impl-trait-in-path-suggestion.rs b/tests/ui/inference/need_type_info/issue-113264-incorrect-impl-trait-in-path-suggestion.rs
new file mode 100644
index 00000000000..5a893f2d8ad
--- /dev/null
+++ b/tests/ui/inference/need_type_info/issue-113264-incorrect-impl-trait-in-path-suggestion.rs
@@ -0,0 +1,12 @@
+trait T {}
+
+struct S {}
+
+impl S {
+    fn owo(&self, _: Option<&impl T>) {}
+}
+
+fn main() {
+    (S {}).owo(None)
+    //~^ ERROR type annotations needed
+}
diff --git a/tests/ui/inference/need_type_info/issue-113264-incorrect-impl-trait-in-path-suggestion.stderr b/tests/ui/inference/need_type_info/issue-113264-incorrect-impl-trait-in-path-suggestion.stderr
new file mode 100644
index 00000000000..0ec219415ab
--- /dev/null
+++ b/tests/ui/inference/need_type_info/issue-113264-incorrect-impl-trait-in-path-suggestion.stderr
@@ -0,0 +1,14 @@
+error[E0282]: type annotations needed
+  --> $DIR/issue-113264-incorrect-impl-trait-in-path-suggestion.rs:10:16
+   |
+LL |     (S {}).owo(None)
+   |                ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
+   |
+help: consider specifying the generic argument
+   |
+LL |     (S {}).owo(None::<&_>)
+   |                    ++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/panics/abort-on-panic.rs b/tests/ui/panics/abort-on-panic.rs
index 1f6ad64c071..7fbee85ffd1 100644
--- a/tests/ui/panics/abort-on-panic.rs
+++ b/tests/ui/panics/abort-on-panic.rs
@@ -1,4 +1,6 @@
 // run-pass
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
 
 #![allow(unused_must_use)]
 #![feature(c_unwind)]
diff --git a/tests/ui/sanitize/address.rs b/tests/ui/sanitize/address.rs
index 5b2cea87560..1faab1fd2fc 100644
--- a/tests/ui/sanitize/address.rs
+++ b/tests/ui/sanitize/address.rs
@@ -1,11 +1,12 @@
 // needs-sanitizer-support
 // needs-sanitizer-address
+// ignore-cross-compile
 //
 // compile-flags: -Z sanitizer=address -O -g
 //
 // run-fail
 // error-pattern: AddressSanitizer: stack-buffer-overflow
-// error-pattern: 'xs' (line 13) <== Memory access at offset
+// error-pattern: 'xs' (line 14) <== Memory access at offset
 
 use std::hint::black_box;
 
diff --git a/tests/ui/sanitize/badfree.rs b/tests/ui/sanitize/badfree.rs
index 095a6f4697b..c8d1ce7dff2 100644
--- a/tests/ui/sanitize/badfree.rs
+++ b/tests/ui/sanitize/badfree.rs
@@ -1,5 +1,6 @@
 // needs-sanitizer-support
 // needs-sanitizer-address
+// ignore-cross-compile
 //
 // compile-flags: -Z sanitizer=address -O
 //
diff --git a/tests/ui/sanitize/issue-72154-lifetime-markers.rs b/tests/ui/sanitize/issue-72154-lifetime-markers.rs
index b2e182238ce..3d9c51daa65 100644
--- a/tests/ui/sanitize/issue-72154-lifetime-markers.rs
+++ b/tests/ui/sanitize/issue-72154-lifetime-markers.rs
@@ -5,6 +5,7 @@
 //
 // needs-sanitizer-support
 // needs-sanitizer-address
+// ignore-cross-compile
 //
 // compile-flags: -Copt-level=0 -Zsanitizer=address
 // run-pass
diff --git a/tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs b/tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
index 33e18e35522..052a40598a8 100644
--- a/tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
+++ b/tests/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
@@ -4,6 +4,7 @@
 //
 // needs-sanitizer-support
 // needs-sanitizer-address
+// ignore-cross-compile
 //
 // no-prefer-dynamic
 // revisions: opt0 opt1
diff --git a/tests/ui/sanitize/use-after-scope.rs b/tests/ui/sanitize/use-after-scope.rs
index 30be2ae6f09..de63eea194b 100644
--- a/tests/ui/sanitize/use-after-scope.rs
+++ b/tests/ui/sanitize/use-after-scope.rs
@@ -1,5 +1,6 @@
 // needs-sanitizer-support
 // needs-sanitizer-address
+// ignore-cross-compile
 //
 // compile-flags: -Zsanitizer=address
 // run-fail
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs
index 3ea80173afa..709d8cdc762 100644
--- a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs
+++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs
@@ -1,5 +1,4 @@
-// check-fail
-// FIXME(bryangarza): Change to check-pass when coinduction is supported for BikeshedIntrinsicFrom
+// check-pass
 #![feature(transmutability)]
 
 mod assert {
@@ -22,5 +21,5 @@ mod assert {
 fn main() {
     #[repr(C)] struct A(bool, &'static A);
     #[repr(C)] struct B(u8, &'static B);
-    assert::is_maybe_transmutable::<&'static A, &'static B>(); //~ ERROR overflow evaluating the requirement
+    assert::is_maybe_transmutable::<&'static A, &'static B>();
 }
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.stderr b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.stderr
deleted file mode 100644
index fae332e6af9..00000000000
--- a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0275]: overflow evaluating the requirement `B: BikeshedIntrinsicFrom<A, assert::Context, Assume { alignment: true, lifetimes: false, safety: true, validity: false }>`
-  --> $DIR/recursive-wrapper-types-bit-compatible.rs:25:5
-   |
-LL |     assert::is_maybe_transmutable::<&'static A, &'static B>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: required by a bound in `is_maybe_transmutable`
-  --> $DIR/recursive-wrapper-types-bit-compatible.rs:11:14
-   |
-LL |       pub fn is_maybe_transmutable<Src, Dst>()
-   |              --------------------- required by a bound in this function
-LL |       where
-LL |           Dst: BikeshedIntrinsicFrom<Src, Context, {
-   |  ______________^
-LL | |             Assume {
-LL | |                 alignment: true,
-LL | |                 lifetimes: false,
-...  |
-LL | |             }
-LL | |         }>
-   | |__________^ required by this bound in `is_maybe_transmutable`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types.rs b/tests/ui/transmutability/references/recursive-wrapper-types.rs
index 59d1ad84a5d..090c1fea6db 100644
--- a/tests/ui/transmutability/references/recursive-wrapper-types.rs
+++ b/tests/ui/transmutability/references/recursive-wrapper-types.rs
@@ -1,5 +1,4 @@
-// check-fail
-// FIXME(bryangarza): Change to check-pass when coinduction is supported for BikeshedIntrinsicFrom
+// check-pass
 #![feature(transmutability)]
 
 mod assert {
@@ -22,6 +21,6 @@ mod assert {
 fn main() {
     #[repr(C)] struct A(&'static B);
     #[repr(C)] struct B(&'static A);
-    assert::is_maybe_transmutable::<&'static A, &'static B>(); //~ overflow evaluating the requirement
+    assert::is_maybe_transmutable::<&'static A, &'static B>();
     assert::is_maybe_transmutable::<&'static B, &'static A>();
 }
diff --git a/tests/ui/transmutability/references/recursive-wrapper-types.stderr b/tests/ui/transmutability/references/recursive-wrapper-types.stderr
deleted file mode 100644
index 35a60c22643..00000000000
--- a/tests/ui/transmutability/references/recursive-wrapper-types.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0275]: overflow evaluating the requirement `A: BikeshedIntrinsicFrom<B, assert::Context, Assume { alignment: true, lifetimes: false, safety: true, validity: false }>`
-  --> $DIR/recursive-wrapper-types.rs:25:5
-   |
-LL |     assert::is_maybe_transmutable::<&'static A, &'static B>();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: required by a bound in `is_maybe_transmutable`
-  --> $DIR/recursive-wrapper-types.rs:11:14
-   |
-LL |       pub fn is_maybe_transmutable<Src, Dst>()
-   |              --------------------- required by a bound in this function
-LL |       where
-LL |           Dst: BikeshedIntrinsicFrom<Src, Context, {
-   |  ______________^
-LL | |             Assume {
-LL | |                 alignment: true,
-LL | |                 lifetimes: false,
-...  |
-LL | |             }
-LL | |         }>
-   | |__________^ required by this bound in `is_maybe_transmutable`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/parser/type-alias-where-fixable.fixed b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.fixed
index 2f47c0d91fa..2f47c0d91fa 100644
--- a/tests/ui/parser/type-alias-where-fixable.fixed
+++ b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.fixed
diff --git a/tests/ui/parser/type-alias-where-fixable.rs b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.rs
index b20aa9398b5..b20aa9398b5 100644
--- a/tests/ui/parser/type-alias-where-fixable.rs
+++ b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.rs
diff --git a/tests/ui/parser/type-alias-where-fixable.stderr b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.stderr
index f0acb388b97..b4de051845f 100644
--- a/tests/ui/parser/type-alias-where-fixable.stderr
+++ b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-impl.stderr
@@ -1,5 +1,5 @@
 warning: where clause not allowed here
-  --> $DIR/type-alias-where-fixable.rs:13:16
+  --> $DIR/where-clause-placement-assoc-type-in-impl.rs:13:16
    |
 LL |     type Assoc where u32: Copy = ();
    |                ^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL +     type Assoc  = () where u32: Copy;
    |
 
 warning: where clause not allowed here
-  --> $DIR/type-alias-where-fixable.rs:16:17
+  --> $DIR/where-clause-placement-assoc-type-in-impl.rs:16:17
    |
 LL |     type Assoc2 where u32: Copy = () where i32: Copy;
    |                 ^^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL +     type Assoc2  = () where i32: Copy, u32: Copy;
    |
 
 warning: where clause not allowed here
-  --> $DIR/type-alias-where-fixable.rs:24:17
+  --> $DIR/where-clause-placement-assoc-type-in-impl.rs:24:17
    |
 LL |     type Assoc2 where u32: Copy, i32: Copy = ();
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.fixed b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.fixed
new file mode 100644
index 00000000000..d171eba50b7
--- /dev/null
+++ b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.fixed
@@ -0,0 +1,15 @@
+// check-pass
+// run-rustfix
+
+#![feature(associated_type_defaults)]
+
+trait Trait {
+    // Not fine, suggests moving.
+    type Assoc  = () where u32: Copy;
+    //~^ WARNING where clause not allowed here
+    // Not fine, suggests moving `u32: Copy`
+    type Assoc2  = () where i32: Copy, u32: Copy;
+    //~^ WARNING where clause not allowed here
+}
+
+fn main() {}
diff --git a/tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.rs b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.rs
new file mode 100644
index 00000000000..59afee65794
--- /dev/null
+++ b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.rs
@@ -0,0 +1,15 @@
+// check-pass
+// run-rustfix
+
+#![feature(associated_type_defaults)]
+
+trait Trait {
+    // Not fine, suggests moving.
+    type Assoc where u32: Copy = ();
+    //~^ WARNING where clause not allowed here
+    // Not fine, suggests moving `u32: Copy`
+    type Assoc2 where u32: Copy = () where i32: Copy;
+    //~^ WARNING where clause not allowed here
+}
+
+fn main() {}
diff --git a/tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.stderr b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.stderr
new file mode 100644
index 00000000000..a81cb8c8cd6
--- /dev/null
+++ b/tests/ui/where-clauses/where-clause-placement-assoc-type-in-trait.stderr
@@ -0,0 +1,29 @@
+warning: where clause not allowed here
+  --> $DIR/where-clause-placement-assoc-type-in-trait.rs:8:16
+   |
+LL |     type Assoc where u32: Copy = ();
+   |                ^^^^^^^^^^^^^^^
+   |
+   = note: see issue #89122 <https://github.com/rust-lang/rust/issues/89122> for more information
+   = note: `#[warn(deprecated_where_clause_location)]` on by default
+help: move it to the end of the type declaration
+   |
+LL -     type Assoc where u32: Copy = ();
+LL +     type Assoc  = () where u32: Copy;
+   |
+
+warning: where clause not allowed here
+  --> $DIR/where-clause-placement-assoc-type-in-trait.rs:11:17
+   |
+LL |     type Assoc2 where u32: Copy = () where i32: Copy;
+   |                 ^^^^^^^^^^^^^^^
+   |
+   = note: see issue #89122 <https://github.com/rust-lang/rust/issues/89122> for more information
+help: move it to the end of the type declaration
+   |
+LL -     type Assoc2 where u32: Copy = () where i32: Copy;
+LL +     type Assoc2  = () where i32: Copy, u32: Copy;
+   |
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/parser/type-alias-where.rs b/tests/ui/where-clauses/where-clause-placement-type-alias.rs
index 62e301cb408..62e301cb408 100644
--- a/tests/ui/parser/type-alias-where.rs
+++ b/tests/ui/where-clauses/where-clause-placement-type-alias.rs
diff --git a/tests/ui/parser/type-alias-where.stderr b/tests/ui/where-clauses/where-clause-placement-type-alias.stderr
index fb838179266..b3c155a48dd 100644
--- a/tests/ui/parser/type-alias-where.stderr
+++ b/tests/ui/where-clauses/where-clause-placement-type-alias.stderr
@@ -1,5 +1,5 @@
 error: where clauses are not allowed after the type for type aliases
-  --> $DIR/type-alias-where.rs:6:15
+  --> $DIR/where-clause-placement-type-alias.rs:6:15
    |
 LL | type Bar = () where u32: Copy;
    |               ^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | type Bar = () where u32: Copy;
    = note: see issue #89122 <https://github.com/rust-lang/rust/issues/89122> for more information
 
 error: where clauses are not allowed after the type for type aliases
-  --> $DIR/type-alias-where.rs:8:15
+  --> $DIR/where-clause-placement-type-alias.rs:8:15
    |
 LL | type Baz = () where;
    |               ^^^^^