Skip to content

Commit 73ca07b

Browse files
committed
w
1 parent ac57025 commit 73ca07b

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

content/Rust-1.92.0.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,29 @@ If you'd like to help us out by testing future releases, you might consider upda
2626

2727
The language and compiler teams continue to work on stabilization of the [never type](https://doc.rust-lang.org/stable/std/primitive.never.html). In this release the [`never_type_fallback_flowing_into_unsafe`](https://doc.rust-lang.org/beta/rustc/lints/listing/deny-by-default.html#dependency-on-unit-never-type-fallback) and [`dependency_on_unit_never_type_fallback`](https://doc.rust-lang.org/beta/rustc/lints/listing/deny-by-default.html#dependency-on-unit-never-type-fallback) future compatibility lints were made deny-by-default, meaning they will cause a compilation error when detected.
2828

29-
These lints detect code which is likely to be broken by the never type stabilization. It is highly advised to fix them if they are reported in your crate.
29+
It's worth noting that while this can result in compileration errors, it is still a *lint*, these lints can all be `#[allow`'d. These lints also will only fire when building the affected crates directly, not when built as a dependency (though a warning will be reported by Cargo in such cases).
30+
31+
These lints detect code which is likely to be broken by the never type stabilization. It is highly advised to fix them if they are reported in your crate graph.
32+
33+
We believe there to be approximately ~500 crates affected by this lint. Despite that we believe this to be acceptable as lints are not a breaking change and it will allow for stabilizing the never type in the future. For more in depth justification the Language Team's assessement can be read here: [rust-lang/rust#146167#issuecomment-3363795006](https://github.com/rust-lang/rust/pull/146167#issuecomment-3363795006).
3034

3135
### `unused_must_use` no longer warns about `Result<(), UninhabitedType>`
3236

3337
Rust's `unused_must_use` lint warns when ignoring the return value of a function, if the function or its return type is annotated with `#[must_use]`. For instance, this warns if ignoring a return type of `Result`, to remind you to use `?`, or something like `.expect("...")`.
3438

3539
However, some functions return `Result`, but the error type they use is not actually "inhabited", meaning it can never exist in real code (e.g. the [`!`](https://doc.rust-lang.org/std/primitive.never.html) or [`Infallible`](https://doc.rust-lang.org/std/convert/enum.Infallible.html) types).
3640

37-
The `unused_must_use` lint now no longer warns on `Result<(), UninhabitedType>`, or on `ControlFlow<UninhabitedType, ()>`. For instance, it will not warn on `Result<(), !>`. This avoids having to check for an error that can never happen.
41+
The `unused_must_use` lint now no longer warns on `Result<(), UninhabitedType>`, or on `ControlFlow<UninhabitedType, ()>`. For instance, it will not warn on `Result<(), Infallible>`. This avoids having to check for an error that can never happen.
3842

3943
```rust
40-
fn can_never_fail() -> Result<(), !> {
44+
use core::convert::Infallible;
45+
fn can_never_fail() -> Result<(), Infallible> {
4146
// ...
4247
Ok(())
4348
}
4449

4550
fn main() {
46-
can_never_fail()
51+
can_never_fail();
4752
}
4853
```
4954

@@ -57,7 +62,7 @@ trait UsesAssocErrorType {
5762

5863
struct CannotFail;
5964
impl UsesAssocErrorType for CannotFail {
60-
type Error = !;
65+
type Error = core::convert::Infallible;
6166
fn method(&self) -> Result<(), Self::Error> {
6267
Ok(())
6368
}
@@ -72,8 +77,8 @@ impl UsesAssocErrorType for CanFail {
7277
}
7378

7479
fn main() {
75-
CannotFail.method(); // No error
76-
CanFail.method(); // Error: unused `Result` that must be used
80+
CannotFail.method(); // No warning
81+
CanFail.method(); // Warning: unused `Result` that must be used
7782
}
7883
```
7984

@@ -85,14 +90,10 @@ In Rust 1.92 unwind tables will be emitted by default even when `-Cpanic=abort`
8590

8691
### Validate input to `#[macro_export]`
8792

88-
Over the past few releases, many changes were made to the way built-in attributes are processed in the compiler. This should greatly improve the error messages and warnings rust gives for built-in attributes and especially make these diagnostics more consistent among all of the over 100 built-in attributes.
93+
Over the past few releases, many changes were made to the way built-in attributes are processed in the compiler. This should greatly improve the error messages and warnings Rust gives for built-in attributes and especially make these diagnostics more consistent among all of the over 100 built-in attributes.
8994

9095
To give a small example, in this release specifically, Rust became stricter in checking what arguments are allowed to `macro_export` by [upgrading that check to a "deny-by-default lint" that will be reported in dependencies.](https://github.com/rust-lang/rust/pull/143857).
9196

92-
### Restrictions on user code impls of `DerefMut` for `Pin`
93-
94-
A soundness issue with `Pin` has been solved by preventing third-party crates from implementing `DerefMut` for `Pin<T>` when `T` is a local type that doesn't implement `DerefMut<Target: Unpin>`.
95-
9697
### Stabilized APIs
9798

9899
...
@@ -101,10 +102,6 @@ These previously stable APIs are now stable in const contexts:
101102

102103
...
103104

104-
### Platform Support
105-
106-
Refer to Rust’s [platform support page][platform-support] for more information on Rust’s tiered platform support.
107-
108105
### Other changes
109106

110107
Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.92.0), [Cargo](https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-192-2025-12-11), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-192).

0 commit comments

Comments
 (0)