diff options
| author | Michael Goulet <michael@errs.io> | 2022-12-12 19:23:20 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-12-14 18:39:39 +0000 |
| commit | cfa6a93a36d3cbb8e392f5d820e9e139f66c8a5a (patch) | |
| tree | ca7b3dd4fa61dfe2facb2e23261563b0a2f90e8d /src/test/ui | |
| parent | ba64ba8b0dfd57f7d6d7399d0df7ded37d2af18d (diff) | |
| download | rust-cfa6a93a36d3cbb8e392f5d820e9e139f66c8a5a.tar.gz rust-cfa6a93a36d3cbb8e392f5d820e9e139f66c8a5a.zip | |
Auto traits in dyn are suggestable
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/argument-suggestions/display-is-suggestable.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/argument-suggestions/display-is-suggestable.stderr | 19 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/test/ui/argument-suggestions/display-is-suggestable.rs b/src/test/ui/argument-suggestions/display-is-suggestable.rs new file mode 100644 index 00000000000..d765bc4f74d --- /dev/null +++ b/src/test/ui/argument-suggestions/display-is-suggestable.rs @@ -0,0 +1,8 @@ +use std::fmt::Display; + +fn foo(x: &(dyn Display + Send)) {} + +fn main() { + foo(); + //~^ ERROR this function takes 1 argument but 0 arguments were supplied +} diff --git a/src/test/ui/argument-suggestions/display-is-suggestable.stderr b/src/test/ui/argument-suggestions/display-is-suggestable.stderr new file mode 100644 index 00000000000..edd72b53eb3 --- /dev/null +++ b/src/test/ui/argument-suggestions/display-is-suggestable.stderr @@ -0,0 +1,19 @@ +error[E0061]: this function takes 1 argument but 0 arguments were supplied + --> $DIR/display-is-suggestable.rs:6:5 + | +LL | foo(); + | ^^^-- an argument of type `&dyn std::fmt::Display + Send` is missing + | +note: function defined here + --> $DIR/display-is-suggestable.rs:3:4 + | +LL | fn foo(x: &(dyn Display + Send)) {} + | ^^^ ------------------------ +help: provide the argument + | +LL | foo(/* &dyn std::fmt::Display + Send */); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0061`. |
