Skip to content

R raymond/fix/issue 107165 #125716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(issue-107165): Bless other ui files
  • Loading branch information
r-raymond committed May 29, 2024
commit d89eb11b6dea54d567474243043616166f591e15
10 changes: 10 additions & 0 deletions tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ LL | #[non_exhaustive]
| ----------------- cannot be constructed because it is `#[non_exhaustive]`
LL | pub struct TupleStruct(pub u16, pub u16);
| ^^^^^^^^^^^^^^^^^^^^^^
help: consider using a struct pattern instead: `TupleStruct { .. }`
--> $DIR/struct.rs:23:32
|
LL | let ts_explicit = structs::TupleStruct(640, 480);
| ^^^^^^^^^^^

error[E0603]: unit struct `UnitStruct` is private
--> $DIR/struct.rs:32:32
Expand All @@ -31,6 +36,11 @@ LL | #[non_exhaustive]
| ----------------- cannot be constructed because it is `#[non_exhaustive]`
LL | pub struct UnitStruct;
| ^^^^^^^^^^^^^^^^^^^^^
help: consider using a struct pattern instead: `UnitStruct { .. }`
--> $DIR/struct.rs:32:32
|
LL | let us_explicit = structs::UnitStruct;
| ^^^^^^^^^^

error[E0639]: cannot create non-exhaustive struct using struct expression
--> $DIR/struct.rs:7:14
Expand Down
25 changes: 25 additions & 0 deletions tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ LL | #[non_exhaustive] Tuple(u32),
| ----------------- ^^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
help: consider using a struct pattern instead: `Tuple { .. }`
--> $DIR/variant.rs:11:48
|
LL | let variant_tuple = NonExhaustiveVariants::Tuple(640);
| ^^^^^

error[E0603]: unit variant `Unit` is private
--> $DIR/variant.rs:14:47
Expand All @@ -25,6 +30,11 @@ LL | #[non_exhaustive] Unit,
| ----------------- ^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
help: consider using a struct pattern instead: `Unit { .. }`
--> $DIR/variant.rs:14:47
|
LL | let variant_unit = NonExhaustiveVariants::Unit;
| ^^^^

error[E0603]: unit variant `Unit` is private
--> $DIR/variant.rs:18:32
Expand All @@ -39,6 +49,11 @@ LL | #[non_exhaustive] Unit,
| ----------------- ^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
help: consider using a struct pattern instead: `Unit { .. }`
--> $DIR/variant.rs:18:32
|
LL | NonExhaustiveVariants::Unit => "",
| ^^^^

error[E0603]: tuple variant `Tuple` is private
--> $DIR/variant.rs:20:32
Expand All @@ -53,6 +68,11 @@ LL | #[non_exhaustive] Tuple(u32),
| ----------------- ^^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
help: consider using a struct pattern instead: `Tuple { .. }`
--> $DIR/variant.rs:20:32
|
LL | NonExhaustiveVariants::Tuple(fe_tpl) => "",
| ^^^^^

error[E0603]: tuple variant `Tuple` is private
--> $DIR/variant.rs:26:35
Expand All @@ -67,6 +87,11 @@ LL | #[non_exhaustive] Tuple(u32),
| ----------------- ^^^^^
| |
| cannot be constructed because it is `#[non_exhaustive]`
help: consider using a struct pattern instead: `Tuple { .. }`
--> $DIR/variant.rs:26:35
|
LL | if let NonExhaustiveVariants::Tuple(fe_tpl) = variant_struct {
| ^^^^^

error[E0639]: cannot create non-exhaustive variant using struct expression
--> $DIR/variant.rs:8:26
Expand Down