summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/trait_type.stderr
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 /tests/ui/impl-trait/trait_type.stderr
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 'tests/ui/impl-trait/trait_type.stderr')
-rw-r--r--tests/ui/impl-trait/trait_type.stderr40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/trait_type.stderr b/tests/ui/impl-trait/trait_type.stderr
new file mode 100644
index 000000000..81e4c933e
--- /dev/null
+++ b/tests/ui/impl-trait/trait_type.stderr
@@ -0,0 +1,40 @@
+error[E0053]: method `fmt` has an incompatible type for trait
+ --> $DIR/trait_type.rs:7:21
+ |
+LL | fn fmt(&self, x: &str) -> () { }
+ | ^^^^
+ | |
+ | types differ in mutability
+ | help: change the parameter type to match the trait: `&mut Formatter<'_>`
+ |
+ = note: expected signature `fn(&MyType, &mut Formatter<'_>) -> Result<(), std::fmt::Error>`
+ found signature `fn(&MyType, &str)`
+
+error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2
+ --> $DIR/trait_type.rs:12:11
+ |
+LL | fn fmt(&self) -> () { }
+ | ^^^^^ expected 2 parameters, found 1
+ |
+ = note: `fmt` from trait: `fn(&Self, &mut Formatter<'_>) -> Result<(), std::fmt::Error>`
+
+error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl
+ --> $DIR/trait_type.rs:17:4
+ |
+LL | fn fmt() -> () { }
+ | ^^^^^^^^^^^^^^ expected `&self` in impl
+ |
+ = note: `fmt` from trait: `fn(&Self, &mut Formatter<'_>) -> Result<(), std::fmt::Error>`
+
+error[E0046]: not all trait items implemented, missing: `fmt`
+ --> $DIR/trait_type.rs:21:1
+ |
+LL | impl std::fmt::Display for MyType4 {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
+ |
+ = help: implement the missing item: `fn fmt(&self, _: &mut Formatter<'_>) -> Result<(), std::fmt::Error> { todo!() }`
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0046, E0050, E0053, E0186.
+For more information about an error, try `rustc --explain E0046`.