{"id":296170,"date":"2019-12-20T21:00:24","date_gmt":"2019-12-20T21:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296170"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296170","title":{"rendered":"\u0412\u044b\u043f\u0443\u0441\u043a Rust 1.40.0: #[non_exhaustive], \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/481070\/\">\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 Rust \u0440\u0430\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, 1.40.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 \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Rust \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 <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.40.0 \u0432\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \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 <a href=\"https:\/\/www.rust-lang.org\/install.html\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e<\/a> \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \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:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1400-2019-12-19\">\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<h2 id=\"chto-voshlo-v-stabilnuyu-versiyu-1400\">\u0427\u0442\u043e \u0432\u043e\u0448\u043b\u043e \u0432 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e 1.40.0<\/h2>\n<p>  <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043d\u043e\u0432\u0448\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>#[non_exhaustive]<\/code>, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f <code>macros!()<\/code> \u0438 <code>#[attribute]<\/code>. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0439 \u0441\u0442\u0430\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432 Rust 2015. \u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1400-2019-12-19\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u0443\u0441\u043a\u0430<\/a> \u0434\u043b\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"non_exhaustive-struktury-perechisleniya-i-varianty-perechisleniy\"><code>#[non_exhaustive]<\/code> \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0432\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0435\u0441\u044c \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>alpha<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <code>pub struct Foo<\/code>. \u0412\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <code>alpha::Foo<\/code> \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438, \u043d\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043b\u0438 \u0432\u0430\u043c \u0432 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u0435\u0439 \u0432 <code>Foo<\/code>. \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0434\u0438\u043b\u0435\u043c\u043c\u0430: \u043b\u0438\u0431\u043e \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u043f\u043e\u043b\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430\u043c\u0438, \u043b\u0438\u0431\u043e \u0432\u044b \u0440\u0438\u0441\u043a\u0443\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0440\u0443\u0448\u0438\u0442 \u0438\u0445 \u043a\u043e\u0434 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445. \u0412 Rust 1.40.0 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>#[non_exhaustive]<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442 <code>#[non_exhaustive]<\/code> \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0438\u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u0435\u0439, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0432\u043d\u0435 \u043a\u0440\u0435\u0439\u0442\u0430 \u0441 \u0438\u0445 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043a\u0440\u0435\u0439\u0442\u0435 <code>beta<\/code>, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0435\u0433\u043e \u043e\u0442 <code>alpha<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">\/\/ alpha\/lib.rs:  #[non_exhaustive] struct Foo {     pub a: bool, }  enum Bar {     #[non_exhaustive]     Variant { b: u8 } }  fn make_foo() -&gt; Foo { ... } fn make_bar() -&gt; Bar { ... }  \/\/ beta\/lib.rs:  let x = Foo { a: true }; \/\/~ \u041e\u0428\u0418\u0411\u041a\u0410 let Foo { a } = make_foo(); \/\/~ \u041e\u0428\u0418\u0411\u041a\u0410 let Foo { a, .. } = make_foo(); \/\/~ OK           \/\/ -- `beta` \u0432\u0441\u0435 \u0435\u0449\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u0435\u0439.  let x = Bar::Variant { a: 42 }; \/\/~ \u041e\u0428\u0418\u0411\u041a\u0410 let Bar::Variant { b } = make_bar(); \/\/~ \u041e\u0428\u0418\u0411\u041a\u0410 let Bar::Variant { b, .. } = make_bar(); \/\/~ OK                    \/\/ -- `beta` \u0432\u0441\u0435 \u0435\u0449\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f...<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u043a\u0443\u043b\u0438\u0441\u0430\u043c\u0438? \u0412\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f <code>#[non_exhaustive]<\/code> \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0430 \u0434\u043e <code>pub(crate)<\/code>, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u044f \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u043a\u0440\u0435\u0439\u0442\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u043c <code>#[non_exhaustive]<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0451\u043d \u043a \u0441\u0430\u043c\u0438\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c. \u0412\u043e\u0442 \u043a\u043e\u0434, \u0432\u0437\u044f\u0442\u044b\u0439 \u0438\u0437 <a href=\"https:\/\/doc.rust-lang.org\/std\/sync\/atomic\/enum.Ordering.html\"><code>std::cmp::Ordering<\/code><\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#[non_exhaustive] pub enum Ordering { Relaxed, Release, Acquire, AcqRel, SeqCst }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>#[non_exhaustive]<\/code> \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u0435\u0442\u043e\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u0430\u043c \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \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 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043b\u044f <code>Ordering<\/code>. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u044b \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">match ordering {     Relaxed | Release | Acquire | AcqRel | SeqCst =&gt; { \/* logic *\/ }     \/\/~^ \u041e\u0428\u0418\u0411\u041a\u0410; \u0435\u0441\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u044b\u043b \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d,     \/\/ \u044d\u0442\u043e \u0441\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0435\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430. }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0437\u043d\u0430\u043a <code>_<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">match ordering {     Relaxed | Release | Acquire | AcqRel | SeqCst =&gt; { \/* logic *\/ }     _ =&gt; { \/* logic *\/ } \/\/ OK; \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u043e\u0432\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f. }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <code>#[non_exhaustive]<\/code> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432 <a href=\"https:\/\/github.com\/rust-lang\/rust\/issues\/44109#issuecomment-533356866\">\u043e\u0442\u0447\u0451\u0442\u0435 \u043e \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"uluchsheniya-makrosov-i-atributov\">\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/h3>\n<p>  <\/p>\n<p>\u0412 1.40.0 \u043c\u044b \u0432\u043d\u0435\u0441\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439 \u0432 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/63931\/#issuecomment-526362396\"><code>\u0412\u044b\u0437\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 mac!()<\/code> \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u0445 \u0442\u0438\u043f\u043e\u0432.<\/a><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c <code>type Foo = expand_to_type!(bar);<\/code> \u0433\u0434\u0435 <code>expand_to_type<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u043c \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u043c.<\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/63931\/#issuecomment-526362396\"><code>\u041c\u0430\u043a\u0440\u043e\u0441\u044b \u0432 extern { ... }<\/code> \u0431\u043b\u043e\u043a\u0430\u0445.<\/a><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043c\u0430\u043a\u0440\u043e\u0441\u044b <code>make_item!()<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">macro_rules! make_item { ($name:ident) =&gt; { fn $name(); } }  extern {     make_item!(alpha);     make_item!(beta); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 <a href=\"https:\/\/doc.rust-lang.org\/nightly\/reference\/items\/external-blocks.html\"><code>extern { ... }<\/code> \u0431\u043b\u043e\u043a\u0430\u0445<\/a> \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">extern \"C\" {     #[my_identity_macro] \/\/~ \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f \u0434\u043e `fn foo();`.     fn foo(); }<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/64035#issuecomment-533890826\"><code>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f macro_rules!<\/code> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u0445.<\/a><\/p>\n<p>  <\/p>\n<p>\u041c\u0430\u043a\u0440\u043e\u0441\u044b \u0441 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (<code>mac!()<\/code>) \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b (<code>#[mac]<\/code>) \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b <code>macro_rules!<\/code>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432 \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u043c \u043e\u0442\u0447\u0451\u0442\u0435 \u043e \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/63674\"><code>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e $m:meta<\/code><\/a> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/57367#issuecomment-457882109\"><code>\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f TokenStream<\/code><\/a>.<\/p>\n<p>  <\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">macro_rules! accept_meta { ($m:meta) =&gt; {} } accept_meta!( my::path ); accept_meta!( my::path = \"lit\" ); accept_meta!( my::path ( a b c ) ); accept_meta!( my::path [ a b c ] ); accept_meta!( my::path { a b c } );<\/code><\/pre>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"migracionnye-preduprezhdeniya-analizatora-zaimstvovaniy-stanovyatsya-oshibkami-v-redakcii-rust-2015\">\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0439 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432 \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0438 Rust 2015<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0432\u044b\u043f\u0443\u0441\u043a\u0435 1.35.0 <a href=\"https:\/\/blog.rust-lang.org\/2019\/07\/04\/Rust-1.36.0.html#nll-for-rust-2015\">\u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438<\/a>, \u0447\u0442\u043e <code>NLL<\/code> \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0438 Rust 2015 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u0434\u043b\u044f 2018 \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0438 \u0432 <a href=\"https:\/\/blog.rust-lang.org\/2018\/12\/06\/Rust-1.31-and-rust-2018.html#non-lexical-lifetimes\">Rust 1.31<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0441\u043a\u0430\u0437\u0430\u043b\u0438, \u0441\u0442\u0430\u0440\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0439 \u043c\u043e\u0433 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 (NLL borrow checker) \u044d\u0442\u0438 \u043d\u0435\u0434\u043e\u0447\u0451\u0442\u044b \u0431\u044b\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u044b. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u044d\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442 \u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441\u0442\u0430\u0440\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u0438 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442 \u043b\u0438 \u0435\u0451 \u043d\u043e\u0432\u044b\u0439. \u0412 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043e\u0448\u0438\u0431\u043a\u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0432\u044b\u043f\u0443\u0441\u043a Rust 1.39.0 \u0437\u0430\u043c\u0435\u043d\u0438\u043b \u044d\u0442\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u043b\u044f \u043a\u043e\u0434\u0430 \u0441 <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/63565\">2018 \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0435\u0439<\/a>. Rust 1.40.0 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442 \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043e\u0434\u0430 <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/64221\">2015 \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0438<\/a>, \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044f \u044d\u0442\u0438 \u0434\u044b\u0440\u044b \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/64790\">\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0430\u0436\u0435 \u043f\u043e\u0447\u0438\u0441\u0442\u0438\u043b\u0438 \u043e\u0442 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/a>!<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438\u0437-\u0437\u0430 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0438\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0438\u0442\u0430\u0439\u0442\u0435 <a href=\"https:\/\/blog.rust-lang.org\/2019\/11\/01\/nll-hard-errors.html\">\u043f\u043e\u0441\u0442 Niko Matsakis&#8217;s<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"bolshe-konstantnyh-funkciy-v-standartnoy-biblioteke\">\u0411\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Rust 1.40.0, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430\u044f (<code>const fn<\/code>):<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/doc.rust-lang.org\/std\/primitive.u8.html#method.is_power_of_two\"><code>is_power_of_two<\/code><\/a> \u0434\u043b\u044f <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/65092\">\u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"stabilizirovannye-funkcii-v-standartnoy-biblioteke\">\u0421\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435<\/h3>\n<p>  <\/p>\n<p>\u0412 Rust 1.40.0 \u0431\u044b\u043b\u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/doc.rust-lang.org\/std\/macro.todo.html\"><code>todo!()<\/code><\/a><\/p>\n<p>  <\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f, \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u0438 \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 <a href=\"https:\/\/doc.rust-lang.org\/std\/macro.unimplemented.html\"><code>unimplemented!()<\/code><\/a>.<\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/doc.rust-lang.org\/std\/primitive.slice.html#method.repeat\"><code>slice::repeat<\/code><\/a><\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u0442 <code>Vec&lt;T&gt;<\/code> \u0438\u0437 <code>n<\/code> \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439 \u0441\u0440\u0435\u0437\u0430.<\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/doc.rust-lang.org\/std\/mem\/fn.take.html\"><code>mem::take<\/code><\/a><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u041e\u043d\u0430 \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 <a href=\"https:\/\/doc.rust-lang.org\/std\/option\/enum.Option.html#method.take\"><code>Option::take<\/code><\/a> \u0438 <a href=\"https:\/\/doc.rust-lang.org\/std\/cell\/struct.Cell.html#method.take\"><code>Cell::take<\/code><\/a> \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f <a href=\"https:\/\/doc.rust-lang.org\/std\/mem\/fn.replace.html\"><code>mem::replace(&amp;mut dst, Default::default())<\/code><\/a>.<\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/doc.rust-lang.org\/std\/collections\/struct.BTreeMap.html#method.get_key_value\"><code>BTreeMap::get_key_value<\/code><\/a> \u0438 <a href=\"https:\/\/doc.rust-lang.org\/std\/collections\/struct.HashMap.html#method.get_key_value\"><code>HashMap::get_key_value<\/code><\/a><\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0430\u0440\u0443 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443.<\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/doc.rust-lang.org\/std\/option\/enum.Option.html#method.as_deref\"><code>Option::as_deref<\/code><\/a>, <a href=\"https:\/\/doc.rust-lang.org\/std\/option\/enum.Option.html#method.as_deref_mut\"><code>Option::as_deref_mut<\/code><\/a><\/p>\n<p>  <\/p>\n<p>\u041e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u043e <a href=\"https:\/\/doc.rust-lang.org\/std\/option\/enum.Option.html#method.as_ref\"><code>Option::as_ref<\/code><\/a> \u0438 <a href=\"https:\/\/doc.rust-lang.org\/std\/option\/enum.Option.html#method.as_mut\"><code>Option::as_mut<\/code><\/a>, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <a href=\"https:\/\/doc.rust-lang.org\/std\/ops\/trait.Deref.html\"><code>Deref<\/code><\/a> \u0438 <a href=\"https:\/\/doc.rust-lang.org\/std\/ops\/trait.DerefMut.html\"><code>DerefMut<\/code><\/a> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, <code>opt_box.as_deref()<\/code> \u0438 <code>opt_box.as_deref_mut()<\/code>, \u0433\u0434\u0435 <code>opt_box: Option&lt;Box&lt;T&gt;&gt;<\/code>, \u0441\u043e\u0437\u0434\u0430\u044e\u0442 <code>Option&lt;&amp;T&gt;<\/code> \u0438 <code>Option&lt;&amp;mut T&gt;<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/doc.rust-lang.org\/std\/option\/enum.Option.html#method.flatten\"><code>Option::flatten<\/code><\/a><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u043e\u0434\u043e\u0431\u043d\u043e <a href=\"https:\/\/doc.rust-lang.org\/std\/iter\/trait.Iterator.html#method.flatten\"><code>Iterator::flatten<\/code><\/a>, \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 <code>Option&lt;Option&lt;T&gt;&gt;<\/code> \u0432 <code>Option&lt;T&gt;<\/code>, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f <code>Some(x)<\/code> \u0434\u043b\u044f <code>Some(Some(x))<\/code> \u0438 <code>None<\/code> \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/doc.rust-lang.org\/std\/net\/struct.UdpSocket.html#method.peer_addr\"><code>UdpSocket::peer_addr<\/code><\/a><\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u0441\u043e\u043a\u0435\u0442.<\/p>\n<p>  <\/li>\n<li>\n<p><a href=\"https:\/\/doc.rust-lang.org\/std\/primitive.f32.html#method.to_be_bytes\"><code>{f32,f64}::to_be_bytes<\/code><\/a>, <a href=\"https:\/\/doc.rust-lang.org\/std\/primitive.f32.html#method.to_le_bytes\"><code>{f32,f64}::to_le_bytes<\/code><\/a>, <a href=\"https:\/\/doc.rust-lang.org\/std\/primitive.f32.html#method.to_ne_bytes\"><code>{f32,f64}::to_ne_bytes<\/code><\/a>, <a href=\"https:\/\/doc.rust-lang.org\/std\/primitive.f32.html#method.from_be_bytes\"><code>{f32,f64}::from_be_bytes<\/code><\/a>, <a href=\"https:\/\/doc.rust-lang.org\/std\/primitive.f32.html#method.from_le_bytes\"><code>{f32,f64}::from_le_bytes<\/code><\/a> \u0438 <a href=\"https:\/\/doc.rust-lang.org\/std\/primitive.f32.html#method.from_ne_bytes\"><code>{f32,f64}::from_ne_bytes<\/code><\/a><\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0430\u0439\u0442 \u0441 big-endian (network), little-endian \u0438\u043b\u0438 native-endian \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0431\u0430\u0439\u0442.<\/p>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"drugie-izmeneniya\">\u0414\u0440\u0443\u0433\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1400-2019-12-19\">\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/a>, <a href=\"https:\/\/github.com\/rust-lang\/cargo\/blob\/master\/CHANGELOG.md#cargo-140-2019-12-19\">\u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 Cargo<\/a> \u0438 <a href=\"https:\/\/github.com\/rust-lang\/rust-clippy\/blob\/master\/CHANGELOG.md#rust-140\">\u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 Clippy<\/a> \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0442\u0435\u0440\u043f\u0435\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0440\u043e\u0447\u0442\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#compatibility-notes\">\u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438<\/a>, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c, \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442 \u043b\u0438 \u0432\u0430\u0441 \u044d\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<h2 id=\"uchastniki-1400\">\u0423\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 1.40.0<\/h2>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043b\u044e\u0434\u0435\u0439 \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.40.0. \u041c\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u0435\u0437 \u0432\u0441\u0435\u0445 \u0432\u0430\u0441, <a href=\"https:\/\/thanks.rust-lang.org\/rust\/1.40.0\/\">\u0441\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\">\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\">\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>.<\/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\/blandger\/\" class=\"user_link\">blandger<\/a>, <a href=\"https:\/\/habr.com\/ru\/users\/funkill\/\" class=\"user_link\">funkill<\/a>, <a href=\"https:\/\/habr.com\/ru\/users\/hippolot\/\" class=\"user_link\">Hippolot<\/a>, <a href=\"https:\/\/habr.com\/ru\/users\/p0lunin\/\" class=\"user_link\">P0lunin<\/a>, <a href=\"https:\/\/habr.com\/ru\/users\/psyhaste\/\" class=\"user_link\">PsyHaSTe<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/users\/loomaclin\/\" class=\"user_link\">LooMaclin<\/a>.<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <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\/post\/481070\/\"> https:\/\/habr.com\/ru\/post\/481070\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/481070\/\">\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 Rust \u0440\u0430\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, 1.40.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 \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Rust \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 <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.40.0 \u0432\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \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 <a href=\"https:\/\/www.rust-lang.org\/install.html\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e<\/a> \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \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:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1400-2019-12-19\">\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<h2 id=\"chto-voshlo-v-stabilnuyu-versiyu-1400\">\u0427\u0442\u043e \u0432\u043e\u0448\u043b\u043e \u0432 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e 1.40.0<\/h2>\n<p>  <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043d\u043e\u0432\u0448\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>#[non_exhaustive]<\/code>, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f <code>macros!()<\/code> \u0438 <code>#[attribute]<\/code>. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0439 \u0441\u0442\u0430\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432 Rust 2015. \u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1400-2019-12-19\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u0443\u0441\u043a\u0430<\/a> \u0434\u043b\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/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-296170","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296170","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=296170"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296170\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}