Skip to content

Commit

Permalink
Update error message to clarify that it's not the enum itself that's …
Browse files Browse the repository at this point in the history
…non_exhaustive
  • Loading branch information
scottmcm committed Aug 10, 2022
1 parent a3b84ad commit dfb3713
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
self.cast_ty,
fcx,
)
.note("cannot cast a non-exhaustive enum defined in another crate")
.note("cannot cast an enum with a non-exhaustive variant when it's defined in another crate")
.emit();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0606]: casting `FieldLessWithNonExhaustiveVariant` as `u8` is invalid
LL | let d = e as u8;
| ^^^^^^^
|
= note: cannot cast a non-exhaustive enum defined in another crate
= note: cannot cast an enum with a non-exhaustive variant when it's defined in another crate

error: aborting due to previous error

Expand Down

0 comments on commit dfb3713

Please sign in to comment.