Update error message to clarify that it's not the enum itself that's non_exhaustive
This commit is contained in:
parent
a3b84ad197
commit
dfb3713cdb
2 changed files with 2 additions and 2 deletions
|
@ -601,7 +601,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
|
||||||
self.cast_ty,
|
self.cast_ty,
|
||||||
fcx,
|
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();
|
.emit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0606]: casting `FieldLessWithNonExhaustiveVariant` as `u8` is invalid
|
||||||
LL | let d = e as u8;
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue