Skip to content

Commit

Permalink
Merge PR #311
Browse files Browse the repository at this point in the history
  • Loading branch information
traviscross committed Jul 12, 2024
2 parents 941db8b + 4922b24 commit 5b63843
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/rust-2024/never-type-fallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
## Summary

- Never type (`!`) to any type ("never-to-any") coercions fall back to never type (`!`) rather than to unit type (`()`).
- The [`never_type_fallback_flowing_into_unsafe`] lint is now `deny` by default.

[`never_type_fallback_flowing_into_unsafe`]: ../../rustc/lints/listing/warn-by-default.html#never-type-fallback-flowing-into-unsafe

## Details

Expand Down Expand Up @@ -54,6 +57,10 @@ In some cases your code might depend on the fallback type being `()`, so this ca

[coercion site]: ../../reference/type-coercions.html#coercion-sites

### `never_type_fallback_flowing_into_unsafe`

The default level of the [`never_type_fallback_flowing_into_unsafe`] lint has been raised from `warn` to `deny` in the 2024 Edition. This lint helps detect a particular interaction with the fallback to `!` and `unsafe` code which may lead to undefined behavior. See the link for a complete description.

## Migration

There is no automatic fix, but there is automatic detection of code that will be broken by the edition change. While still on a previous edition you will see warnings if your code will be broken.
Expand Down

0 comments on commit 5b63843

Please sign in to comment.