old testcase output

This commit is contained in:
Mu001999 2025-08-16 15:01:17 +08:00
parent 3507a749b3
commit 57feb7fc01
3 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,13 @@
//@ run-rustfix
use std::fmt::Display;
struct S;
impl S {
fn call(&self, _: impl Display) {}
}
fn main() {
S.call(|| "hello"()); //~ ERROR [E0277]
}

View file

@ -0,0 +1,13 @@
//@ run-rustfix
use std::fmt::Display;
struct S;
impl S {
fn call(&self, _: impl Display) {}
}
fn main() {
S.call(|| "hello"); //~ ERROR [E0277]
}

View file

@ -0,0 +1,22 @@
error[E0277]: `{closure@$DIR/use-parentheses-to-call-closure-issue-145404.rs:12:12: 12:14}` doesn't implement `std::fmt::Display`
--> $DIR/use-parentheses-to-call-closure-issue-145404.rs:12:12
|
LL | S.call(|| "hello");
| ---- ^^^^^^^^^^ unsatisfied trait bound
| |
| required by a bound introduced by this call
|
= help: the trait `std::fmt::Display` is not implemented for closure `{closure@$DIR/use-parentheses-to-call-closure-issue-145404.rs:12:12: 12:14}`
note: required by a bound in `S::call`
--> $DIR/use-parentheses-to-call-closure-issue-145404.rs:8:28
|
LL | fn call(&self, _: impl Display) {}
| ^^^^^^^ required by this bound in `S::call`
help: use parentheses to call this closure
|
LL | S.call(|| "hello"());
| ++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.