summaryrefslogtreecommitdiffstats
path: root/tests/ui/coercion
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/coercion')
-rw-r--r--tests/ui/coercion/coerce-block-tail-26978.stderr2
-rw-r--r--tests/ui/coercion/coerce-block-tail-57749.stderr2
-rw-r--r--tests/ui/coercion/coerce-block-tail-83783.stderr2
-rw-r--r--tests/ui/coercion/coerce-block-tail-83850.stderr2
-rw-r--r--tests/ui/coercion/coerce-block-tail.stderr2
-rw-r--r--tests/ui/coercion/coerce-expect-unsized-ascribed.stderr28
-rw-r--r--tests/ui/coercion/coerce-overloaded-autoderef-fail.stderr4
-rw-r--r--tests/ui/coercion/coerce-to-bang.stderr2
-rw-r--r--tests/ui/coercion/coercion-missing-tail-expected-type.stderr2
-rw-r--r--tests/ui/coercion/coercion-slice.rs2
-rw-r--r--tests/ui/coercion/coercion-slice.stderr2
11 files changed, 25 insertions, 25 deletions
diff --git a/tests/ui/coercion/coerce-block-tail-26978.stderr b/tests/ui/coercion/coerce-block-tail-26978.stderr
index 384debd48..90eb75f2b 100644
--- a/tests/ui/coercion/coerce-block-tail-26978.stderr
+++ b/tests/ui/coercion/coerce-block-tail-26978.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-block-tail-26978.rs:9:9
|
LL | f(&{x});
- | ^ expected `i32`, found struct `Box`
+ | ^ expected `i32`, found `Box<i32>`
|
= note: expected type `i32`
found struct `Box<i32>`
diff --git a/tests/ui/coercion/coerce-block-tail-57749.stderr b/tests/ui/coercion/coerce-block-tail-57749.stderr
index d5660c81d..7e14f42ea 100644
--- a/tests/ui/coercion/coerce-block-tail-57749.stderr
+++ b/tests/ui/coercion/coerce-block-tail-57749.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-block-tail-57749.rs:33:14
|
LL | reset(&{ Homura });
- | ^^^^^^ expected `u32`, found struct `Homura`
+ | ^^^^^^ expected `u32`, found `Homura`
|
help: consider dereferencing the type
|
diff --git a/tests/ui/coercion/coerce-block-tail-83783.stderr b/tests/ui/coercion/coerce-block-tail-83783.stderr
index 5f53606ce..d556d013b 100644
--- a/tests/ui/coercion/coerce-block-tail-83783.stderr
+++ b/tests/ui/coercion/coerce-block-tail-83783.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-block-tail-83783.rs:7:32
|
LL | _consume_reference::<i32>(&async { Box::new(7_i32) }.await);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `Box`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `Box<i32>`
|
= note: expected type `i32`
found struct `Box<i32>`
diff --git a/tests/ui/coercion/coerce-block-tail-83850.stderr b/tests/ui/coercion/coerce-block-tail-83850.stderr
index bbf607543..3cfebb8a5 100644
--- a/tests/ui/coercion/coerce-block-tail-83850.stderr
+++ b/tests/ui/coercion/coerce-block-tail-83850.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-block-tail-83850.rs:5:7
|
LL | f(&Box::new([1, 2]));
- | - ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found struct `Box`
+ | - ^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&Box<[{integer}; 2]>`
| |
| arguments to this function are incorrect
|
diff --git a/tests/ui/coercion/coerce-block-tail.stderr b/tests/ui/coercion/coerce-block-tail.stderr
index 318cf7586..7044fc3ce 100644
--- a/tests/ui/coercion/coerce-block-tail.stderr
+++ b/tests/ui/coercion/coerce-block-tail.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-block-tail.rs:4:23
|
LL | let _: &i32 = & { Box::new(1i32) };
- | ^^^^^^^^^^^^^^ expected `i32`, found struct `Box`
+ | ^^^^^^^^^^^^^^ expected `i32`, found `Box<i32>`
|
= note: expected type `i32`
found struct `Box<i32>`
diff --git a/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr b/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr
index 44968244c..f94422a92 100644
--- a/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr
+++ b/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:9:27
|
LL | let _ = type_ascribe!(box { [1, 2, 3] }, Box<[i32]>);
- | ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+ | ^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:10:27
|
LL | let _ = type_ascribe!(box if true { [1, 2, 3] } else { [1, 3, 4] }, Box<[i32]>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:11:27
|
LL | let _ = type_ascribe!(box match true { true => [1, 2, 3], false => [1, 3, 4] }, Box<[i32]>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
@@ -29,7 +29,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:13:27
|
LL | let _ = type_ascribe!(box { |x| (x as u8) }, Box<dyn Fn(i32) -> _>);
- | ^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:13:33]>`
|
= note: expected struct `Box<dyn Fn(i32) -> u8>`
found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:33: 13:36]>`
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:14:27
|
LL | let _ = type_ascribe!(box if true { false } else { true }, Box<dyn Debug>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<bool>`
|
= note: expected struct `Box<dyn Debug>`
found struct `Box<bool>`
@@ -47,7 +47,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:15:27
|
LL | let _ = type_ascribe!(box match true { true => 'a', false => 'b' }, Box<dyn Debug>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<char>`
|
= note: expected struct `Box<dyn Debug>`
found struct `Box<char>`
@@ -56,7 +56,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:17:27
|
LL | let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]);
- | ^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+ | ^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
|
= note: expected reference `&[i32]`
found reference `&[i32; 3]`
@@ -65,7 +65,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:18:27
|
LL | let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
|
= note: expected reference `&[i32]`
found reference `&[i32; 3]`
@@ -74,7 +74,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:19:27
|
LL | let _ = type_ascribe!(&match true { true => [1, 2, 3], false => [1, 3, 4] }, &[i32]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
|
= note: expected reference `&[i32]`
found reference `&[i32; 3]`
@@ -83,7 +83,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:21:27
|
LL | let _ = type_ascribe!(&{ |x| (x as u8) }, &dyn Fn(i32) -> _);
- | ^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
+ | ^^^^^^^^^^^^^^^^^^ expected `&dyn Fn(i32) -> u8`, found `&[closure@coerce-expect-unsized-ascribed.rs:21:30]`
|
= note: expected reference `&dyn Fn(i32) -> u8`
found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:30: 21:33]`
@@ -92,7 +92,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:22:27
|
LL | let _ = type_ascribe!(&if true { false } else { true }, &dyn Debug);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&bool`
|
= note: expected reference `&dyn Debug`
found reference `&bool`
@@ -101,7 +101,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:23:27
|
LL | let _ = type_ascribe!(&match true { true => 'a', false => 'b' }, &dyn Debug);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&char`
|
= note: expected reference `&dyn Debug`
found reference `&char`
@@ -110,7 +110,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:25:27
|
LL | let _ = type_ascribe!(Box::new([1, 2, 3]), Box<[i32]>);
- | ^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+ | ^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
@@ -119,7 +119,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:26:27
|
LL | let _ = type_ascribe!(Box::new(|x| (x as u8)), Box<dyn Fn(i32) -> _>);
- | ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:26:36]>`
|
= note: expected struct `Box<dyn Fn(i32) -> u8>`
found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:36: 26:39]>`
diff --git a/tests/ui/coercion/coerce-overloaded-autoderef-fail.stderr b/tests/ui/coercion/coerce-overloaded-autoderef-fail.stderr
index d067c3b3a..d412b8b08 100644
--- a/tests/ui/coercion/coerce-overloaded-autoderef-fail.stderr
+++ b/tests/ui/coercion/coerce-overloaded-autoderef-fail.stderr
@@ -13,10 +13,10 @@ error[E0506]: cannot assign to `**x` because it is borrowed
--> $DIR/coerce-overloaded-autoderef-fail.rs:17:5
|
LL | let y = borrow(x);
- | - borrow of `**x` occurs here
+ | - `**x` is borrowed here
LL | let z = borrow(x);
LL | **x += 1;
- | ^^^^^^^^ assignment to borrowed `**x` occurs here
+ | ^^^^^^^^ `**x` is assigned to here but it was already borrowed
LL |
LL | drop((y, z));
| - borrow later used here
diff --git a/tests/ui/coercion/coerce-to-bang.stderr b/tests/ui/coercion/coerce-to-bang.stderr
index 1207dc7e7..3c737358a 100644
--- a/tests/ui/coercion/coerce-to-bang.stderr
+++ b/tests/ui/coercion/coerce-to-bang.stderr
@@ -82,7 +82,7 @@ error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:50:21
|
LL | let x: [!; 2] = [return, 22];
- | ------ ^^^^^^^^^^^^ expected `!`, found integer
+ | ------ ^^^^^^^^^^^^ expected `[!; 2]`, found `[{integer}; 2]`
| |
| expected due to this
|
diff --git a/tests/ui/coercion/coercion-missing-tail-expected-type.stderr b/tests/ui/coercion/coercion-missing-tail-expected-type.stderr
index 4c04bb113..288e945f1 100644
--- a/tests/ui/coercion/coercion-missing-tail-expected-type.stderr
+++ b/tests/ui/coercion/coercion-missing-tail-expected-type.stderr
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
--> $DIR/coercion-missing-tail-expected-type.rs:8:13
|
LL | fn foo() -> Result<u8, u64> {
- | --- ^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
+ | --- ^^^^^^^^^^^^^^^ expected `Result<u8, u64>`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
LL | Ok(1);
diff --git a/tests/ui/coercion/coercion-slice.rs b/tests/ui/coercion/coercion-slice.rs
index b756c8f82..b99235dd3 100644
--- a/tests/ui/coercion/coercion-slice.rs
+++ b/tests/ui/coercion/coercion-slice.rs
@@ -3,5 +3,5 @@
fn main() {
let _: &[i32] = [0];
//~^ ERROR mismatched types
- //~| expected `&[i32]`, found array `[{integer}; 1]`
+ //~| expected `&[i32]`, found `[{integer}; 1]`
}
diff --git a/tests/ui/coercion/coercion-slice.stderr b/tests/ui/coercion/coercion-slice.stderr
index 42dc954ff..c7b856a57 100644
--- a/tests/ui/coercion/coercion-slice.stderr
+++ b/tests/ui/coercion/coercion-slice.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | let _: &[i32] = [0];
| ------ ^^^
| | |
- | | expected `&[i32]`, found array `[{integer}; 1]`
+ | | expected `&[i32]`, found `[{integer}; 1]`
| | help: consider borrowing here: `&[0]`
| expected due to this