{"id":35875,"date":"2019-10-31T22:07:21","date_gmt":"2019-10-31T19:07:21","guid":{"rendered":"https:\/\/prohoster.info\/blog\/rust-1-36\/"},"modified":"2019-10-31T22:07:21","modified_gmt":"2019-10-31T19:07:21","slug":"rust-1-36","status":"publish","type":"post","link":"https:\/\/prohoster.info\/pl\/blog\/news\/rust-1-36","title":{"rendered":"Rust 1.36","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Zesp\u00f3\u0142 deweloper\u00f3w ma przyjemno\u015b\u0107 zaprezentowa\u0107 Rust 1.36!<\/p>\n<p>Co nowego w Rust 1.36?<br \/>\n<noindex>Zosta\u0142 zaktualizowany trait Future, wprowadzaj\u0105c nowo\u015b\u0107: crate alloc, MaybeUninit, <a rel=\"nofollow\" href=\"http:\/\/blog.pnkfx.org\/blog\/2019\/06\/26\/breaking-news-non-lexical-lifetimes-arrives-for-everyone\/\"> NLL dla Rust 2015<\/a>, nowa implementacja HashMap&lt;K, V&gt; oraz nowy flaga &#8212;offline dla Cargo.<\/p>\n<p><\/noindex><br \/>\nA teraz szczeg\u00f3\u0142y:\n<\/p>\n<ul>\n<li> W Rust 1.36 w ko\u0144cu <a rel=\"nofollow\" href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/59739\">zosta\u0142 ustabilizowany<\/a> trait Future.\n    <\/li>\n<li>Crate alloc.<br \/> Pocz\u0105wszy od Rust 1.36, cz\u0119\u015bci std, kt\u00f3re zale\u017c\u0105 od globalnego alokatora (np. Vec), znajduj\u0105 si\u0119 w crate alloc. Teraz std reeksportuje te cz\u0119\u015bci. <a rel=\"nofollow\" href=\"https:\/\/blog.rust-lang.org\/2019\/07\/04\/Rust-1.36.0.html#the-alloc-crate-is-stable\">Wi\u0119cej na ten temat<\/a>.\n    <\/li>\n<li>MaybeUninit zamiast mem::uninitialized.<br \/> W poprzednich wersjach mem::uninitialized pozwala\u0142o na omini\u0119cie kontroli inicjalizacji, co by\u0142o u\u017cywane do leniwej alokacji tablic, lecz ta funkcja jest do\u015b\u0107 niebezpieczna (<a rel=\"nofollow\" href=\"https:\/\/blog.rust-lang.org\/2019\/07\/04\/Rust-1.36.0.html#maybeuninitt%3E-instead-of-mem::uninitialized\">wi\u0119cej informacji<\/a>), dlatego stabilizowano typ MaybeUninit, kt\u00f3ry jest bezpieczniejszy. <br \/> Ponadto z racji, \u017ce MaybeUninit jest bezpieczniejsz\u0105 alternatyw\u0105, pocz\u0105wszy od Rust 1.38, mem::uninitialized stanie si\u0119 przestarza\u0142\u0105 funkcj\u0105. <br \/> Je\u015bli chcesz dowiedzie\u0107 si\u0119 wi\u0119cej o nieinicjalizowanej pami\u0119ci, mo\u017cesz przeczyta\u0107 wpis na blogu (Alexis Beingessner).\n   <\/li>\n<li> NLL dla Rust 2015. <br \/> W og\u0142oszeniu <a rel=\"nofollow\" href=\"https:\/\/blog.rust-lang.org\/2018\/12\/06\/Rust-1.31-and-rust-2018.html#non-lexical-lifetimes\">Rust 1.31.0<\/a> deweloperzy opowiadali nam o NLL (Non-Lexical Lifetime), udoskonaleniu dla j\u0119zyka, kt\u00f3re sprawia, \u017ce borrow checker jest m\u0105drzejszy i bardziej przyjazny dla u\u017cytkownika. Przyk\u0142ad:<br \/>\nfn main() {<br \/>\n    let mut x = 5;<br \/>\n    let y = &amp;x;<br \/>\n    let z = &amp;mut x; \/\/ To nie by\u0142o dozwolone przed 1.31.0.<br \/>\n}<\/p>\n<p>W 1.31.0 NLL dzia\u0142a\u0142 tylko w Rust 2018, z obietnic\u0105, \u017ce deweloperzy dodadz\u0105 wsparcie r\u00f3wnie\u017c dla Rust 2015. <br \/> Je\u015bli chcesz dowiedzie\u0107 si\u0119 wi\u0119cej o NLL, mo\u017cesz przeczyta\u0107 wi\u0119cej w tym <a rel=\"nofollow\" href=\"http:\/\/blog.pnkfx.org\/blog\/2019\/06\/26\/breaking-news-non-lexical-lifetimes-arrives-for-everyone\/\"> wpisie na blogu<\/a> (Felix Klocks).\n    <\/li>\n<li>Nowy flaga dla Cargo &#8212; &#8212;offline.<br \/>W Rust 1.36 stabilizowano nowy flaga dla Cargo. Flaga &#8212;offline informuje Cargo, aby u\u017cywa\u0142o lokalnie zbuforowanych zale\u017cno\u015bci, aby mog\u0142y by\u0107 p\u00f3\u017aniej u\u017cywane bez dost\u0119pu do internetu. Kiedy potrzebne zale\u017cno\u015bci nie s\u0105 dost\u0119pne offline, a je\u015bli internet jest potrzebny, Cargo zwr\u00f3ci b\u0142\u0105d. Aby wst\u0119pnie pobra\u0107 zale\u017cno\u015bci, mo\u017cna u\u017cy\u0107 polecenia cargo fetch, kt\u00f3re pobierze wszystkie zale\u017cno\u015bci.\n    <\/li>\n<li><a rel=\"nofollow\" href=\"https:\/\/github.com\/rust-lang\/cargo\/blob\/master\/CHANGELOG.md#cargo-136-2019-07-04\">Tutaj<\/a> mo\u017cesz przeczyta\u0107 bardziej szczeg\u00f3\u0142owy przegl\u0105d zmian.\n<\/li>\n<\/ul>\n<p>\nS\u0105 tak\u017ce zmiany w standardowej bibliotece:\n<\/p>\n<ul>\n<li> Teraz makro dbg!() mo\u017ce przyjmowa\u0107 wiele argument\u00f3w.\n    <\/li>\n<li> Niekt\u00f3re API s\u0105 teraz oznaczone jako const:\n<ul>\n<li><a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/core\/alloc\/struct.Layout.html#method.from_size_align_unchecked\">Layout::from_size_align_unchecked<\/a>;\n        <\/li>\n<li> <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/mem\/fn.needs_drop.html\">mem::needs_drop<\/a>;\n        <\/li>\n<li> <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/ptr\/struct.NonNull.html#method.dangling\">NonNull::dangling<\/a>;\n        <\/li>\n<li> <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/ptr\/struct.NonNull.html#method.cast\">NonNull::cast<\/a>.\n        <\/li>\n<\/ul>\n<\/li>\n<li>Nowe API, kt\u00f3re zosta\u0142y ustabilizowane:\n<ul>\n<li> <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/task\/struct.Waker.html\">task::Waker<\/a> i <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/task\/enum.Poll.html\">task::Poll<\/a>;\n        <\/li>\n<li> <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/collections\/struct.VecDeque.html#method.rotate_left\"> VecDeque::rotate_left<\/a> i <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/collections\/struct.VecDeque.html#method.rotate_right\">VecDeque::rotate_right<\/a>;\n       <\/li>\n<li> <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/io\/trait.Read.html#method.read_vectored\">Read::read_vectored<\/a> i <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/io\/trait.Write.html#method.write_vectored\">Write::write_vectored<\/a>;\n       <\/li>\n<li> <a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/iter\/trait.Iterator.html#method.copied\">Iterator::copied<\/a>;\n       <\/li>\n<li><a rel=\"nofollow\" href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/60404\">BorrowMut dla String<\/a>;\n       <\/li>\n<li><a rel=\"nofollow\" href=\"https:\/\/doc.rust-lang.org\/std\/primitive.str.html#method.as_mut_ptr\">str::as_mut_ptr<\/a>.\n       <\/li>\n<\/ul>\n<\/li>\n<li> Inne zmiany w standardowej bibliotece mo\u017cesz znale\u017a\u0107 <a rel=\"nofollow\" href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1360-2019-07-04\">tutaj<\/a>.\n<\/li>\n<\/ul>\n<p>\nInne zmiany <a rel=\"nofollow\" href=\"https:\/\/github.com\/rust-lang\/rust\/blob\/master\/RELEASES.md#version-1360-2019-07-04\">Rust<\/a>, <a rel=\"nofollow\" href=\"https:\/\/github.com\/rust-lang\/cargo\/blob\/master\/CHANGELOG.md#cargo-136-2019-07-04\">Cargo<\/a> i <a rel=\"nofollow\" href=\"https:\/\/github.com\/rust-lang\/rust-clippy\/blob\/master\/CHANGELOG.md#rust-136\">Clippy<\/a>.\n<\/p>\n<p>\u0179r\u00f3d\u0142o: <a \ncontent=\"nofollow\" rel=\"nofollow\" href=\"http:\/\/www.linux.org.ru\/news\/development\/15090750\">linux.org.ru<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u043c Rust 1.36! \u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 Rust 1.36? \u0421\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0442\u0440\u0435\u0439\u0442 Future, \u0438\u0437 \u043d\u043e\u0432\u043e\u0433\u043e: \u043a\u0440\u0435\u0439\u0442 alloc, MaybeUninit&lt;T&gt;, NLL \u0434\u043b\u044f Rust 2015, \u043d\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f HashMap&lt;K, V&gt; \u0438 \u043d\u043e\u0432\u044b\u0439 \u0444\u043b\u0430\u0433 &#8212;offline \u0434\u043b\u044f Cargo. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: \u0412 Rust 1.36 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0442\u0440\u0435\u0439\u0442 Future. \u041a\u0440\u0435\u0439\u0442 alloc. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Rust 1.36, \u0447\u0430\u0441\u0442\u0438 std, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-35875","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u043c Rust 1.36!\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 Rust 1.36?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/pl\/blog\/news\/rust-1-36\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"pl_PL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47Rust 1.36 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u043c Rust 1.36!\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 Rust 1.36?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/pl\/blog\/news\/rust-1-36\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T19:07:21+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T19:07:21+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Rust 1.36 | ProHoster","description":"Zesp\u00f3\u0142 deweloper\u00f3w z rado\u015bci\u0105 przedstawia Rust 1.36! Co nowego w Rust 1.36?","canonical_url":"https:\/\/prohoster.info\/pl\/blog\/news\/rust-1-36","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"pl_PL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47Rust 1.36 | ProHoster","og:description":"\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u043c Rust 1.36!\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 Rust 1.36?","og:url":"https:\/\/prohoster.info\/pl\/blog\/news\/rust-1-36","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T19:07:21+00:00","article:modified_time":"2019-10-31T19:07:21+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"35875","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-22 01:07:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 19:44:26","updated":"2026-01-22 01:07:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/pl\/wp-json\/wp\/v2\/posts\/35875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/pl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/pl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pl\/wp-json\/wp\/v2\/comments?post=35875"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/pl\/wp-json\/wp\/v2\/posts\/35875\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/pl\/wp-json\/wp\/v2\/media?parent=35875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/pl\/wp-json\/wp\/v2\/categories?post=35875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/pl\/wp-json\/wp\/v2\/tags?post=35875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}