You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/Rust-1.92.0.md
+13-16Lines changed: 13 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,24 +26,29 @@ If you'd like to help us out by testing future releases, you might consider upda
26
26
27
27
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.
28
28
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).
30
34
31
35
### `unused_must_use` no longer warns about `Result<(), UninhabitedType>`
32
36
33
37
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("...")`.
34
38
35
39
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).
36
40
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.
38
42
39
43
```rust
40
-
fncan_never_fail() ->Result<(), !> {
44
+
usecore::convert::Infallible;
45
+
fncan_never_fail() ->Result<(), Infallible> {
41
46
// ...
42
47
Ok(())
43
48
}
44
49
45
50
fnmain() {
46
-
can_never_fail()
51
+
can_never_fail();
47
52
}
48
53
```
49
54
@@ -57,7 +62,7 @@ trait UsesAssocErrorType {
57
62
58
63
structCannotFail;
59
64
implUsesAssocErrorTypeforCannotFail {
60
-
typeError=!;
65
+
typeError=core::convert::Infallible;
61
66
fnmethod(&self) ->Result<(), Self::Error> {
62
67
Ok(())
63
68
}
@@ -72,8 +77,8 @@ impl UsesAssocErrorType for CanFail {
72
77
}
73
78
74
79
fnmain() {
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
77
82
}
78
83
```
79
84
@@ -85,14 +90,10 @@ In Rust 1.92 unwind tables will be emitted by default even when `-Cpanic=abort`
85
90
86
91
### Validate input to `#[macro_export]`
87
92
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.
89
94
90
95
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).
91
96
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
-
96
97
### Stabilized APIs
97
98
98
99
...
@@ -101,10 +102,6 @@ These previously stable APIs are now stable in const contexts:
101
102
102
103
...
103
104
104
-
### Platform Support
105
-
106
-
Refer to Rust’s [platform support page][platform-support] for more information on Rust’s tiered platform support.
107
-
108
105
### Other changes
109
106
110
107
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