{"id":296873,"date":"2020-01-08T21:00:10","date_gmt":"2020-01-08T21:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296873"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-01-08T21:00:10","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296873","title":{"rendered":"\u041f\u0435\u0440\u0435\u043d\u043e\u0441 Quake 3 \u043d\u0430 Rust"},"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\/483142\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d2c\/61d\/a4f\/d2c61da4f8dfcdfb39d9fbd7787070a4.png\"><\/div>\n<p>  \u041d\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Immunant \u043b\u044e\u0431\u0438\u0442 Rust \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0434 C2Rust \u2014 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u0431\u0435\u0440\u0443\u0449\u0438\u043c \u043d\u0430 \u0441\u0435\u0431\u044f \u0432\u0441\u044e \u0440\u0443\u0442\u0438\u043d\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Rust. \u041c\u044b \u0441\u0442\u0440\u0435\u043c\u0438\u043c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0432 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 Rust \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Rust. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u0435\u043b\u043a\u0438\u0445 CLI-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445 \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 Rust \u0438\u0433\u0440\u0443 Quake 3. \u0421\u043f\u0443\u0441\u0442\u044f \u043f\u0430\u0440\u0443 \u0434\u043d\u0435\u0439 \u043c\u044b, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0441\u0442\u0430\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u043c\u0438, \u043a\u043e\u043c\u0443 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u044b\u0433\u0440\u0430\u0442\u044c \u0432 Quake3 \u043d\u0430 Rust!<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430: \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 Quake 3<\/h2>\n<p>  \u0418\u0437\u0443\u0447\u0438\u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e Quake 3 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043a\u043e\u0432, \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 <a href=\"https:\/\/ioquake3.org\/\">ioquake3<\/a>. \u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0444\u043e\u0440\u043a Quake 3, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0441\u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u0432\u0438\u0434\u0435:<\/p>\n<pre><code class=\"bash\">$ make release<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 ioquake3 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code class=\"bash\">$ tree --prune -I missionpack -P \"*.so|*x86_64\" . \u2514\u2500\u2500 build     \u2514\u2500\u2500 debug-linux-x86_64         \u251c\u2500\u2500 baseq3         \u2502   \u251c\u2500\u2500 cgamex86_64.so          # client         \u2502   \u251c\u2500\u2500 qagamex86_64.so         # game server         \u2502   \u2514\u2500\u2500 uix86_64.so             # ui         \u251c\u2500\u2500 ioq3ded.x86_64              # dedicated server binary         \u251c\u2500\u2500 ioquake3.x86_64             # main binary         \u251c\u2500\u2500 renderer_opengl1_x86_64.so  # opengl1 renderer         \u2514\u2500\u2500 renderer_opengl2_x86_64.so  # opengl2 renderer<\/code><\/pre>\n<p>  \u0421\u0440\u0435\u0434\u0438 \u044d\u0442\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 UI, \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u043b\u0438 \u043a\u0430\u043a \u0441\u0431\u043e\u0440\u043a\u0443 <a href=\"https:\/\/fabiensanglard.net\/quake3\/qvm.php\">Quake VM<\/a>, \u0438\u043b\u0438 \u043a\u0430\u043a \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f X86. \u0412 \u0441\u0432\u043e\u0451\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438. \u0422\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 VM \u043d\u0430 Rust \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 QVM-\u0432\u0435\u0440\u0441\u0438\u0439 \u0431\u044b\u043b\u0438 \u0431\u044b \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0449\u0435, \u043d\u043e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c C2Rust.<\/p>\n<p>  \u0412 \u0441\u0432\u043e\u0451\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u043c\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043b\u0438\u0441\u044c \u043d\u0430 UI, \u0438\u0433\u0440\u0435, \u043a\u043b\u0438\u0435\u043d\u0442\u0435, OpenGL1-\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u0435 \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 OpenGL2-\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440, \u043d\u043e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u0444\u0430\u0439\u043b\u043e\u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432 <code>.glsl<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0430 C. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 GLSL \u0432 \u0441\u0442\u0440\u043e\u043a\u0438 Rust, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 OpenGL1-\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u0430 \u0438 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0438\u0433\u0440\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u0438\u0441\u0441\u0438\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0445 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0438 \u043e\u043d\u0438 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u0422\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c Quake 3<\/h2>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u0432 Quake 3, \u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u0430\u043a \u0438 \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0434\u0438\u043d \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a C2Rust \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0444\u0430\u0439\u043b\u044b \u0441\u0431\u043e\u0440\u043a\u0438 Cargo, \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e Rust crate \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c <code>Cargo.toml<\/code>.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b C2Rust \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 crate \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0435\u043c\u0443 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439).<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043e\u0434\u043d\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c, \u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u043c \u0442\u0435\u043c, \u043a\u0430\u043a C2Rust \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438: C2Rust \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0444\u0430\u0439\u043b <a href=\"https:\/\/sarcasm.github.io\/notes\/dev\/compilation-database.html\">\u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <strong>\u0442\u043e\u043b\u044c\u043a\u043e<\/strong> \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0431\u0435\u0437 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a\u0430. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0445 \u044d\u0442\u0443 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u043c\u0435\u044e\u0442 \u044d\u0442\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>cmake<\/code> \u0441 <code>CMAKE_EXPORT_COMPILE_COMMANDS<\/code>, <code>bear<\/code> \u0438 <code>compiledb<\/code>. \u041f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/Ericsson\/codechecker\/tree\/master\/analyzer\/tools\/build-logger\"><code>build-logger<\/code><\/a>, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 <code>CodeChecker<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443\u0437\u043d\u0430\u043b\u0438 \u043e \u043d\u0451\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043e\u0431\u0451\u0440\u0442\u043e\u043a (\u043e \u043d\u0438\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0438\u0436\u0435). \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u043b\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 C \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b <code>compile_commands.json<\/code>, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043b\u044e\u0431\u044b\u043c \u0438\u0437 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043e\u0431\u0451\u0440\u0442\u043e\u043a <a href=\"https:\/\/github.com\/immunant\/c2rust\/blob\/master\/scripts\/cc-wrappers\/cc\">\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/a> \u0438 <a href=\"https:\/\/github.com\/immunant\/c2rust\/blob\/master\/scripts\/cc-wrappers\/ld\">\u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043c\u043f\u044f\u0442 \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a\u0430 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0435\u0433\u043e \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 <code>compile_commands.json<\/code>. \u0412\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435:<\/p>\n<pre><code class=\"bash\">$ make release<\/code><\/pre>\n<p>  \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438:<\/p>\n<pre><code class=\"bash\">$ make release CC=\/path\/to\/C2Rust\/scripts\/cc-wrappers\/cc<\/code><\/pre>\n<p>  \u041e\u0431\u0451\u0440\u0442\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 JSON, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043d\u0430 \u0432\u044b\u0437\u043e\u0432. \u0412\u0442\u043e\u0440\u043e\u0439 <a href=\"https:\/\/github.com\/immunant\/c2rust\/blob\/master\/scripts\/convert_build_commands.py\">\u0441\u043a\u0440\u0438\u043f\u0442<\/a> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435\u0445 \u0438\u0445 \u0432 \u043e\u0434\u0438\u043d \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b <code>compile_commands.json<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043b\u0438 C2Rust, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 crate \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, C2Rust \u0442\u0435\u043f\u0435\u0440\u044c \u0435\u0449\u0451 \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0444\u0430\u0439\u043b <code>build.rs<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e crate.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u0441\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u0430 \u0440\u0430\u0437, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0432 \u0438\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 <a href=\"https:\/\/doc.rust-lang.org\/book\/ch14-03-cargo-workspaces.html\">workspace<\/a>. C2Rust \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0444\u0430\u0439\u043b workspace <code>Cargo.toml<\/code> \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>cargo build<\/code> \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>quake3-rs<\/code>:<\/p>\n<pre><code class=\"bash\">$ tree -L 1 . \u251c\u2500\u2500 Cargo.lock \u251c\u2500\u2500 Cargo.toml \u251c\u2500\u2500 cgamex86_64 \u251c\u2500\u2500 ioquake3 \u251c\u2500\u2500 qagamex86_64 \u251c\u2500\u2500 renderer_opengl1_x86_64 \u251c\u2500\u2500 rust-toolchain \u2514\u2500\u2500 uix86_64  $ cargo build --release<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0423\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c \u0448\u0435\u0440\u043e\u0445\u043e\u0432\u0430\u0442\u043e\u0441\u0442\u0438<\/h2>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0442\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u0430\u0440\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 Quake 3: \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 C2Rust \u043d\u0435 \u043c\u043e\u0433 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c (\u043d\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u043d\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0445\u043e\u0442\u044c \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c).<\/p>\n<h3>\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u044b<\/h3>\n<p>  \u0412 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0412\u043e\u0442 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 C:<\/p>\n<pre><code class=\"cpp\">int array[1024]; int *p;  \/\/ ...  if (p &gt;= &amp;array[1024]) {    \/\/ error... }<\/code><\/pre>\n<p>  \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C (\u0441\u043c., \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"http:\/\/www.iso-9899.info\/n1570.html\">C11, Section 6.5.6<\/a>) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u043a\u043e\u043d\u0435\u0446 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041e\u0434\u043d\u0430\u043a\u043e Rust \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u044d\u0442\u043e, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0440\u0451\u043c \u0430\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041c\u044b \u043d\u0430\u0448\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/github.com\/immunant\/ioq3\/blob\/quake3-rs\/code\/botlib\/be_aas_sample.c#L645\"><code>AAS_TraceClientBBox<\/code><\/a>.<\/p>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Rust \u0442\u0430\u043a\u0436\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 <a href=\"https:\/\/github.com\/immunant\/ioq3\/blob\/quake3-rs\/code\/game\/g_mover.c#L131\"><code>G_TryPushingEntity<\/code><\/a>, \u0433\u0434\u0435 \u0443\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434 <code>&gt;<\/code>, \u0430 \u043d\u0435 <code>&gt;=<\/code>. \u0412\u044b\u0448\u0435\u0434\u0448\u0438\u0439 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0442\u0435\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u0433\u043e\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c, \u043c\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0442\u043e\u0440 C2Rust \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0430 \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u00ab\u0430\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0437\u0430 \u043a\u043e\u043d\u0446\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u00bb, \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439.<\/p>\n<h3>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b<\/h3>\n<p>  \u041c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0438\u0433\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 panic \u043e\u0442 Rust:<\/p>\n<pre><code class=\"cpp\">thread 'main' panicked at 'index out of bounds: the len is 4 but the index is 4', quake3-client\/src\/cm_polylib.rs:973:17<\/code><\/pre>\n<p>  \u0412\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 <code>cm_polylib.c<\/code>, \u043c\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435 <code>p<\/code> \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435:<\/p>\n<pre><code class=\"cpp\">typedef struct { \tint\t\tnumpoints; \tvec3_t\tp[4];\t\t\/\/ variable sized } winding_t;<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435 <code>p<\/code> \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u2014 \u044d\u0442\u043e \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0434\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 C99 \u0432\u0435\u0440\u0441\u0438\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Flexible_array_member\">\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b<\/a> (flexible array member), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f <code>gcc<\/code>. C2Rust \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0441 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c C99 (<code>vec3_t p[]<\/code>) \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e <a href=\"https:\/\/github.com\/immunant\/c2rust\/blob\/master\/c2rust-transpile\/src\/c_ast\/mod.rs#L363\">\u044d\u0432\u0440\u0438\u0441\u0442\u0438\u043a\u0443<\/a>, \u0447\u0442\u043e\u0431\u044b \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0434\u043e C99 (\u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 0 \u0438 1 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440; \u0442\u0430\u043a\u0436\u0435 \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 ioquake3).<\/p>\n<p>  <a href=\"https:\/\/github.com\/immunant\/ioq3\/commit\/ace1fae43e736613544c8d33cc69dee794f5124a\">\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 C99 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u043b\u043e panic:<\/p>\n<pre><code class=\"cpp\">typedef struct { \tint\t\tnumpoints; \tvec3_t\tp[];\t\t\/\/ variable sized } winding_t;<\/code><\/pre>\n<p>  \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 (\u043f\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043e\u0442 0 \u0438 1) \u0431\u0443\u0434\u0435\u0442 \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 C \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043a\u0430\u043a \u043c\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0441 ioquake3.<\/p>\n<h3>Tied Operands \u0432\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u043c \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u043c \u043a\u043e\u0434\u0435<\/h3>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u043d\u0438\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0441\u0431\u043e\u0435\u0432 \u0431\u044b\u043b \u044d\u0442\u043e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 C \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 <code>\/usr\/include\/bits\/select.h<\/code>:<\/p>\n<pre><code class=\"cpp\"># define __FD_ZERO(fdsp)                                            \\   do {                                                              \\     int __d0, __d1;                                                 \\     __asm__ __volatile__ (\"cld; rep; \" __FD_ZERO_STOS               \\                           : \"=c\" (__d0), \"=D\" (__d1)                \\                           : \"a\" (0), \"0\" (sizeof (fd_set)           \\                                           \/ sizeof (__fd_mask)),    \\                             \"1\" (&amp;__FDS_BITS (fdsp)[0])             \\                           : \"memory\");                              \\   } while (0)<\/code><\/pre>\n<p>  \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430 <code>__FD_ZERO<\/code>. \u042d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0434\u043a\u0438\u0439 \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 <code>gcc<\/code>: <a href=\"https:\/\/gcc.gnu.org\/onlinedocs\/gcc\/Extended-Asm.html#InputOperands\">tied operands \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430<\/a> \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438. \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0432\u044b\u0432\u043e\u0434\u0430 <code>\"=D\" (__d1)<\/code> \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <code>edi<\/code> \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>__d1<\/code> \u043a\u0430\u043a 32-\u0431\u0438\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0430 <code>\"1\" (&amp;__FDS_BITS (fdsp)[0])<\/code> \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043a \u0430\u0434\u0440\u0435\u0441\u0443 <code>fdsp-&gt;fds_bits<\/code> \u043a\u0430\u043a 64-\u0431\u0438\u0442\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. <code>gcc<\/code> \u0438 <code>clang<\/code> \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0442 \u044d\u0442\u043e \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435. \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f 64-\u0431\u0438\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <code>rdi<\/code> \u0438 \u0443\u0441\u0435\u043a\u0430\u044f \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>__d1<\/code>, \u0430 Rust \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443 LLVM, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c. \u0412 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043a\u0430\u0445 (\u043d\u0435 \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u043b\u0438 \u0441\u0435\u0431\u044f \u0445\u043e\u0440\u043e\u0448\u043e) \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u043e\u0431\u0430 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443 <code>edi<\/code>, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0443\u0441\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0434\u043e 32 \u0431\u0438\u0442 \u043f\u0435\u0440\u0435\u0434 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0431\u043e\u0438.<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a <code>rustc<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 Rust \u0432 LLVM \u0441 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432 C2Rust. \u041c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 crate <a href=\"https:\/\/github.com\/immunant\/c2rust\/tree\/master\/c2rust-asm-casts\"><code>c2rust-asm-casts<\/code><\/a>, \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0449\u0438\u0439 \u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0442\u0438\u043f\u043e\u0432 Rust, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0439 <a href=\"https:\/\/github.com\/immunant\/c2rust\/blob\/master\/c2rust-asm-casts\/src\/lib.rs#L13\">trait<\/a> \u0438 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0435 \u0438 \u0443\u0441\u0435\u043a\u0430\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f tied operands \u0434\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0435\u043b\u0438\u043a, \u0447\u0442\u043e\u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0431\u0430 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u0434 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"rust\">let mut __d0: c_int = 0; let mut __d1: c_int = 0; \/\/ Reference to the output value of the first operand let fresh5 = &amp;mut __d0; \/\/ The internal storage for the first tied operand let fresh6; \/\/ Reference to the output value of the second operand let fresh7 = &amp;mut __d1; \/\/ The internal storage for the second tied operand let fresh8; \/\/ Input value of the first operand let fresh9 = (::std::mem::size_of::&lt;fd_set&gt;() as c_ulong).wrapping_div(::std::mem::size_of::&lt;__fd_mask&gt;() as c_ulong); \/\/ Input value of the second operand let fresh10 = &amp;mut *fdset.__fds_bits.as_mut_ptr().offset(0) as *mut __fd_mask; asm!(\"cld; rep; stosq\"      : \"={cx}\" (fresh6), \"={di}\" (fresh8)      : \"{ax}\" (0),        \/\/ Cast the input operands into the internal storage type        \/\/ with optional zero- or sign-extension        \"0\" (AsmCast::cast_in(fresh5, fresh9)),        \"1\" (AsmCast::cast_in(fresh7, fresh10))      : \"memory\"      : \"volatile\"); \/\/ Cast the operands out (types are inferred) with truncation AsmCast::cast_out(fresh5, fresh9, fresh6); AsmCast::cast_out(fresh7, fresh10, fresh8);<\/code><\/pre>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0438\u0445 \u043d\u0430 \u0432\u044b\u0432\u043e\u0434 \u0442\u0438\u043f\u043e\u0432 Rust (\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u0438\u043f\u043e\u0432 <code>fresh6<\/code> \u0438 <code>fresh8<\/code>).<\/p>\n<h3>\u0412\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/h3>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0441\u0431\u043e\u0435\u0432 \u0431\u044b\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u0445\u0440\u0430\u043d\u044f\u0449\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 SSE:<\/p>\n<pre><code class=\"cpp\">static unsigned char ssemask[16] __attribute__((aligned(16))) = { \t\"\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\x00\\x00\\x00\\x00\" };<\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f Rust \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043d\u043e \u043d\u0435 \u0434\u043b\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0442.\u0435. \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <code>static<\/code>. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043b\u0438 \u0432 Rust, \u0438\u043b\u0438 \u0432 C2Rust, \u043d\u043e \u0432 ioquake3 \u043f\u043e\u043a\u0430 \u0440\u0435\u0448\u0438\u043b\u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0451 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c <a href=\"https:\/\/github.com\/immunant\/ioq3\/blob\/master\/asm-snapvector.patch\">patch<\/a>. \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b patch \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 Rust <code>ssemask<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<pre><code class=\"rust\">#[repr(C, align(16))] struct SseMask([u8; 16]); static mut ssemask: SseMask = SseMask([     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, ]);<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a quake3-rs<\/h2>\n<p>  \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 <code>cargo build --release<\/code> \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043d\u043e \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0434 <code>target\/release<\/code> \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>ioquake3<\/code> \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442. \u041c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 <a href=\"https:\/\/github.com\/immunant\/ioq3\/blob\/master\/make_quake3_rs_links.sh\">\u0441\u043a\u0440\u0438\u043f\u0442<\/a>, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0444\u0430\u0439\u043b\u044b <code>.pk3<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438\u0433\u0440\u044b):<\/p>\n<pre><code class=\"bash\">$ \/path\/to\/make_quake3_rs_links.sh \/path\/to\/quake3-rs\/target\/release \/path\/to\/paks<\/code><\/pre>\n<p>  \u041f\u0443\u0442\u044c <code>\/path\/to\/paks<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0444\u0430\u0439\u043b\u044b <code>.pk3<\/code>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0438\u0433\u0440\u0443! \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c <code>+set vm_game 0<\/code> \u0438 \u0442.\u043f., \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u044d\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u043a\u0430\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Rust, \u0430 \u043d\u0435 \u043a\u0430\u043a \u0441\u0431\u043e\u0440\u043a\u0443 QVM, \u0430 \u0442\u0430\u043a\u0436\u0435 <code>cl_renderer<\/code> \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f OpenGL1-\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u0430.<\/p>\n<pre><code class=\"bash\">$ .\/ioquake3 +set sv_pure 0 +set vm_game 0 +set vm_cgame 0 +set vm_ui 0 +set cl_renderer \"opengl1\"<\/code><\/pre>\n<p>  \u0418\u2026<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/18e\/fb3\/94c\/18efb394c9f33f6a1cbe78503a25bb4c.png\"><\/div>\n<p>  \u041c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 Quake3 \u043d\u0430 Rust!<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d2c\/61d\/a4f\/d2c61da4f8dfcdfb39d9fbd7787070a4.png\"><\/div>\n<p>  \u0412\u043e\u0442 \u0432\u0438\u0434\u0435\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c Quake 3, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438\u0433\u0440\u0443 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432 \u043d\u0435\u0451 \u0438\u0433\u0440\u0430\u0435\u043c:<\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/lQjvSJLDXW4?rel=0&amp;showinfo=1&amp;hl=en-US\" style=\"border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;\" allowfullscreen scrolling=\"no\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  \u041c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c <a href=\"https:\/\/github.com\/immunant\/ioq3\/tree\/transpiled\/quake3-rs\">\u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/a> \u0432 \u0432\u0435\u0442\u043a\u0435 <code>transpiled<\/code> \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0432\u0435\u0442\u043a\u0430 <code>refactored<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0442\u0435 \u0436\u0435 <a href=\"https:\/\/github.com\/immunant\/ioq3\/tree\/refactored\/quake3-rs\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/a> \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u043c\u0438 <a href=\"https:\/\/github.com\/immunant\/ioq3\/blob\/transpiled\/refactor_commands.txt\">\u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/a>.<\/p>\n<h2>\u041a\u0430\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0446\u0438\u044e<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c Quake 3 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u043e \u0443\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b Quake 3 \u0438\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0434\u0435\u043c\u043e \u0438\u0437 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c C2Rust (\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0430\u044f nightly-\u0432\u0435\u0440\u0441\u0438\u044f \u2014 \u044d\u0442\u043e <code>nightly-2019-12-05<\/code>, \u043d\u043e \u043c\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/immunant\/c2rust\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a> C2Rust \u0438\u043b\u0438 \u0432 <a href=\"https:\/\/crates.io\/crates\/c2rust\">crates.io<\/a>, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0441\u0430\u043c\u0443\u044e \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e):<\/p>\n<pre><code class=\"bash\">$ cargo +nightly-2019-12-05 install c2rust<\/code><\/pre>\n<p>  \u0438 \u043a\u043e\u043f\u0438\u0438 \u043d\u0430\u0448\u0438\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 C2Rust \u0438 ioquake3:<\/p>\n<pre><code class=\"bash\">$ git clone &lt;a href=\"\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"dcbbb5a89cbbb5a8b4a9bef2bfb3b1\"&gt;[email\u00a0protected]&lt;\/a&gt;:immunant\/c2rust.git $ git clone &lt;a href=\"\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"dcbbb5a89cbbb5a8b4a9bef2bfb3b1\"&gt;[email\u00a0protected]&lt;\/a&gt;:immunant\/ioq3.git<\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 <code>c2rust<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c C2Rust \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>cargo build --release<\/code>. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 C2Rust \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043e\u0431\u0451\u0440\u0442\u043e\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0446\u0438\u0438 ioquake3.<\/p>\n<p>  \u041c\u044b \u0432\u044b\u043b\u043e\u0436\u0438\u043b\u0438 <a href=\"https:\/\/github.com\/immunant\/ioq3\/blob\/master\/transpile.sh\">\u0441\u043a\u0440\u0438\u043f\u0442<\/a>, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043d\u0430 C \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0439 \u043f\u0430\u0442\u0447 <code>ssemask<\/code>. \u0427\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u0437 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <code>ioq3<\/code>:<\/p>\n<pre><code class=\"bash\">$ .\/transpile.sh &lt;\/path\/to\/C2Rust repository&gt; &lt;\/path\/to\/c2rust binary&gt;<\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433 <code>quake3-rs<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043a\u043e\u0434 \u043d\u0430 Rust, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>cargo build --release<\/code> \u0438 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0448\u0430\u0433\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435.<\/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\/483142\/\"> https:\/\/habr.com\/ru\/post\/483142\/<\/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\/483142\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d2c\/61d\/a4f\/d2c61da4f8dfcdfb39d9fbd7787070a4.png\"><\/div>\n<p>  \u041d\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Immunant \u043b\u044e\u0431\u0438\u0442 Rust \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0434 C2Rust \u2014 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u0431\u0435\u0440\u0443\u0449\u0438\u043c \u043d\u0430 \u0441\u0435\u0431\u044f \u0432\u0441\u044e \u0440\u0443\u0442\u0438\u043d\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Rust. \u041c\u044b \u0441\u0442\u0440\u0435\u043c\u0438\u043c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0432 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 Rust \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Rust. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u0435\u043b\u043a\u0438\u0445 CLI-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445 \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 Rust \u0438\u0433\u0440\u0443 Quake 3. \u0421\u043f\u0443\u0441\u0442\u044f \u043f\u0430\u0440\u0443 \u0434\u043d\u0435\u0439 \u043c\u044b, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0441\u0442\u0430\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u043c\u0438, \u043a\u043e\u043c\u0443 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u044b\u0433\u0440\u0430\u0442\u044c \u0432 Quake3 \u043d\u0430 Rust!<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430: \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 Quake 3<\/h2>\n<p>  \u0418\u0437\u0443\u0447\u0438\u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e Quake 3 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043a\u043e\u0432, \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 <a href=\"https:\/\/ioquake3.org\/\">ioquake3<\/a>. \u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0444\u043e\u0440\u043a Quake 3, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\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-296873","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296873","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=296873"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296873\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}