-
Notifications
You must be signed in to change notification settings - Fork 8
Rust-1.91.0.md #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Rust-1.91.0.md #150
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| Rust 1.91.0: aarch64-pc-windows-msvc на Tier 1, отлавливание сырых указателей | ||
|
|
||
| [extra] release = true +++ | ||
|
|
||
| Команда Rust рада сообщить о новой версии языка — 1.91.0. Rust — это язык программирования, позволяющий каждому создавать надёжное и эффективное программное обеспечение. | ||
|
|
||
| Если у вас есть предыдущая версия Rust, установленная через `rustup`, то для обновления до версии 1.91.0 вам достаточно выполнить команду: | ||
|
|
||
| ```console | ||
| $ rustup update stable | ||
| ``` | ||
|
|
||
| Если у вас ещё не установлен `rustup`, вы можете установить его с [соответствующей страницы](https://www.rust-lang.org/install.html) нашего веб-сайта, а также посмотреть [подробные примечания к выпуску](https://doc.rust-lang.org/stable/releases.html#version-1910-2025-10-30) на GitHub. | ||
|
|
||
| Если вы хотите помочь нам протестировать будущие выпуски, вы можете использовать канал beta (`rustup default beta`) или nightly (`rustup default nightly`). Пожалуйста, [сообщайте](https://github.com/rust-lang/rust/issues/new/choose) обо всех встреченных вами ошибках. | ||
|
|
||
| ## Что стабилизировано в 1.91.0 | ||
|
|
||
| ### `aarch64-pc-windows-msvc` теперь на 1-м уровне поддержки | ||
|
|
||
| Компилятор Rust поддерживает [широкий спектр целевых платформ], но наша команда не может обеспечить одинаковый уровень поддержки для каждой из них. Чтобы чётко обозначить, насколько поддерживается каждая платформа, мы используем уровни поддержки: | ||
|
|
||
| - Целевые платформы 3-го уровня поддержки технически поддерживаются компилятором, однако мы не проверяем, собирается ли их код и проходятся ли тесты. Также мы не предоставляем никаких предварительно собранных бинарных файлов в рамках наших релизов. | ||
| - Целевые платформы 2-го уровня поддержки гарантированно проходят сборку. Мы предоставляем для них предварительно собранные бинарные файлы, но не запускаем набор тестов на этих платформах: произведённые бинарные файлы могут не работать или содержать ошибки. | ||
| - Целевые платформы 1-го уровня поддержки предоставляют самую высокую гарантию поддержки. Мы запускаем на этих платформах полный набор тестов для каждого изменения, внесённого в компилятор. Предварительно собранные бинарные файлы также доступны. | ||
|
|
||
| В Rust версии 1.91.0 целевая платформа `aarch64-pc-windows-msvc` получает 1-й уровень поддержки, что обеспечивает наши самые высокие гарантии пользователям 64-битных ARM-систем, работающих под управлением Windows. | ||
|
|
||
| ### Добавлена проверка, направленная против висящих сырых указателей, созданных из локальных переменных | ||
|
|
||
| В то время как анализатор заимствований Rust предотвращает возврат висящих ссылок, он не отслеживает сырые указатели. С этим релизом мы добавляем проверку, которая по умолчанию выдаёт предупреждение о сырых указателях на локальные переменные, возвращаемых из функций. Например, такой код: | ||
|
|
||
| ```rust | ||
| fn f() -> *const u8 { | ||
| let x = 0; | ||
| &x | ||
| } | ||
| ``` | ||
|
|
||
| теперь вызовет предупреждение статического анализатора: | ||
|
|
||
| ``` | ||
| warning: a dangling pointer will be produced because the local variable `x` will be dropped | ||
| --> src/lib.rs:3:5 | ||
| | | ||
| 1 | fn f() -> *const u8 { | ||
| | --------- return type of the function is `*const u8` | ||
| 2 | let x = 0; | ||
| | - `x` is part the function and will be dropped at the end of the function | ||
| 3 | &x | ||
| | ^^ | ||
| | | ||
| = note: pointers do not have a lifetime; after returning, the `u8` will be deallocated | ||
| at the end of the function because nothing is referencing it as far as the type system is | ||
| concerned | ||
| = note: `#[warn(dangling_pointers_from_locals)]` on by default | ||
| ``` | ||
|
|
||
| Обратите внимание, что приведённый выше код является безопасным, поскольку сам по себе не выполняет никаких опасных операций. Небезопасным будет только разыменование сырого указателя после возврата из функции. Мы ожидаем, что будущие релизы Rust добавят больше функциональности, которая поможет разработчикам безопасно взаимодействовать с сырыми указателями и небезопасным кодом в целом. | ||
|
|
||
| ### Стабилизированные API | ||
|
|
||
| - [`Path::file_prefix`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.file_prefix) | ||
| - [`AtomicPtr::fetch_ptr_add`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_ptr_add) | ||
| - [`AtomicPtr::fetch_ptr_sub`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_ptr_sub) | ||
| - [`AtomicPtr::fetch_byte_add`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_byte_add) | ||
| - [`AtomicPtr::fetch_byte_sub`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_byte_sub) | ||
| - [`AtomicPtr::fetch_or`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_or) | ||
| - [`AtomicPtr::fetch_and`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_and) | ||
| - [`AtomicPtr::fetch_xor`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_xor) | ||
| - [`{integer}::strict_add`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_add) | ||
| - [`{integer}::strict_sub`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_sub) | ||
| - [`{integer}::strict_mul`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_mul) | ||
| - [`{integer}::strict_div`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_div) | ||
| - [`{integer}::strict_div_euclid`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_div_euclid) | ||
| - [`{integer}::strict_rem`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_rem) | ||
| - [`{integer}::strict_rem_euclid`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_rem_euclid) | ||
| - [`{integer}::strict_neg`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_neg) | ||
| - [`{integer}::strict_shl`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_shl) | ||
| - [`{integer}::strict_shr`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_shr) | ||
| - [`{integer}::strict_pow`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_pow) | ||
| - [`i{N}::strict_add_unsigned`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_add_unsigned) | ||
| - [`i{N}::strict_sub_unsigned`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_sub_unsigned) | ||
| - [`i{N}::strict_abs`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_abs) | ||
| - [`u{N}::strict_add_signed`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_add_signed) | ||
| - [`u{N}::strict_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_sub_signed) | ||
| - [`PanicHookInfo::payload_as_str`](https://doc.rust-lang.org/stable/std/panic/struct.PanicHookInfo.html#method.payload_as_str) | ||
| - [`core::iter::chain`](https://doc.rust-lang.org/stable/core/iter/fn.chain.html) | ||
| - [`u{N}::checked_signed_diff`](https://doc.rust-lang.org/stable/std/primitive.u16.html#method.checked_signed_diff) | ||
| - [`core::array::repeat`](https://doc.rust-lang.org/stable/core/array/fn.repeat.html) | ||
| - [`PathBuf::add_extension`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.add_extension) | ||
| - [`PathBuf::with_added_extension`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.with_added_extension) | ||
| - [`Duration::from_mins`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_mins) | ||
| - [`Duration::from_hours`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_hours) | ||
| - [`impl PartialEq<str> for PathBuf`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#impl-PartialEq%3Cstr%3E-for-PathBuf) | ||
| - [`impl PartialEq<String> for PathBuf`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#impl-PartialEq%3CString%3E-for-PathBuf) | ||
| - [`impl PartialEq<str> for Path`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#impl-PartialEq%3Cstr%3E-for-Path) | ||
| - [`impl PartialEq<String> for Path`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#impl-PartialEq%3CString%3E-for-Path) | ||
| - [`impl PartialEq<PathBuf> for String`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#impl-PartialEq%3CPathBuf%3E-for-String) | ||
| - [`impl PartialEq<Path> for String`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#impl-PartialEq%3CPath%3E-for-String) | ||
| - [`impl PartialEq<PathBuf> for str`](https://doc.rust-lang.org/nightly/std/primitive.str.html#impl-PartialEq%3CPathBuf%3E-for-str) | ||
| - [`impl PartialEq<Path> for str`](https://doc.rust-lang.org/nightly/std/primitive.str.html#impl-PartialEq%3CPath%3E-for-str) | ||
| - [`Ipv4Addr::from_octets`](https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.from_octets) | ||
| - [`Ipv6Addr::from_octets`](https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.from_octets) | ||
| - [`Ipv6Addr::from_segments`](https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.from_segments) | ||
| - [`impl<T> Default for Pin<Box<T>> where Box<T>: Default, T: ?Sized`](https://doc.rust-lang.org/stable/std/default/trait.Default.html#impl-Default-for-Pin%3CBox%3CT%3E%3E) | ||
| - [`impl<T> Default for Pin<Rc<T>> where Rc<T>: Default, T: ?Sized`](https://doc.rust-lang.org/stable/std/default/trait.Default.html#impl-Default-for-Pin%3CRc%3CT%3E%3E) | ||
| - [`impl<T> Default for Pin<Arc<T>> where Arc<T>: Default, T: ?Sized`](https://doc.rust-lang.org/stable/std/default/trait.Default.html#impl-Default-for-Pin%3CArc%3CT%3E%3E) | ||
| - [`Cell::as_array_of_cells`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.as_array_of_cells) | ||
| - [`u{N}::carrying_add`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.carrying_add) | ||
| - [`u{N}::borrowing_sub`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.borrowing_sub) | ||
| - [`u{N}::carrying_mul`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.carrying_mul) | ||
| - [`u{N}::carrying_mul_add`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.carrying_mul_add) | ||
| - [`BTreeMap::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html#method.extract_if) | ||
| - [`BTreeSet::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeSet.html#method.extract_if) | ||
| - [`impl Debug for windows::ffi::EncodeWide<'_>`](https://doc.rust-lang.org/stable/std/os/windows/ffi/struct.EncodeWide.html#impl-Debug-for-EncodeWide%3C'_%3E) | ||
| - [`str::ceil_char_boundary`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.ceil_char_boundary) | ||
| - [`str::floor_char_boundary`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.floor_char_boundary) | ||
| - [`impl Sum for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Sum-for-Saturating%3Cu32%3E) | ||
| - [`impl Sum<&u{N}> for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Sum%3C%26Saturating%3Cu32%3E%3E-for-Saturating%3Cu32%3E) | ||
| - [`impl Product for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Product-for-Saturating%3Cu32%3E) | ||
| - [`impl Product<&u{N}> for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Product%3C%26Saturating%3Cu32%3E%3E-for-Saturating%3Cu32%3E) | ||
|
|
||
| Следующие API теперь можно использовать в контексте `const`: | ||
|
|
||
| - [`<[T; N]>::each_ref`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_ref) | ||
| - [`<[T; N]>::each_mut`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_mut) | ||
| - [`OsString::new`](https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.new) | ||
| - [`PathBuf::new`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.new) | ||
| - [`TypeId::of`](https://doc.rust-lang.org/stable/std/any/struct.TypeId.html#method.of) | ||
| - [`ptr::with_exposed_provenance`](https://doc.rust-lang.org/stable/std/ptr/fn.with_exposed_provenance.html) | ||
| - [`ptr::with_exposed_provenance_mut`](https://doc.rust-lang.org/stable/std/ptr/fn.with_exposed_provenance_mut.html) | ||
|
|
||
| ### Поддержка платформ | ||
|
|
||
| - [Повышение поддержки `aarch64-pc-windows-msvc` до 1-го уровня](https://github.com/rust-lang/rust/pull/145682) | ||
| - [Повышение поддержки `aarch64-pc-windows-gnullvm` и `x86_64-pc-windows-gnullvm` до 2-го уровня с хост-инструментарием.](https://github.com/rust-lang/rust/pull/143031) Примечание: llvm-tools и установщики MSI отсутствуют, но будут добавлены в будущих релизах. | ||
|
|
||
| Дополнительную информацию об уровнях поддержки платформ в Rust можно найти на [странице поддержки](https://doc.rust-lang.org/rustc/platform-support.html). | ||
|
|
||
| ### Прочие изменения | ||
|
|
||
| Проверьте всё, что изменилось в [Rust](https://github.com/rust-lang/rust/releases/tag/1.91.0), [Cargo](https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-191-2025-10-30) и [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-191). | ||
|
|
||
| ## Кто работал над 1.91.0 | ||
|
|
||
| Многие люди собрались вместе, чтобы создать Rust 1.91.0. Без вас мы бы не справились. [Спасибо!](https://thanks.rust-lang.org/rust/1.91.0/) | ||
|
|
||
|
|
||
| [широкий спектр целевых платформ]: https://doc.rust-lang.org/rustc/platform-support.html | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему здесь используется "Tier", а во всех других местах "уровень поддержки"
При этом, я считаю, что правильнее будет оставить "tier" и не переводить это слово
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это в заголовок на хабре пойдёт, там ограничение на длину есть, из-за этого тут как можно короче стараюсь делать