about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-08-04 22:43:39 +0000
committerMichael Goulet <michael@errs.io>2022-08-04 22:43:39 +0000
commit5bb50ddc833f8fd298c48b9ddaa8570435919a88 (patch)
tree58b87db0ef1d62d08ecfba5138d5ae530ffebef4 /src/test
parent6f18f0a9d4548bc87afff1e4c0fe9081c35002c2 (diff)
downloadrust-5bb50ddc833f8fd298c48b9ddaa8570435919a88.tar.gz
rust-5bb50ddc833f8fd298c48b9ddaa8570435919a88.zip
opt node type
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/argument-suggestions/issue-100154.rs7
-rw-r--r--src/test/ui/argument-suggestions/issue-100154.stderr35
-rw-r--r--src/test/ui/transmutability/references.stderr4
3 files changed, 44 insertions, 2 deletions
diff --git a/src/test/ui/argument-suggestions/issue-100154.rs b/src/test/ui/argument-suggestions/issue-100154.rs
new file mode 100644
index 00000000000..4446b4bc2fc
--- /dev/null
+++ b/src/test/ui/argument-suggestions/issue-100154.rs
@@ -0,0 +1,7 @@
+fn foo(i: impl std::fmt::Display) {}
+
+fn main() {
+    foo::<()>(());
+    //~^ ERROR this function takes 0 generic arguments but 1 generic argument was supplied
+    //~| ERROR `()` doesn't implement `std::fmt::Display`
+}
diff --git a/src/test/ui/argument-suggestions/issue-100154.stderr b/src/test/ui/argument-suggestions/issue-100154.stderr
new file mode 100644
index 00000000000..1499229c3ce
--- /dev/null
+++ b/src/test/ui/argument-suggestions/issue-100154.stderr
@@ -0,0 +1,35 @@
+error[E0107]: this function takes 0 generic arguments but 1 generic argument was supplied
+  --> $DIR/issue-100154.rs:4:5
+   |
+LL |     foo::<()>(());
+   |     ^^^------ help: remove these generics
+   |     |
+   |     expected 0 generic arguments
+   |
+note: function defined here, with 0 generic parameters
+  --> $DIR/issue-100154.rs:1:4
+   |
+LL | fn foo(i: impl std::fmt::Display) {}
+   |    ^^^
+   = note: `impl Trait` cannot be explicitly specified as a generic argument
+
+error[E0277]: `()` doesn't implement `std::fmt::Display`
+  --> $DIR/issue-100154.rs:4:15
+   |
+LL |     foo::<()>(());
+   |     --------- ^^ `()` cannot be formatted with the default formatter
+   |     |
+   |     required by a bound introduced by this call
+   |
+   = help: the trait `std::fmt::Display` is not implemented for `()`
+   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+note: required by a bound in `foo`
+  --> $DIR/issue-100154.rs:1:16
+   |
+LL | fn foo(i: impl std::fmt::Display) {}
+   |                ^^^^^^^^^^^^^^^^^ required by this bound in `foo`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0107, E0277.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/transmutability/references.stderr b/src/test/ui/transmutability/references.stderr
index 17ffcf64177..b1359ea5865 100644
--- a/src/test/ui/transmutability/references.stderr
+++ b/src/test/ui/transmutability/references.stderr
@@ -1,8 +1,8 @@
 error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
-  --> $DIR/references.rs:19:52
+  --> $DIR/references.rs:19:37
    |
 LL |     assert::is_maybe_transmutable::<&'static Unit, &'static Unit>();
-   |                                                    ^^^^^^^^^^^^^ `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
+   |                                     ^^^^^^^^^^^^^ `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
    |
    = help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, true, true, true, true>` is not implemented for `&'static Unit`
 note: required by a bound in `is_maybe_transmutable`