summaryrefslogtreecommitdiffstats
path: root/tests/ui/structs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/structs-enums/rec-align-u64.rs4
-rw-r--r--tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs3
-rw-r--r--tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr23
-rw-r--r--tests/ui/structs/struct-base-wrong-type.stderr8
-rw-r--r--tests/ui/structs/struct-path-associated-type.rs4
-rw-r--r--tests/ui/structs/struct-path-associated-type.stderr4
-rw-r--r--tests/ui/structs/struct-path-self-type-mismatch.stderr2
-rw-r--r--tests/ui/structs/struct-record-suggestion.stderr2
-rw-r--r--tests/ui/structs/structure-constructor-type-mismatch.rs4
-rw-r--r--tests/ui/structs/structure-constructor-type-mismatch.stderr10
10 files changed, 27 insertions, 37 deletions
diff --git a/tests/ui/structs-enums/rec-align-u64.rs b/tests/ui/structs-enums/rec-align-u64.rs
index 40ede9705..f21c9b2c8 100644
--- a/tests/ui/structs-enums/rec-align-u64.rs
+++ b/tests/ui/structs-enums/rec-align-u64.rs
@@ -43,7 +43,9 @@ struct Outer {
target_os = "netbsd",
target_os = "openbsd",
target_os = "solaris",
- target_os = "vxworks"))]
+ target_os = "vxworks",
+ target_os = "nto",
+))]
mod m {
#[cfg(target_arch = "x86")]
pub mod m {
diff --git a/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs b/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs
index c30b8a1e1..b569993c6 100644
--- a/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs
+++ b/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs
@@ -7,6 +7,5 @@ fn main() {
let foo = Some(Foo::Other);
if let Some(Foo::Bar {_}) = foo {}
- //~^ ERROR expected identifier, found reserved identifier `_`
- //~| ERROR pattern does not mention field `bar` [E0027]
+ //~^ ERROR expected field pattern, found `_`
}
diff --git a/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr b/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr
index 16f751444..2f3a150e5 100644
--- a/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr
+++ b/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr
@@ -1,24 +1,13 @@
-error: expected identifier, found reserved identifier `_`
+error: expected field pattern, found `_`
--> $DIR/struct-enum-ignoring-field-with-underscore.rs:9:27
|
LL | if let Some(Foo::Bar {_}) = foo {}
- | ^ expected identifier, found reserved identifier
-
-error[E0027]: pattern does not mention field `bar`
- --> $DIR/struct-enum-ignoring-field-with-underscore.rs:9:17
- |
-LL | if let Some(Foo::Bar {_}) = foo {}
- | ^^^^^^^^^^^^ missing field `bar`
- |
-help: include the missing field in the pattern
+ | ^
|
-LL | if let Some(Foo::Bar {_, bar }) = foo {}
- | ~~~~~~~
-help: if you don't care about this missing field, you can explicitly ignore it
+help: to omit remaining fields, use `..`
|
-LL | if let Some(Foo::Bar {_, .. }) = foo {}
- | ~~~~~~
+LL | if let Some(Foo::Bar {..}) = foo {}
+ | ~~
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-For more information about this error, try `rustc --explain E0027`.
diff --git a/tests/ui/structs/struct-base-wrong-type.stderr b/tests/ui/structs/struct-base-wrong-type.stderr
index b039ce2cc..1299af72b 100644
--- a/tests/ui/structs/struct-base-wrong-type.stderr
+++ b/tests/ui/structs/struct-base-wrong-type.stderr
@@ -2,25 +2,25 @@ error[E0308]: mismatched types
--> $DIR/struct-base-wrong-type.rs:7:33
|
LL | static foo: Foo = Foo { a: 2, ..bar };
- | ^^^ expected struct `Foo`, found struct `Bar`
+ | ^^^ expected `Foo`, found `Bar`
error[E0308]: mismatched types
--> $DIR/struct-base-wrong-type.rs:8:35
|
LL | static foo_i: Foo = Foo { a: 2, ..4 };
- | ^ expected struct `Foo`, found integer
+ | ^ expected `Foo`, found integer
error[E0308]: mismatched types
--> $DIR/struct-base-wrong-type.rs:12:27
|
LL | let f = Foo { a: 2, ..b };
- | ^ expected struct `Foo`, found struct `Bar`
+ | ^ expected `Foo`, found `Bar`
error[E0308]: mismatched types
--> $DIR/struct-base-wrong-type.rs:13:34
|
LL | let f__isize = Foo { a: 2, ..4 };
- | ^ expected struct `Foo`, found integer
+ | ^ expected `Foo`, found integer
error: aborting due to 4 previous errors
diff --git a/tests/ui/structs/struct-path-associated-type.rs b/tests/ui/structs/struct-path-associated-type.rs
index 2dd7174a9..74d9705d4 100644
--- a/tests/ui/structs/struct-path-associated-type.rs
+++ b/tests/ui/structs/struct-path-associated-type.rs
@@ -13,7 +13,7 @@ fn f<T: Tr>() {
//~^ ERROR expected struct, variant or union type, found associated type
let z = T::A::<u8> {};
//~^ ERROR expected struct, variant or union type, found associated type
- //~| ERROR this associated type takes 0 generic arguments but 1 generic argument was supplied
+ //~| ERROR associated type takes 0 generic arguments but 1 generic argument was supplied
match S {
T::A {} => {}
//~^ ERROR expected struct, variant or union type, found associated type
@@ -22,7 +22,7 @@ fn f<T: Tr>() {
fn g<T: Tr<A = S>>() {
let s = T::A {}; // OK
- let z = T::A::<u8> {}; //~ ERROR this associated type takes 0 generic arguments but 1 generic argument was supplied
+ let z = T::A::<u8> {}; //~ ERROR associated type takes 0 generic arguments but 1 generic argument was supplied
match S {
T::A {} => {} // OK
}
diff --git a/tests/ui/structs/struct-path-associated-type.stderr b/tests/ui/structs/struct-path-associated-type.stderr
index ca5f0b7e2..acfddaf37 100644
--- a/tests/ui/structs/struct-path-associated-type.stderr
+++ b/tests/ui/structs/struct-path-associated-type.stderr
@@ -4,7 +4,7 @@ error[E0071]: expected struct, variant or union type, found associated type
LL | let s = T::A {};
| ^^^^ not a struct
-error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/struct-path-associated-type.rs:14:16
|
LL | let z = T::A::<u8> {};
@@ -30,7 +30,7 @@ error[E0071]: expected struct, variant or union type, found associated type
LL | T::A {} => {}
| ^^^^ not a struct
-error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/struct-path-associated-type.rs:25:16
|
LL | let z = T::A::<u8> {};
diff --git a/tests/ui/structs/struct-path-self-type-mismatch.stderr b/tests/ui/structs/struct-path-self-type-mismatch.stderr
index b55a2cbf7..cddc13561 100644
--- a/tests/ui/structs/struct-path-self-type-mismatch.stderr
+++ b/tests/ui/structs/struct-path-self-type-mismatch.stderr
@@ -34,7 +34,7 @@ LL | |
LL | | inner: u
LL | |
LL | | }
- | |_________^ expected type parameter `U`, found type parameter `T`
+ | |_________^ expected `Foo<U>`, found `Foo<T>`
|
= note: expected struct `Foo<U>`
found struct `Foo<T>`
diff --git a/tests/ui/structs/struct-record-suggestion.stderr b/tests/ui/structs/struct-record-suggestion.stderr
index 9b751d1b6..38274f8d9 100644
--- a/tests/ui/structs/struct-record-suggestion.stderr
+++ b/tests/ui/structs/struct-record-suggestion.stderr
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
--> $DIR/struct-record-suggestion.rs:23:20
|
LL | let q = B { b: 1..Default::default() };
- | ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found struct `Range`
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `Range<{integer}>`
|
= note: expected type `u32`
found struct `std::ops::Range<{integer}>`
diff --git a/tests/ui/structs/structure-constructor-type-mismatch.rs b/tests/ui/structs/structure-constructor-type-mismatch.rs
index a03ef590c..21cd9d08b 100644
--- a/tests/ui/structs/structure-constructor-type-mismatch.rs
+++ b/tests/ui/structs/structure-constructor-type-mismatch.rs
@@ -45,13 +45,13 @@ fn main() {
y: 8,
};
- let pt3 = PointF::<i32> { //~ ERROR this type alias takes 0 generic arguments but 1 generic argument
+ let pt3 = PointF::<i32> { //~ ERROR type alias takes 0 generic arguments but 1 generic argument
x: 9, //~ ERROR mismatched types
y: 10, //~ ERROR mismatched types
};
match (Point { x: 1, y: 2 }) {
- PointF::<u32> { .. } => {} //~ ERROR this type alias takes 0 generic arguments but 1 generic argument
+ PointF::<u32> { .. } => {} //~ ERROR type alias takes 0 generic arguments but 1 generic argument
//~^ ERROR mismatched types
}
diff --git a/tests/ui/structs/structure-constructor-type-mismatch.stderr b/tests/ui/structs/structure-constructor-type-mismatch.stderr
index 3d64fc601..63dda4593 100644
--- a/tests/ui/structs/structure-constructor-type-mismatch.stderr
+++ b/tests/ui/structs/structure-constructor-type-mismatch.stderr
@@ -52,7 +52,7 @@ LL | x: 7,
| expected `f32`, found integer
| help: use a float literal: `7.0`
-error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/structure-constructor-type-mismatch.rs:48:15
|
LL | let pt3 = PointF::<i32> {
@@ -84,7 +84,7 @@ LL | y: 10,
| expected `f32`, found integer
| help: use a float literal: `10.0`
-error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/structure-constructor-type-mismatch.rs:54:9
|
LL | PointF::<u32> { .. } => {}
@@ -104,7 +104,7 @@ error[E0308]: mismatched types
LL | match (Point { x: 1, y: 2 }) {
| ---------------------- this expression has type `Point<{integer}>`
LL | PointF::<u32> { .. } => {}
- | ^^^^^^^^^^^^^^^^^^^^ expected integer, found `f32`
+ | ^^^^^^^^^^^^^^^^^^^^ expected `Point<{integer}>`, found `Point<f32>`
|
= note: expected struct `Point<{integer}>`
found struct `Point<f32>`
@@ -115,7 +115,7 @@ error[E0308]: mismatched types
LL | match (Point { x: 1, y: 2 }) {
| ---------------------- this expression has type `Point<{integer}>`
LL | PointF { .. } => {}
- | ^^^^^^^^^^^^^ expected integer, found `f32`
+ | ^^^^^^^^^^^^^ expected `Point<{integer}>`, found `Point<f32>`
|
= note: expected struct `Point<{integer}>`
found struct `Point<f32>`
@@ -126,7 +126,7 @@ error[E0308]: mismatched types
LL | match (Pair { x: 1, y: 2 }) {
| --------------------- this expression has type `Pair<{integer}, {integer}>`
LL | PairF::<u32> { .. } => {}
- | ^^^^^^^^^^^^^^^^^^^ expected integer, found `f32`
+ | ^^^^^^^^^^^^^^^^^^^ expected `Pair<{integer}, {integer}>`, found `Pair<f32, u32>`
|
= note: expected struct `Pair<{integer}, {integer}>`
found struct `Pair<f32, u32>`