From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/resolve/issue-73427.stderr | 156 +++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 src/test/ui/resolve/issue-73427.stderr (limited to 'src/test/ui/resolve/issue-73427.stderr') diff --git a/src/test/ui/resolve/issue-73427.stderr b/src/test/ui/resolve/issue-73427.stderr new file mode 100644 index 000000000..59bb98a34 --- /dev/null +++ b/src/test/ui/resolve/issue-73427.stderr @@ -0,0 +1,156 @@ +error[E0423]: expected value, found enum `A` + --> $DIR/issue-73427.rs:29:5 + | +LL | A.foo(); + | ^ + | +note: the enum is defined here + --> $DIR/issue-73427.rs:1:1 + | +LL | / enum A { +LL | | StructWithFields { x: () }, +LL | | TupleWithFields(()), +LL | | Struct {}, +LL | | Tuple(), +LL | | Unit, +LL | | } + | |_^ +help: you might have meant to use one of the following enum variants + | +LL | (A::Struct {}).foo(); + | ~~~~~~~~~~~~~~ +LL | (A::Tuple()).foo(); + | ~~~~~~~~~~~~ +LL | A::Unit.foo(); + | ~~~~~~~ +help: the following enum variants are available + | +LL | (A::StructWithFields { /* fields */ }).foo(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL | (A::TupleWithFields(/* fields */)).foo(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +error[E0423]: expected value, found enum `B` + --> $DIR/issue-73427.rs:31:5 + | +LL | B.foo(); + | ^ + | +note: the enum is defined here + --> $DIR/issue-73427.rs:9:1 + | +LL | / enum B { +LL | | StructWithFields { x: () }, +LL | | TupleWithFields(()), +LL | | } + | |_^ +help: the following enum variants are available + | +LL | (B::StructWithFields { /* fields */ }).foo(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL | (B::TupleWithFields(/* fields */)).foo(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +error[E0423]: expected value, found enum `C` + --> $DIR/issue-73427.rs:33:5 + | +LL | C.foo(); + | ^ + | +note: the enum is defined here + --> $DIR/issue-73427.rs:14:1 + | +LL | / enum C { +LL | | StructWithFields { x: () }, +LL | | TupleWithFields(()), +LL | | Unit, +LL | | } + | |_^ +help: you might have meant to use the following enum variant + | +LL | C::Unit.foo(); + | ~~~~~~~ +help: the following enum variants are available + | +LL | (C::StructWithFields { /* fields */ }).foo(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL | (C::TupleWithFields(/* fields */)).foo(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +error[E0423]: expected value, found enum `D` + --> $DIR/issue-73427.rs:35:5 + | +LL | D.foo(); + | ^ + | +note: the enum is defined here + --> $DIR/issue-73427.rs:20:1 + | +LL | / enum D { +LL | | TupleWithFields(()), +LL | | Unit, +LL | | } + | |_^ +help: you might have meant to use the following enum variant + | +LL | D::Unit.foo(); + | ~~~~~~~ +help: the following enum variant is available + | +LL | (D::TupleWithFields(/* fields */)).foo(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +error[E0423]: expected function, tuple struct or tuple variant, found enum `A` + --> $DIR/issue-73427.rs:40:13 + | +LL | let x = A(3); + | ^ + | + = help: you might have meant to construct one of the enum's non-tuple variants +note: the enum is defined here + --> $DIR/issue-73427.rs:1:1 + | +LL | / enum A { +LL | | StructWithFields { x: () }, +LL | | TupleWithFields(()), +LL | | Struct {}, +LL | | Tuple(), +LL | | Unit, +LL | | } + | |_^ +help: try to construct one of the enum's variants + | +LL | let x = A::Tuple(3); + | ~~~~~~~~ +LL | let x = A::TupleWithFields(3); + | ~~~~~~~~~~~~~~~~~~ + +error[E0532]: expected tuple struct or tuple variant, found enum `A` + --> $DIR/issue-73427.rs:42:12 + | +LL | if let A(3) = x { } + | ^ + | + = help: you might have meant to match against one of the enum's non-tuple variants +note: the enum is defined here + --> $DIR/issue-73427.rs:1:1 + | +LL | / enum A { +LL | | StructWithFields { x: () }, +LL | | TupleWithFields(()), +LL | | Struct {}, +LL | | Tuple(), +LL | | Unit, +LL | | } + | |_^ +help: try to match against one of the enum's variants + | +LL | if let A::Tuple(3) = x { } + | ~~~~~~~~ +LL | if let A::TupleWithFields(3) = x { } + | ~~~~~~~~~~~~~~~~~~ + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0423, E0532. +For more information about an error, try `rustc --explain E0423`. -- cgit v1.2.3