diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
commit | a0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch) | |
tree | fc451898ccaf445814e26b46664d78702178101d /tests/ui/argument-suggestions | |
parent | Adding debian version 1.71.1+dfsg1-2. (diff) | |
download | rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/argument-suggestions')
-rw-r--r-- | tests/ui/argument-suggestions/issue-112507.rs | 12 | ||||
-rw-r--r-- | tests/ui/argument-suggestions/issue-112507.stderr | 27 |
2 files changed, 39 insertions, 0 deletions
diff --git a/tests/ui/argument-suggestions/issue-112507.rs b/tests/ui/argument-suggestions/issue-112507.rs new file mode 100644 index 000000000..61743c59a --- /dev/null +++ b/tests/ui/argument-suggestions/issue-112507.rs @@ -0,0 +1,12 @@ +pub enum Value { + Float(Option<f64>), +} + +fn main() { + let _a = Value::Float( //~ ERROR this enum variant takes 1 argument but 4 arguments were supplied + 0, + None, + None, + 0, + ); +} diff --git a/tests/ui/argument-suggestions/issue-112507.stderr b/tests/ui/argument-suggestions/issue-112507.stderr new file mode 100644 index 000000000..dfb47e010 --- /dev/null +++ b/tests/ui/argument-suggestions/issue-112507.stderr @@ -0,0 +1,27 @@ +error[E0061]: this enum variant takes 1 argument but 4 arguments were supplied + --> $DIR/issue-112507.rs:6:14 + | +LL | let _a = Value::Float( + | ^^^^^^^^^^^^ +LL | 0, + | - unexpected argument of type `{integer}` +LL | None, +LL | None, + | ---- unexpected argument of type `Option<_>` +LL | 0, + | - unexpected argument of type `{integer}` + | +note: tuple variant defined here + --> $DIR/issue-112507.rs:2:5 + | +LL | Float(Option<f64>), + | ^^^^^ +help: remove the extra arguments + | +LL ~ , +LL ~ None); + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0061`. |