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: ru/announcements/Rust-1.92.0.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,23 +16,23 @@ $ rustup update stable
16
16
17
17
## Что стабилизировано в 1.92.0
18
18
19
-
### Deny-by-default never type lints
19
+
### Запрещающая по умолчанию проверка типа never
20
20
21
-
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.
21
+
Команды по языку и компилятору продолжают работу над стабилизацией [типа never](https://doc.rust-lang.org/stable/std/primitive.never.html). В этом выпуске проверки[`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)и[`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)запрещены по умолчанию. Это означает, что при обнаружении они будут вызывать ошибку компиляции.
22
22
23
-
It's worth noting that while this can result in compilation errors, it is still a *lint;* these lints can all be `#[allow]`ed. These lints also will only fire when building the affected crates directly, not when they are built as dependencies (though a warning will be reported by Cargo in such cases).
23
+
Стоит отметить: несмотря на то, что это может привести к ошибкам компиляции, это всё ещё *проверка*. Её, как и другие проверки, можно разрешить с помощью `#[allow]`. Также не стоит забывать, что эти проверки срабатывают только при непосредственной сборке затронутых крейтов, а не когда они собираются как зависимости (хотя в таких случаях Cargo выдаст предупреждение).
24
24
25
25
Эти проверки обнаруживают код, который, вероятно, будет нарушен после стабилизации типа never. Настоятельно рекомендуется исправить их, если они обнаружены в вашем крейте.
26
26
27
-
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, see the [Language Team's assessment](https://github.com/rust-lang/rust/pull/146167#issuecomment-3363795006).
27
+
Мы полагаем, что эта проверка затрагивает примерно 500 крейтов. Мы считаем это приемлемым, поскольку проверки не являются критическим изменением, а в будущем это позволит стабилизировать тип never. Более подробное обоснование см. в оценке [Language Team](https://github.com/rust-lang/rust/pull/146167#issuecomment-3363795006).
28
28
29
29
### `unused_must_use` больше не предупреждает о `Result<(), UninhabitedType>`
30
30
31
-
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("...")`.
31
+
Проверка`unused_must_use`предупреждает об игнорировании возвращаемого значения функции, если сама функция или возвращаемый ею тип аннотированы атрибутом `#[must_use]`. Например, она предупреждает, если игнорируется возвращаемый тип `Result`, чтобы напомнить вам использовать `?` или, к примеру,`.expect("...")`.
32
32
33
-
However, some functions return`Result`, but the error type they use is not actually "inhabited", meaning you cannot construct any values of that type (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).
33
+
Однако некоторые функции возвращают`Result`, но используемый ими тип ошибки на самом деле не является inhabited. Это означает, что вы не можете создать никаких значений этого типа (например, типы[`!`](https://doc.rust-lang.org/std/primitive.never.html)или[`Infallible`](https://doc.rust-lang.org/std/convert/enum.Infallible.html).
34
34
35
-
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.
35
+
Проверка`unused_must_use`больше не выдаёт предупреждений для `Result<(), UninhabitedType>` или `ControlFlow<UninhabitedType, ()>`. Например, она не предупредит о `Result<(), Infillable>`. Это позволяет избежать необходимости проверять ошибку, которая никогда не может произойти.
36
36
37
37
```rust
38
38
usecore::convert::Infallible;
@@ -78,15 +78,15 @@ fn main() {
78
78
79
79
### Генерация таблицы раскрутки стека на Linux даже при включённом `-Cpanic=abort`
80
80
81
-
Backtraces with `-Cpanic=abort`previously worked in Rust 1.22 but were broken in Rust 1.23, as we stopped emitting unwind tables with `-Cpanic=abort`. In Rust 1.45 a workaround in the form of `-Cforce-unwind-tables=yes` was stabilized.
81
+
Ранее бэктрейсы с `-Cpanic=abort`работали в Rust 1.22, но были сломаны в Rust 1.23, когда мы прекратили генерировать таблицу раскрутки стека при `-Cpanic=abort`. В Rust 1.45 появился обходной путь в виде `-Cforce-unwind-tables=yes`.
82
82
83
-
In Rust 1.92 unwind tables will be emitted by default even when `-Cpanic=abort` is specified, allowing for backtraces to work properly. If unwind tables are not desired then users should use`-Cforce-unwind-tables=no` to explicitly disable them being emitted.
83
+
В Rust 1.92 таблицы раскрутки стека будут генерироваться по умолчанию, даже когда указан параметр `-Cpanic=abort`, что позволит бэктрейсам работать корректно. Если таблицы раскрутки стека не требуются, пользователям следует явно отключить их генерацию, используя`-Cforce-unwind-tables=no`.
84
84
85
85
### Валидация `#[macro_export]`
86
86
87
87
За последние несколько релизов было внесено множество изменений в то, как встроенные атрибуты обрабатываются в компиляторе. Это должно значительно улучшить сообщения об ошибках и предупреждениях, которые Rust выдаёт для встроенных атрибутов, и особенно сделать эту диагностику более согласованной среди более чем 100 встроенных атрибутов.
88
88
89
-
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).
89
+
В качестве небольшого примера: именно в этом релизе Rust стал строже проверять, какие аргументы разрешены для `macro_export`за счёт [повышения уровня этой проверки до запрещённого по умолчанию, который будет выдаваться в зависимостях](https://github.com/rust-lang/rust/pull/143857).
90
90
91
91
### Стабилизированные API
92
92
@@ -118,3 +118,5 @@ To give a small example, in this release specifically, Rust became stricter in c
118
118
## Кто работал над 1.92.0
119
119
120
120
Многие люди собрались вместе, чтобы создать Rust 1.92.0. Без вас мы бы не справились. [Спасибо!](https://thanks.rust-lang.org/rust/1.92.0/)
0 commit comments