{"id":427580,"date":"2024-07-27T15:00:51","date_gmt":"2024-07-27T15:00:51","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=427580"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=427580","title":{"rendered":"<span>Rust 1.80.0: \u0442\u0438\u043f\u044b LazyCell, LazyLock, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f cfg, \u044d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u044b\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 Rust \u0440\u0430\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u2014 1.80.0. Rust \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0435 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Rust, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0447\u0435\u0440\u0435\u0437 <code>rustup<\/code>, \u0442\u043e \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 1.80.0 \u0432\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p> <\/p>\n<pre><code class=\"plaintext\">$ rustup update stable<\/code><\/pre>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0451 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d <code>rustup<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0441 <a href=\"https:\/\/www.rust-lang.org\/install.html\" rel=\"nofollow noopener noreferrer\">\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/a> \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/doc.rust-lang.org\/nightly\/releases.html#version-1800-2024-07-25\" rel=\"nofollow noopener noreferrer\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443<\/a> \u043d\u0430 GitHub.<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u043c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0443\u0449\u0438\u0435 \u0432\u044b\u043f\u0443\u0441\u043a\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043d\u0430\u043b beta (<code>rustup default beta<\/code>) \u0438\u043b\u0438 nightly (<code>rustup default nightly<\/code>). \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, <a href=\"https:\/\/github.com\/rust-lang\/rust\/issues\/new\/choose\" rel=\"nofollow noopener noreferrer\">\u0441\u043e\u043e\u0431\u0449\u0430\u0439\u0442\u0435<\/a> \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0432\u0441\u0442\u0440\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445.<\/p>\n<p><a name=\"habracut\"><\/a> <\/p>\n<h2 id=\"chto-stabilizirovano-v-1800\">\u0427\u0442\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 1.80.0<\/h2>\n<p> <\/p>\n<h3 id=\"lazycell-i-lazylock\"><code>LazyCell<\/code> \u0438 <code>LazyLock<\/code><\/h3>\n<p> <\/p>\n<p>\u042d\u0442\u043e \u00ab\u043b\u0435\u043d\u0438\u0432\u044b\u0435\u00bb \u0442\u0438\u043f\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0432\u043e\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043d\u0438\u043c. \u041e\u043d\u0438 \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u0442\u0438\u043f\u044b <code>OnceCell<\/code> \u0438 <code>OnceLock<\/code>, <a href=\"https:\/\/blog.rust-lang.org\/2023\/06\/01\/Rust-1.70.0.html#oncecell-and-oncelock\" rel=\"nofollow noopener noreferrer\">\u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 1.70<\/a>, \u043d\u043e \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u0439 \u0432 \u0442\u0438\u043f. \u042d\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043a\u0440\u0435\u0439\u0442\u043e\u0432 <a href=\"https:\/\/crates.io\/crates\/lazy-static\" rel=\"nofollow noopener noreferrer\"><code>lazy_static<\/code><\/a> \u0438 <a href=\"https:\/\/crates.io\/crates\/once_cell\" rel=\"nofollow noopener noreferrer\"><code>once_cell<\/code><\/a>.<\/p>\n<p> <\/p>\n<p><code>LazyLock<\/code> \u2014 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0441\u0442, \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>static<\/code>. \u0422\u0430\u043a, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435 \u0438 \u043f\u043e\u0442\u043e\u043a, \u043e\u0442\u0432\u0435\u0442\u0432\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>spawn<\/code>, \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u043e\u0442\u043e\u043a (<code>scope<\/code>) \u0443\u0432\u0438\u0434\u044f\u0442 \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <code>LAZY_TIME<\/code> \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0437\u043d\u0430\u0442\u044c, <em>\u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e<\/em> \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 <code>OnceLock::get_or_init<\/code>.<\/p>\n<p> <\/p>\n<pre><code class=\"rust\">use std::sync::LazyLock; use std::time::Instant;  static LAZY_TIME: LazyLock&lt;Instant&gt; = LazyLock::new(Instant::now);  fn main() {     let start = Instant::now();     std::thread::scope(|s| {         s.spawn(|| {             println!(\"Thread lazy time is {:?}\", LAZY_TIME.duration_since(start));         });         println!(\"Main lazy time is {:?}\", LAZY_TIME.duration_since(start));     }); }<\/code><\/pre>\n<p> <\/p>\n<p><code>LazyCell<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0431\u0435\u0437 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 <code>Sync<\/code>, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f <code>static<\/code>, \u043d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u0438\u043a\u0430\u0445 <code>thread_local!<\/code> (\u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430). \u041b\u044e\u0431\u043e\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u0442\u0430\u043a \u0447\u0442\u043e \u043b\u0435\u043d\u0438\u0432\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432\u0435\u0437\u0434\u0435!<\/p>\n<p> <\/p>\n<h3 id=\"proveryaemye-imena-i-znacheniya-cfg\">\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>cfg<\/code><\/h3>\n<p> <\/p>\n<p>\u0412 1.79 <code>rustc<\/code> \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u0444\u043b\u0430\u0433 <a href=\"https:\/\/doc.rust-lang.org\/rustc\/check-cfg.html\" rel=\"nofollow noopener noreferrer\"><code>--check-cfg<\/code><\/a>, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c Cargo 1.80 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u044d\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0435\u043c\u0443 \u0438\u043c\u0451\u043d <code>cfg<\/code> (\u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0432 <code>rustc<\/code>). \u0421\u044e\u0434\u0430 \u0432\u0445\u043e\u0434\u044f\u0442 \u0438\u043c\u0435\u043d\u0430 \u0444\u0438\u0447 \u0438\u0437 <code>Cargo.toml<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u043e\u0432\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 <code>cargo::rustc-check-cfg<\/code> \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p> <\/p>\n<p>\u041e \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0445 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043b\u0438\u043d\u0442 <code>unexpected_cfgs<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e <code>rayon<\/code> \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p> <\/p>\n<pre><code class=\"rust\">fn main() {     println!(\"Hello, world!\");      #[cfg(feature = \"crayon\")]     rayon::join(         || println!(\"Hello, Thing One!\"),         || println!(\"Hello, Thing Two!\"),     ); }<\/code><\/pre>\n<p> <\/p>\n<pre><code class=\"plaintext\">warning: unexpected `cfg` condition value: `crayon`  --&gt; src\/main.rs:4:11   | 4 |     #[cfg(feature = \"crayon\")]   |           ^^^^^^^^^^--------   |                     |   |                     help: there is a expected value with a similar name: `\"rayon\"`   |   = note: expected values for `feature` are: `rayon`   = help: consider adding `crayon` as a feature in `Cargo.toml`   = note: see &lt;https:\/\/doc.rust-lang.org\/nightly\/rustc\/check-cfg\/cargo-specifics.html&gt; for more information about checking conditional configuration   = note: `#[warn(unexpected_cfgs)]` on by default<\/code><\/pre>\n<p> <\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442 \u0444\u0438\u0447\u0430 <code>rayon<\/code>.<\/p>\n<p> <\/p>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 <code>[lints]<\/code> \u0432 <code>Cargo.toml<\/code> \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0438\u043c\u0451\u043d \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 <code>cfg<\/code>. <code>rustc<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <a href=\"https:\/\/doc.rust-lang.org\/rustc\/check-cfg.html#specifying-expected-names-and-values\" rel=\"nofollow noopener noreferrer\">\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/a> \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0445 \u0432 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u0445.<\/p>\n<p> <\/p>\n<pre><code class=\"plaintext\">[lints.rust] unexpected_cfgs = { level = \"warn\", check-cfg = ['cfg(foo, values(\"bar\"))'] }<\/code><\/pre>\n<p> <\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/blog.rust-lang.org\/2024\/05\/06\/check-cfg.html\" rel=\"nofollow noopener noreferrer\">\u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u043b\u043e\u0433\u0430<\/a>, \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 nightly.<\/p>\n<p> <\/p>\n<h3 id=\"eksklyuzivnye-diapazony-v-shablonah\">\u042d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u044b\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445<\/h3>\n<p> <\/p>\n<p>\u0412 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 Rust \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 (\u00ab\u044d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u044b\u0435\u00bb), \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043a\u0430\u043a <code>a..b<\/code> \u0438\u043b\u0438 <code>..b<\/code>, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u0438\u043f\u0430\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 <code>Range<\/code> \u0438 <code>RangeTo<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0446\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e:<\/p>\n<p> <\/p>\n<pre><code class=\"rust\">pub fn size_prefix(n: u32) -&gt; &amp;'static str {     const K: u32 = 10u32.pow(3);     const M: u32 = 10u32.pow(6);     const G: u32 = 10u32.pow(9);     match n {         ..K =&gt; \"\",         K..M =&gt; \"k\",         M..G =&gt; \"M\",         G.. =&gt; \"G\",     } }<\/code><\/pre>\n<p> <\/p>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 (\u00ab\u0438\u043d\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u044b\u0435\u00bb \u2014 <code>a..=b<\/code> \u0438\u043b\u0438 <code>..=b<\/code>), \u0438\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 (<code>a..<\/code>) \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434 \u0432\u0440\u043e\u0434\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>K - 1<\/code> \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a.<\/p>\n<p> <\/p>\n<p>\u042d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u044b\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0431\u044b\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0444\u0438\u0447\u0438 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e, \u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0448\u0430\u043b\u0438 \u043e\u043f\u0430\u0441\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043d\u0435\u0441\u0442\u0438 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0443 \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0431\u044b\u043b\u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0432 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u0430 \u043d\u043e\u0432\u044b\u0435 \u043b\u0438\u043d\u0442\u044b <code>non_contiguous_range_endpoints<\/code> \u0438 <code>overlapping_range_endpoints<\/code> \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b-\u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u043d\u0430 \u0438\u043d\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u044b\u0435 \u0438\u043b\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<\/p>\n<p> <\/p>\n<h3 id=\"stabilizirovannye-api\">\u0421\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 API<\/h3>\n<p> <\/p>\n<ul>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/rc\/struct.Rc.html#impl-Default-for-Rc%3CCStr%3E\" rel=\"nofollow noopener noreferrer\"><code>impl Default \u0434\u043b\u044f Rc&lt;CStr&gt;<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/rc\/struct.Rc.html#impl-Default-for-Rc%3Cstr%3E\" rel=\"nofollow noopener noreferrer\"><code>impl Default \u0434\u043b\u044f Rc&lt;str&gt;<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/rc\/struct.Rc.html#impl-Default-for-Rc%3C%5BT%5D%3E\" rel=\"nofollow noopener noreferrer\"><code>impl Default \u0434\u043b\u044f Rc&lt;[T]&gt;<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/sync\/struct.Arc.html#impl-Default-for-Arc%3Cstr%3E\" rel=\"nofollow noopener noreferrer\"><code>impl Default \u0434\u043b\u044f Arc&lt;str&gt;<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/sync\/struct.Arc.html#impl-Default-for-Arc%3CCStr%3E\" rel=\"nofollow noopener noreferrer\"><code>impl Default \u0434\u043b\u044f Arc&lt;CStr&gt;<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/sync\/struct.Arc.html#impl-Default-for-Arc%3C%5BT%5D%3E\" rel=\"nofollow noopener noreferrer\"><code>impl Default \u0434\u043b\u044f Arc&lt;[T]&gt;<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/boxed\/struct.Box.html#impl-IntoIterator-for-Box%3C%5BI%5D,+A%3E\" rel=\"nofollow noopener noreferrer\"><code>impl IntoIterator \u0434\u043b\u044f Box&lt;[T]&gt;<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/boxed\/struct.Box.html#impl-FromIterator%3CString%3E-for-Box%3Cstr%3E\" rel=\"nofollow noopener noreferrer\"><code>impl FromIterator&lt;String&gt; \u0434\u043b\u044f Box&lt;str&gt;<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/boxed\/struct.Box.html#impl-FromIterator%3Cchar%3E-for-Box%3Cstr%3E\" rel=\"nofollow noopener noreferrer\"><code>impl FromIterator&lt;char&gt; \u0434\u043b\u044f Box&lt;str&gt;<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/cell\/struct.LazyCell.html\" rel=\"nofollow noopener noreferrer\"><code>LazyCell<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/sync\/struct.LazyLock.html\" rel=\"nofollow noopener noreferrer\"><code>LazyLock<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/time\/struct.Duration.html#method.div_duration_f32\" rel=\"nofollow noopener noreferrer\"><code>Duration::div_duration_f32<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/time\/struct.Duration.html#method.div_duration_f64\" rel=\"nofollow noopener noreferrer\"><code>Duration::div_duration_f64<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/option\/enum.Option.html#method.take_if\" rel=\"nofollow noopener noreferrer\"><code>Option::take_if<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/io\/trait.Seek.html#method.seek_relative\" rel=\"nofollow noopener noreferrer\"><code>Seek::seek_relative<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/collections\/struct.BinaryHeap.html#method.as_slice\" rel=\"nofollow noopener noreferrer\"><code>BinaryHeap::as_slice<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.offset\" rel=\"nofollow noopener noreferrer\"><code>NonNull::offset<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.byte_offset\" rel=\"nofollow noopener noreferrer\"><code>NonNull::byte_offset<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.add\" rel=\"nofollow noopener noreferrer\"><code>NonNull::add<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.byte_add\" rel=\"nofollow noopener noreferrer\"><code>NonNull::byte_add<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.sub\" rel=\"nofollow noopener noreferrer\"><code>NonNull::sub<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.byte_sub\" rel=\"nofollow noopener noreferrer\"><code>NonNull::byte_sub<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.offset_from\" rel=\"nofollow noopener noreferrer\"><code>NonNull::offset_from<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.byte_offset_from\" rel=\"nofollow noopener noreferrer\"><code>NonNull::byte_offset_from<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.read\" rel=\"nofollow noopener noreferrer\"><code>NonNull::read<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.read_volatile\" rel=\"nofollow noopener noreferrer\"><code>NonNull::read_volatile<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.read_unaligned\" rel=\"nofollow noopener noreferrer\"><code>NonNull::read_unaligned<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.write\" rel=\"nofollow noopener noreferrer\"><code>NonNull::write<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.write_volatile\" rel=\"nofollow noopener noreferrer\"><code>NonNull::write_volatile<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.write_unaligned\" rel=\"nofollow noopener noreferrer\"><code>NonNull::write_unaligned<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.write_bytes\" rel=\"nofollow noopener noreferrer\"><code>NonNull::write_bytes<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.copy_to\" rel=\"nofollow noopener noreferrer\"><code>NonNull::copy_to<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.copy_to_nonoverlapping\" rel=\"nofollow noopener noreferrer\"><code>NonNull::copy_to_nonoverlapping<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.copy_from\" rel=\"nofollow noopener noreferrer\"><code>NonNull::copy_from<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.copy_from_nonoverlapping\" rel=\"nofollow noopener noreferrer\"><code>NonNull::copy_from_nonoverlapping<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.replace\" rel=\"nofollow noopener noreferrer\"><code>NonNull::replace<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.swap\" rel=\"nofollow noopener noreferrer\"><code>NonNull::swap<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.drop_in_place\" rel=\"nofollow noopener noreferrer\"><code>NonNull::drop_in_place<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/ptr\/struct.NonNull.html#method.align_offset\" rel=\"nofollow noopener noreferrer\"><code>NonNull::align_offset<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/primitive.slice.html#method.split_at_checked\" rel=\"nofollow noopener noreferrer\"><code>&lt;[T]&gt;::split_at_checked<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/primitive.slice.html#method.split_at_mut_checked\" rel=\"nofollow noopener noreferrer\"><code>&lt;[T]&gt;::split_at_mut_checked<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/primitive.str.html#method.split_at_checked\" rel=\"nofollow noopener noreferrer\"><code>str::split_at_checked<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/primitive.str.html#method.split_at_mut_checked\" rel=\"nofollow noopener noreferrer\"><code>str::split_at_mut_checked<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/primitive.str.html#method.trim_ascii\" rel=\"nofollow noopener noreferrer\"><code>str::trim_ascii<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/primitive.str.html#method.trim_ascii_start\" rel=\"nofollow noopener noreferrer\"><code>str::trim_ascii_start<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/primitive.str.html#method.trim_ascii_end\" rel=\"nofollow noopener noreferrer\"><code>str::trim_ascii_end<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/primitive.slice.html#method.trim_ascii\" rel=\"nofollow noopener noreferrer\"><code>&lt;[u8]&gt;::trim_ascii<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/primitive.slice.html#method.trim_ascii_start\" rel=\"nofollow noopener noreferrer\"><code>&lt;[u8]&gt;::trim_ascii_start<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/primitive.slice.html#method.trim_ascii_end\" rel=\"nofollow noopener noreferrer\"><code>&lt;[u8]&gt;::trim_ascii_end<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/net\/struct.Ipv4Addr.html#associatedconstant.BITS\" rel=\"nofollow noopener noreferrer\"><code>Ipv4Addr::BITS<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/net\/struct.Ipv4Addr.html#method.to_bits\" rel=\"nofollow noopener noreferrer\"><code>Ipv4Addr::to_bits<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/net\/struct.Ipv4Addr.html#method.from_bits\" rel=\"nofollow noopener noreferrer\"><code>Ipv4Addr::from_bits<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/net\/struct.Ipv6Addr.html#associatedconstant.BITS\" rel=\"nofollow noopener noreferrer\"><code>Ipv6Addr::BITS<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/net\/struct.Ipv6Addr.html#method.to_bits\" rel=\"nofollow noopener noreferrer\"><code>Ipv6Addr::to_bits<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/net\/struct.Ipv6Addr.html#method.from_bits\" rel=\"nofollow noopener noreferrer\"><code>Ipv6Addr::from_bits<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/alloc\/vec\/struct.Vec.html#method.into_flattened\" rel=\"nofollow noopener noreferrer\"><code>Vec::&lt;[T; N]&gt;::into_flattened<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/primitive.slice.html#method.as_flattened\" rel=\"nofollow noopener noreferrer\"><code>&lt;[[T; N]]&gt;::as_flattened<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/primitive.slice.html#method.as_flattened_mut\" rel=\"nofollow noopener noreferrer\"><code>&lt;[[T; N]]&gt;::as_flattened_mut<\/code><\/a><\/li>\n<\/ul>\n<p> <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 API \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 <code>const<\/code>:<\/p>\n<p> <\/p>\n<ul>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/primitive.slice.html#method.last_chunk\" rel=\"nofollow noopener noreferrer\"><code>&lt;[T]&gt;::last_chunk<\/code><\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/collections\/struct.BinaryHeap.html#method.new\" rel=\"nofollow noopener noreferrer\"><code>BinaryHeap::new<\/code><\/a><\/li>\n<\/ul>\n<p> <\/p>\n<h3 id=\"prochie-izmeneniya\">\u041f\u0440\u043e\u0447\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/h3>\n<p> <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432\u0441\u0451, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0432 <a href=\"https:\/\/github.com\/rust-lang\/rust\/releases\/tag\/1.80.0\" rel=\"nofollow noopener noreferrer\">Rust<\/a>, <a href=\"https:\/\/github.com\/rust-lang\/cargo\/blob\/master\/CHANGELOG.md#cargo-180-2024-07-25\" rel=\"nofollow noopener noreferrer\">Cargo<\/a> \u0438 <a href=\"https:\/\/github.com\/rust-lang\/rust-clippy\/blob\/master\/CHANGELOG.md#rust-180\" rel=\"nofollow noopener noreferrer\">Clippy<\/a>.<\/p>\n<p> <\/p>\n<h2 id=\"kto-rabotal-nad-1800\">\u041a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 1.80.0<\/h2>\n<p> <\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u043b\u044e\u0434\u0438 \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c Rust 1.80.0. \u0411\u0435\u0437 \u0432\u0430\u0441 \u043c\u044b \u0431\u044b \u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c. <a href=\"https:\/\/thanks.rust-lang.org\/rust\/1.80.0\/\" rel=\"nofollow noopener noreferrer\">\u0421\u043f\u0430\u0441\u0438\u0431\u043e!<\/a><\/p>\n<p> <\/p>\n<h2 id=\"ot-perevodchikov\">\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u043e\u0432<\/h2>\n<p> <\/p>\n<p>\u0421 \u043b\u044e\u0431\u044b\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043f\u043e \u044f\u0437\u044b\u043a\u0443 Rust \u0432\u0430\u043c \u0441\u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0432 <a href=\"https:\/\/t.me\/rustlang_ru\" rel=\"nofollow noopener noreferrer\">\u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u043c \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0447\u0430\u0442\u0435<\/a> \u0438\u043b\u0438 \u0436\u0435 \u0432 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c <a href=\"https:\/\/t.me\/rust_beginners_ru\" rel=\"nofollow noopener noreferrer\">\u0447\u0430\u0442\u0435 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432\u044b\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432<\/a>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430\u043c \u0438\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438, \u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0439\u0442\u0435\u0441\u044c \u0432 <a href=\"https:\/\/t.me\/rustlang_ru_translations\" rel=\"nofollow noopener noreferrer\">\u0447\u0430\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u043e\u0432<\/a>.<\/p>\n<p> <\/p>\n<p>\u0414\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0443\u0441\u0438\u043b\u0438\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0438 <a href=\"https:\/\/habr.com\/ru\/users\/andreevlex\/\" class=\"user_link\">andreevlex<\/a>, <a href=\"https:\/\/habr.com\/ru\/users\/telegaovoshey\/\" class=\"user_link\">TelegaOvoshey<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/users\/funkill\/\" class=\"user_link\">funkill<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/831894\/\"> https:\/\/habr.com\/ru\/articles\/831894\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 Rust \u0440\u0430\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u2014 1.80.0. Rust \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0435 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Rust, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0447\u0435\u0440\u0435\u0437 <code>rustup<\/code>, \u0442\u043e \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 1.80.0 \u0432\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p> <\/p>\n<pre><code class=\"plaintext\">$ rustup update stable<\/code><\/pre>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0451 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d <code>rustup<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0441 <a href=\"https:\/\/www.rust-lang.org\/install.html\" rel=\"nofollow noopener noreferrer\">\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/a> \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/doc.rust-lang.org\/nightly\/releases.html#version-1800-2024-07-25\" rel=\"nofollow noopener noreferrer\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043a \u0432\u044b\u043f\u0443\u0441\u043a\u0443<\/a> \u043d\u0430 GitHub.<\/p>\n<p> <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u043c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0443\u0449\u0438\u0435 \u0432\u044b\u043f\u0443\u0441\u043a\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043d\u0430\u043b beta (<code>rustup default beta<\/code>) \u0438\u043b\u0438 nightly (<code>rustup default nightly<\/code>). \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, <a href=\"https:\/\/github.com\/rust-lang\/rust\/issues\/new\/choose\" rel=\"nofollow noopener noreferrer\">\u0441\u043e\u043e\u0431\u0449\u0430\u0439\u0442\u0435<\/a> \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0432\u0441\u0442\u0440\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-427580","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/427580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=427580"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/427580\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=427580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=427580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=427580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}