From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../structs/struct-path-self-type-mismatch.stderr | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/ui/structs/struct-path-self-type-mismatch.stderr (limited to 'tests/ui/structs/struct-path-self-type-mismatch.stderr') diff --git a/tests/ui/structs/struct-path-self-type-mismatch.stderr b/tests/ui/structs/struct-path-self-type-mismatch.stderr new file mode 100644 index 000000000..b55a2cbf7 --- /dev/null +++ b/tests/ui/structs/struct-path-self-type-mismatch.stderr @@ -0,0 +1,46 @@ +error[E0308]: mismatched types + --> $DIR/struct-path-self-type-mismatch.rs:7:23 + | +LL | Self { inner: 1.5f32 }; + | ^^^^^^ expected `i32`, found `f32` + +error[E0308]: mismatched types + --> $DIR/struct-path-self-type-mismatch.rs:15:20 + | +LL | impl Foo { + | - expected type parameter +LL | fn new(u: U) -> Foo { + | - found type parameter +... +LL | inner: u + | ^ expected type parameter `T`, found type parameter `U` + | + = note: expected type parameter `T` + found type parameter `U` + = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters + +error[E0308]: mismatched types + --> $DIR/struct-path-self-type-mismatch.rs:13:9 + | +LL | impl Foo { + | - found type parameter +LL | fn new(u: U) -> Foo { + | - ------ expected `Foo` because of return type + | | + | expected type parameter +LL | / Self { +LL | | +LL | | inner: u +LL | | +LL | | } + | |_________^ expected type parameter `U`, found type parameter `T` + | + = note: expected struct `Foo` + found struct `Foo` + = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound + = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. -- cgit v1.2.3