summaryrefslogtreecommitdiffstats
path: root/src/test/ui/structs/structure-constructor-type-mismatch.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/structs/structure-constructor-type-mismatch.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/structs/structure-constructor-type-mismatch.rs')
-rw-r--r--src/test/ui/structs/structure-constructor-type-mismatch.rs73
1 files changed, 0 insertions, 73 deletions
diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.rs b/src/test/ui/structs/structure-constructor-type-mismatch.rs
deleted file mode 100644
index a03ef590c..000000000
--- a/src/test/ui/structs/structure-constructor-type-mismatch.rs
+++ /dev/null
@@ -1,73 +0,0 @@
-struct Point<T> {
- x: T,
- y: T,
-}
-
-type PointF = Point<f32>;
-
-struct Pair<T,U> {
- x: T,
- y: U,
-}
-
-type PairF<U> = Pair<f32,U>;
-
-fn main() {
- let pt = PointF {
- x: 1,
- //~^ ERROR mismatched types
- //~| expected `f32`, found integer
- y: 2,
- //~^ ERROR mismatched types
- //~| expected `f32`, found integer
- };
-
- let pt2 = Point::<f32> {
- x: 3,
- //~^ ERROR mismatched types
- //~| expected `f32`, found integer
- y: 4,
- //~^ ERROR mismatched types
- //~| expected `f32`, found integer
- };
-
- let pair = PairF {
- x: 5,
- //~^ ERROR mismatched types
- //~| expected `f32`, found integer
- y: 6,
- };
-
- let pair2 = PairF::<i32> {
- x: 7,
- //~^ ERROR mismatched types
- //~| expected `f32`, found integer
- y: 8,
- };
-
- let pt3 = PointF::<i32> { //~ ERROR this 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
- //~^ ERROR mismatched types
- }
-
- match (Point { x: 1, y: 2 }) {
- PointF { .. } => {} //~ ERROR mismatched types
- }
-
- match (Point { x: 1.0, y: 2.0 }) {
- PointF { .. } => {} // ok
- }
-
- match (Pair { x: 1, y: 2 }) {
- PairF::<u32> { .. } => {} //~ ERROR mismatched types
- }
-
- match (Pair { x: 1.0, y: 2 }) {
- PairF::<u32> { .. } => {} // ok
- }
-}