Skip to content

Commit 049734b

Browse files
committed
Translate Rust-1.92.0.md via GitLocalize
1 parent b2d9efc commit 049734b

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

ru/announcements/Rust-1.92.0.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ $ rustup update stable
1616

1717
## Что стабилизировано в 1.92.0
1818

19-
### Deny-by-default never type lints
19+
### Запрещающая по умолчанию проверка типа never
2020

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) запрещены по умолчанию. Это означает, что при обнаружении они будут вызывать ошибку компиляции.
2222

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 выдаст предупреждение).
2424

2525
Эти проверки обнаруживают код, который, вероятно, будет нарушен после стабилизации типа never. Настоятельно рекомендуется исправить их, если они обнаружены в вашем крейте.
2626

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).
2828

2929
### `unused_must_use` больше не предупреждает о `Result<(), UninhabitedType>`
3030

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("...")`.
3232

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).
3434

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>`. Это позволяет избежать необходимости проверять ошибку, которая никогда не может произойти.
3636

3737
```rust
3838
use core::convert::Infallible;
@@ -78,15 +78,15 @@ fn main() {
7878

7979
### Генерация таблицы раскрутки стека на Linux даже при включённом `-Cpanic=abort`
8080

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`.
8282

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`.
8484

8585
### Валидация `#[macro_export]`
8686

8787
За последние несколько релизов было внесено множество изменений в то, как встроенные атрибуты обрабатываются в компиляторе. Это должно значительно улучшить сообщения об ошибках и предупреждениях, которые Rust выдаёт для встроенных атрибутов, и особенно сделать эту диагностику более согласованной среди более чем 100 встроенных атрибутов.
8888

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).
9090

9191
### Стабилизированные API
9292

@@ -118,3 +118,5 @@ To give a small example, in this release specifically, Rust became stricter in c
118118
## Кто работал над 1.92.0
119119

120120
Многие люди собрались вместе, чтобы создать Rust 1.92.0. Без вас мы бы не справились. [Спасибо!](https://thanks.rust-lang.org/rust/1.92.0/)
121+
122+

0 commit comments

Comments
 (0)