{"id":45406,"date":"2023-08-03T10:19:16","date_gmt":"2022-11-09T23:05:31","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/"},"modified":"2024-04-30T16:45:06","modified_gmt":"2024-04-30T08:45:06","slug":"45406-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/","title":{"rendered":""},"content":{"rendered":"<h1>\u306f\u3058\u3081\u306b<\/h1>\n<p>\u6700\u8fd1\u3001\u4e16\u9593\u304b\u3089\u6ce8\u76ee\u3055\u308c\u3066\u3044\u308b\u8a00\u8a9e\u3092\u3044\u308d\u3044\u308d\u773a\u3081\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u306a\u304b\u3067\u79c1\u304c\u8208\u5473\u3092\u6301\u3063\u305f\u8a00\u8a9e\u306fScala\u3068Rust\u3067\u3057\u305f\u3002\u305d\u306e\u3046\u3061\u306eScala\u306e\u307b\u3046\u306f\u3001\u4f8b\u306eScala\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3063\u3066\u672c\u304c\u975e\u5e38\u306b\u826f\u304f\u3067\u304d\u3066\u3044\u3066\u3001\u3042\u308c\u4e00\u518a\u8aad\u3080\u3068\u3001\u3082\u3046\u305d\u308c\u3060\u3051\u3067\u4f55\u3068\u306a\u304f\u5206\u304b\u3063\u305f\u3088\u3046\u306a\u6c17\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u8a33\u3067\u3059\u3002\u5f93\u3063\u3066\u3001\u300c\u56db\u306e\u4e94\u306e\u8a00\u308f\u305aScala\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u8aad\u3081\u300d\u3067\u6e08\u3093\u3067\u3057\u307e\u3046\u3002<\/p>\n<p>\u3082\u3046\u4e00\u65b9\u306eRust\u306e\u65b9\u306f\u3001\u4f8b\u306e\u672c1\u3092\u8aad\u3093\u3067\u3082\u8151\u306b\u843d\u3061\u306a\u3044\u90e8\u5206\u304c\u3044\u3063\u3071\u3044\u3042\u308b\u3057\u3001\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30de\u30cb\u30e5\u30a2\u30eb\u3082\u305d\u308c\u307b\u3069\u983c\u308a\u306b\u306a\u3089\u306a\u30442\u72b6\u6cc1\u3067\u3001\u3053\u308c\u306f\u3061\u3087\u3063\u3068\u697d\u3057\u307f\u304c\u3044\u304c\u3042\u308b\u304b\u306a\u3001\u3068\u601d\u3063\u305f\u6b21\u7b2c\u3002\u601d\u3048\u3070\u300120\u5e74\u307b\u3069\u524d\u3001\u307e\u3060ISO\u898f\u683c\u306b\u3082\u306a\u3063\u3066\u3044\u306a\u3044C++\u3092\u624b\u63a2\u308a\u3067\uff08\u4ee5\u4e0b\u3001\u304a\u3063\u3055\u3093\u306e\u7e70\u8a00\u304c\u7d9a\u304f\u306e\u3067\u7701\u7565\uff09\u3002<\/p>\n<p>20\u5e74\u524d\u306eC++\u3068\u6bd4\u3079\u308b\u3068\u3001Rust\u306e\u73fe\u72b6\u306f\u3001\u65e2\u306b\u3053\u306e\u8a00\u8a9e\u3067\u66f8\u304b\u308c\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u305d\u308c\u306a\u308a\u306b\u8c4a\u5bcc\u306b\u5b58\u5728\u3057\u3066\u3001\u3057\u304b\u3082\u305d\u306e\u591a\u304f\u304c\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306a\u3068\u3053\u308d\u304c\u6075\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u304a\u624b\u672c\u304c\u305d\u306e\u8fba\u306b\u3044\u3063\u3071\u3044\u8ee2\u304c\u3063\u3066\u3044\u308b\u3002\u30bd\u30fc\u30b9\u3092\u8aad\u3081\u3066\u30ca\u30f3\u30dc\u306e\u4e16\u754c\u306b\u305a\u3063\u3068\u6d78\u304b\u3063\u3066\u3044\u305f\u8eab\u3068\u3057\u3066\u306f\u3001\u8aad\u3081\u308b\u30bd\u30fc\u30b9\u304c\u305f\u304f\u3055\u3093\u3042\u308b\u3068\u3044\u3046\u306e\u306f\u5927\u5909\u3042\u308a\u304c\u305f\u3044\u3002<\/p>\n<p>\u3055\u3066\u3001\u305d\u3093\u306a\u4e2d\u3067\u79c1\u304c\u8aad\u3080\u306e\u306b\u9078\u3093\u3060\u306e\u306fcargo\u3067\u3059\u3002\u4f55\u3067\u3053\u308c\u3092\u9078\u3093\u3060\u306e\u304b\u3068\u3044\u3046\u3068\u3001<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u305d\u308c\u306a\u308a\u306e\u898f\u6a21\u306e\u5b9f\u7528\u7684\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3042\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30af\u30bb\u30b9\u3084\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u89e3\u6790\u306a\u3069\u3001\u3044\u308d\u3044\u308d\u306a\u8981\u7d20\u304c\u5165\u3063\u3066\u3044\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">Rust\u306e\u516c\u5f0f\u306e\u30c4\u30fc\u30eb\u306a\u306e\u3067\u3001\u3053\u306e\u8a00\u8a9e\u306b\u9020\u8a63\u306e\u3042\u308b\u4eba\u9593\u304c\u66f8\u3044\u3066\u3044\u308b\u3068\u671f\u5f85\u3067\u304d\u308b<\/ul>\n<p>\u3068\u3044\u3046\u7406\u7531\u304b\u3089\u3067\u3059\u3002\u307e\u3042rustup\u306e\u65b9\u3067\u3082\u826f\u304b\u3063\u305f\u3093\u3067\u3059\u304c\u3001\u305d\u3053\u306f\u6c17\u5206\u306e\u554f\u984c\u3068\u3044\u3046\u3053\u3068\u3067\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u30bd\u30fc\u30b9\u3092\u8aad\u3080\u524d\u306e\u6bb5\u968e\u3068\u3057\u3066\u3001\u74b0\u5883\u69cb\u7bc9\u3092\u3084\u3063\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h1>\u524d\u63d0<\/h1>\n<p>\u30bd\u30fc\u30b9\u3092\u8aad\u3093\u3067\u3044\u304f\u3068\u3044\u3046\u90fd\u5408\u4e0a\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u56fa\u5b9a\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u5f8c\u3067\u4f55\u3092\u53c2\u7167\u3057\u3066\u3044\u305f\u306e\u304b\u5206\u304b\u3089\u306a\u304f\u306a\u308b\u306e\u3067\u3001\u3053\u3053\u3067\u306f\u6b21\u306e\u74b0\u5883\u306b\u56fa\u5b9a\u3057\u307e\u3059:<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u4f7f\u7528\u30b3\u30f3\u30d1\u30a4\u30e9: rustc 1.15.1<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u8aad\u3080\u30bd\u30fc\u30b9: cargo 0.16.0<\/ul>\n<p>\u3061\u3087\u3046\u30691.15.1\u304c\u51fa\u305f\u3070\u304b\u308a\u306a\u306e\u3067\u3001\u3057\u3070\u3089\u304f\u306f\u6b21\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u3053\u3068\u3092\u8003\u3048\u306a\u304f\u3066\u3082\u3044\u3044\u3067\u3059\u306d3\u3002<\/p>\n<h1>\u74b0\u5883\u69cb\u7bc9<\/h1>\n<p>\u307e\u3042\u3001\u5404\u81ea\u4f7f\u3044\u6163\u308c\u3066\u308b\u74b0\u5883\u3067\u3044\u3044\u3068\u601d\u3046\u3093\u3067\u3059\u3051\u3069\u3001grep\u3067\u6e08\u3093\u3060C\u8a00\u8a9e\u3042\u305f\u308a\u3068\u306f\u9055\u3063\u3066\u3001Rust\u306e\u5834\u5408\u3001\u30bf\u30b0\u30b8\u30e3\u30f3\u30d7\u3067\u30bd\u30fc\u30b9\u3092\u3069\u3093\u3069\u3093\u53c2\u7167\u3067\u304d\u308b\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u306a\u3044\u3068\u8aad\u3093\u3067\u3089\u308c\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u305d\u3046\u3044\u3046\u74b0\u5883\u3092\u4f5c\u308d\u3046\u3068\u601d\u3046\u3068\u3001\u79c1\u304c\u666e\u6bb5\u4f7f\u3063\u3066\u3044\u308bWindows\u3084NetBSD\u3060\u3068\u3001\u3061\u3087\u3063\u3068\u3044\u308d\u3044\u308d\u3057\u3093\u3069\u3044\u304b\u306a\u30fc\u3001\u3068\u3044\u3046\u6c17\u304c\u3057\u305f\u306e\u3067\u3001Windows\u306e\u30ce\u30fc\u30c8PC\u3067VirtualBox\u3092\u52d5\u304b\u30574\u3001\u305d\u3053\u306bXubuntu-16.04\u3092\u5165\u308c\u3066\u3001\u305d\u306e\u4e0a\u306b\u74b0\u5883\u3092\u4f5c\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u79c1\u306fEmacs\u3092\u305a\u3063\u3068\u4f7f\u3063\u3066\u304d\u305f\u306e\u3067\u3001\u6b21\u306e\u3088\u3046\u306a\u958b\u767a\u74b0\u5883\u3092\u4f5c\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f:<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Emacs24<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">rustup \/ cargo<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">rustfmt<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">racer<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">rust-mode<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">flycheck-rust<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">company-racer<\/ul>\n<p>\u4ee5\u4e0b\u3001\u9806\u756a\u306b\u6982\u8981\u3092\u8aac\u660e\u3057\u307e\u3059\u3002vim\u4f7f\u3044\u306e\u4eba\u306f\u9069\u5f53\u306b\u3084\u3063\u3068\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u524d\u6bb5\u968e<\/h2>\n<p>VirtualBox\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001Guest Addition\u3092\u30d3\u30eb\u30c9\u3059\u308b\u305f\u3081\u306b linux-headers-generic \u3068 build-essential \u3092\u5165\u308c\u305f\u306e\u3067\u3059\u304c\u3001cargo \u306e\u30d3\u30eb\u30c9\u306b\u3082\u3053\u3044\u3064\u3089\u306f\u5fc5\u8981\u306b\u306a\u308a\u305d\u3046\u306a\u6c17\u304c\u3059\u308b\u306e\u3067\u3001\u5b9f\u6a5f\u74b0\u5883\u3067\u3082\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u5165\u308c\u3066\u304a\u3044\u305f\u65b9\u304c\u3044\u3044\u3067\u3057\u3087\u3046:<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">% sudo apt-get install linux-headers-generic\r\n% sudo apt-get install build-essential\r\n<\/span><\/code><\/pre>\n<h2>Emacs\u74b0\u5883<\/h2>\n<p>Emacs\u3092\u5165\u308c\u307e\u3059\u3002\u3068\u8a00\u3063\u3066\u3082\u3001<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">% sudo apt-get install emacs24\r\n<\/span><\/code><\/pre>\n<p>\u3068\u3059\u308b\u3060\u3051\u3067\u3059\u304c\u3002Rust\u95a2\u9023\u4ee5\u5916\u306eEmacs\u306e\u57fa\u672c\u7684\u306a\u8a2d\u5b9a\u306b\u3064\u3044\u3066\u306f\u3001\u81ea\u5206\u306e\u666e\u6bb5\u4f7f\u3063\u3066\u3044\u308b.emacs.d\u3042\u305f\u308a\u3092\u6301\u3063\u3066\u304d\u3066\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\uff08\u6295\u3052\u3084\u308a\uff09\u3002\u306a\u304a\u3001\u79c1\u306f\u3053\u306e\u4ed6\u306b fonts-ricty-diminished \u3068 mozc-emacs \u3092\u5165\u308c\u307e\u3057\u305f\u3002<\/p>\n<h2>Rust\u958b\u767a\u74b0\u5883<\/h2>\n<p>\u6700\u521d\u306b rustup \u3092\u5165\u308c\u307e\u3059\u3002\u3053\u306e\u6bb5\u968e\u3067\u306f curl \u3082\u5165\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3057\u305f:<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">% sudo apt-get install curl\r\n% curl -sSf https:\/\/sh.rustup.rs | sh\r\n<\/span><\/code><\/pre>\n<p>\u3059\u308b\u3068\u3001 ~\/.cargo \u306b rustc \u3084 cargo \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u6bb5\u968e\u3067\u81ea\u52d5\u7684\u306b ~\/.profile \u306b\u74b0\u5883\u5909\u6570\u306e\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u304c\u3001\u30b7\u30a7\u30eb\u3092\u518d\u8d77\u52d5\u3057\u306a\u3044\u3068\u53cd\u6620\u3055\u308c\u306a\u3044\u305f\u3081\u3001\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u624b\u52d5\u3067\u73fe\u5728\u306e\u30b7\u30a7\u30eb\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u53cd\u6620\u3055\u305b\u307e\u3059(\u3082\u3061\u308d\u3093\u30b7\u30a7\u30eb\u3092\u518d\u8d77\u52d5\u3057\u3066\u3082\u3044\u3044\u3067\u3059):<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">% source ~\/.cargo\/env\r\n<\/span><\/code><\/pre>\n<p>\u6b21\u306b\u3001 rustfmt (\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u6574\u5f62\u30c4\u30fc\u30eb)\u3068 racer (\u88dc\u5b8c\u30c4\u30fc\u30eb)\u3092\u5165\u308c\u307e\u3059\u3002\u3053\u308c\u306f cargo \u3067\u7c21\u5358\u306b\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059:<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">% cargo install rustfmt\r\n% cargo install racer\r\n<\/span><\/code><\/pre>\n<p>\u3053\u308c\u3089\u3082 ~\/.cargo \u306e\u4e0b\u306b\u5165\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30bd\u30fc\u30b9\u3092\u8aad\u3093\u3067\u3044\u304f\u3068\u3001\u3069\u3046\u3057\u3066\u3082\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306ecrate\u3092\u53c2\u7167\u3057\u305f\u304f\u306a\u308b\u306e\u3067\u3001rustup \u3067 rust \u672c\u4f53\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3082\u5165\u308c\u3066\u304a\u304d\u307e\u3059:<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">% rustup component add rust-src\r\n<\/span><\/code><\/pre>\n<p>\u6700\u5f8c\u306b\u3001Emacs \u4e0a\u3067 Rust \u306e\u30bd\u30fc\u30b9\u3092\u8aad\u307f\u66f8\u304d\u3059\u308b\u305f\u3081\u306e\u30c4\u30fc\u30eb\u3092\u5165\u308c\u307e\u3059\u3002melpa \u304b\u3089\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u6301\u3063\u3066\u304d\u3066\u5165\u308c\u308b\u3068\u697d\u306a\u306e\u3067\u3001~\/.emacs.d\/init.el \u306b\u6b21\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u304a\u3044\u3066\u3001<\/p>\n<pre class=\"post-pre\"><code><span class=\"p\">(<\/span><span class=\"nb\">when<\/span> <span class=\"p\">(<\/span><span class=\"nb\">&gt;=<\/span> <span class=\"nv\">emacs-major-version<\/span> <span class=\"mi\">24<\/span><span class=\"p\">)<\/span>\r\n  <span class=\"p\">(<\/span><span class=\"nb\">require<\/span> <span class=\"ss\">'package<\/span><span class=\"p\">)<\/span>\r\n  <span class=\"p\">(<\/span><span class=\"nv\">add-to-list<\/span> <span class=\"ss\">'package-archives<\/span> <span class=\"o\">'<\/span><span class=\"p\">(<\/span><span class=\"s\">\"melpa\"<\/span> <span class=\"o\">.<\/span> <span class=\"s\">\"http:\/\/melpa.org\/packages\/\"<\/span><span class=\"p\">)<\/span> <span class=\"no\">t<\/span><span class=\"p\">)<\/span>\r\n  <span class=\"p\">(<\/span><span class=\"nv\">package-initialize<\/span><span class=\"p\">)<\/span>\r\n  <span class=\"p\">)<\/span>\r\n<\/code><\/pre>\n<p>Emacs\u3092\u518d\u8d77\u52d5\u3057\u3066\u304b\u3089(\u518d\u8d77\u52d5\u305b\u305aeval-region\u3057\u3066\u3082\u3044\u3044\u3051\u3069) M-x package-list-packages \u3092\u3057\u307e\u3059\u3002\u30ea\u30b9\u30c8\u306e\u4e2d\u304b\u3089\u6b21\u306e4\u3064\u3092\u9078\u3093\u3067 install \u3057\u3066\u304f\u3060\u3055\u3044:<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">rust-mode 5 &#8211; rust \u5411\u3051\u30e1\u30b8\u30e3\u30fc\u30e2\u30fc\u30c9<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">racer &#8211; racer \u3068\u9023\u643a\u3057\u3066\u3001\u30bf\u30b0\u30b8\u30e3\u30f3\u30d7\u3084 eldoc \u306b\u3088\u308b\u30b7\u30b0\u30cd\u30c1\u30e3\u8868\u793a\u306e\u5b9f\u73fe<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">flycheck-rust &#8211; \u30aa\u30f3\u30b6\u30d5\u30e9\u30a4\u306a\u6587\u6cd5\u30c1\u30a7\u30c3\u30ab<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">company-racer &#8211; Emacs \u306e\u88dc\u5b8c\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af company \u3068 racer \u306e\u9023\u643a<\/ul>\n<p>\u305d\u3057\u3066\u3001\u3053\u308c\u3089\u3092\u6709\u52b9\u306b\u3059\u308b\u305f\u3081\u3001~\/.emacs.d\/init.el \u306b\u6b21\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059:<\/p>\n<pre class=\"post-pre\"><code><span class=\"p\">(<\/span><span class=\"nv\">add-to-list<\/span> <span class=\"ss\">'exec-path<\/span> <span class=\"p\">(<\/span><span class=\"nv\">expand-file-name<\/span> <span class=\"s\">\"~\/.cargo\/bin\"<\/span><span class=\"p\">))<\/span>\r\n<span class=\"p\">(<\/span><span class=\"nb\">require<\/span> <span class=\"ss\">'company-racer<\/span><span class=\"p\">)<\/span>\r\n<span class=\"p\">(<\/span><span class=\"nv\">with-eval-after-load<\/span> <span class=\"ss\">'company<\/span>\r\n  <span class=\"p\">(<\/span><span class=\"nv\">add-to-list<\/span> <span class=\"ss\">'company-backends<\/span> <span class=\"ss\">'company-racer<\/span><span class=\"p\">))<\/span>\r\n<span class=\"p\">(<\/span><span class=\"nv\">add-hook<\/span> <span class=\"ss\">'rust-mode-hook<\/span> <span class=\"nf\">#'<\/span><span class=\"nv\">racer-mode<\/span><span class=\"p\">)<\/span>\r\n<span class=\"p\">(<\/span><span class=\"nv\">add-hook<\/span> <span class=\"ss\">'rust-mode-hook<\/span> <span class=\"nf\">#'<\/span><span class=\"nv\">flycheck-rust-setup<\/span><span class=\"p\">)<\/span>\r\n<span class=\"p\">(<\/span><span class=\"nv\">add-hook<\/span> <span class=\"ss\">'racer-mode-hook<\/span> <span class=\"nf\">#'<\/span><span class=\"nv\">eldoc-mode<\/span><span class=\"p\">)<\/span>\r\n<span class=\"p\">(<\/span><span class=\"nv\">add-hook<\/span> <span class=\"ss\">'racer-mode-hook<\/span> <span class=\"nf\">#'<\/span><span class=\"nv\">company-mode<\/span><span class=\"p\">)<\/span>\r\n<span class=\"p\">(<\/span><span class=\"nv\">add-hook<\/span> <span class=\"ss\">'after-init-hook<\/span> <span class=\"nf\">#'<\/span><span class=\"nv\">global-flycheck-mode<\/span><span class=\"p\">)<\/span>\r\n<\/code><\/pre>\n<h1>cargo\u306e\u30bd\u30fc\u30b9\u3092\u53d6\u5f97\u3059\u308b<\/h1>\n<p>cargo\u306e\u30bd\u30fc\u30b9\u3092github\u304b\u3089\u6301\u3063\u3066\u304d\u307e\u3059\u3002\u3067\u3082\u3001\u7d20\u306eXubuntu\u306b\u306fgit\u304c\u5165\u3063\u3066\u306a\u3044\u306e\u3067\u3001\u307e\u305a\u306fgit\u3092\u5165\u308c\u308b\u3068\u3053\u308d\u304b\u3089:<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">% sudo apt-get install git\r\n<\/span><\/code><\/pre>\n<p>\u305d\u3057\u3066\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30af\u30ed\u30fc\u30f3\u30680.16.0\u306e\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8:<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">% git clone https:\/\/github.com\/rust-lang\/cargo.git\r\n% cd cargo\r\n% git checkout 0.16.0\r\n<\/span><\/code><\/pre>\n<h1>cargo\u306e\u30d3\u30eb\u30c9<\/h1>\n<p>\u4e00\u56de\u30d3\u30eb\u30c9\u3057\u3066\u304a\u304f\u3068\u3001cargo \u304c\u4f7f\u3063\u3066\u3044\u308b crate \u306e\u30bd\u30fc\u30b9\u306b\u3082\u30bf\u30b0\u30b8\u30e3\u30f3\u30d7\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u4fbf\u5229\u3002\u306a\u304a\u3001\u3053\u306e\u307e\u307e\u3060\u3068crate\u304c\u4f9d\u5b58\u3057\u3066\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\uff08\u4e3b\u306bC\u3067\u66f8\u304b\u308c\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\uff09\u304c\u8db3\u308a\u306a\u3044\u306e\u3067\u30d3\u30eb\u30c9\u306b\u5931\u6557\u3059\u308b\u3068\u601d\u3046\u3002\u30bf\u30b0\u30b8\u30e3\u30f3\u30d7\u3057\u305f\u3044\u3060\u3051\u306a\u3089\u30d3\u30eb\u30c9\u306b\u6210\u529f\u3059\u308b\u5fc5\u8981\u306f\u306a\u3044\u3051\u308c\u3069\u3001\u3061\u3083\u3093\u3068\u30d3\u30eb\u30c9\u3092\u6210\u529f\u3055\u305b\u308b\u305f\u3081\u306b\u306fXubuntu\u3067\u306f\u6b21\u306e\u3088\u3046\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5165\u308c\u3066\u304a\u304f:<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">% sudo apt-get install pkg-config\r\n% sudo apt-get install libssl-dev\r\n% sudo apt-get install libssh2-1-dev\r\n% sudo apt-get install libgit2-dev\r\n% sudo apt-get install cmake\r\n<\/span><\/code><\/pre>\n<p>\u305d\u3057\u3066\u3001cargo build \u3059\u308c\u3070\u3001\u591a\u5206 target\/debug \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u306a\u304b\u306b cargo \u306e\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u304c\u3067\u304d\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<h1>\u6e96\u5099\u5b8c\u4e86<\/h1>\n<p>\u305f\u3081\u3057\u306b emacs \u3067 cargo\/src\/bin\/cargo.rs \u3092\u958b\u3044\u3066\u307f\u307e\u3057\u3087\u3046:<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d5ebb37434c4406cf60cd\/50-0.png\" alt=\"image\" \/><\/div>\n<p>\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n<h1>\u304a\u308f\u308a<\/h1>\n<p>\u6b21\u56de\u304b\u3089\u306f\u5b9f\u969b\u306b\u30bd\u30fc\u30b9\u8aad\u3093\u3067\u3044\u304d\u307e\u3059\u3002<\/p>\n<h1>\u6ce8\u91c8<\/h1>\n<div>\n<p>\u300c\u4f8b\u306e\u672c\u300d &#8211; \u82f1\u8a9e\u7248\u306f&#8221;The Book&#8221;\u00a0\u21a9<\/p>\n<p>\u300c\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30de\u30cb\u30e5\u30a2\u30eb\u3082\u305d\u308c\u307b\u3069\u983c\u308a\u306b\u306a\u3089\u306a\u3044\u300d &#8211; \u3060\u3063\u3066\u516c\u5f0f\u304c&#8221;While Rust does not have a specification, the reference tries to describe its working in detail. It tends to be out of date.&#8221;\u3068\u304b\u8a00\u3063\u3066\u3093\u3060\u3082\u3093\u3002Standard Library API Reference \u306e\u307b\u3046\u306f\u305d\u308c\u306a\u308a\u306b\u4f7f\u3048\u308b\u3002\u00a0\u21a9<\/p>\n<p>\u300c\u3057\u3070\u3089\u304f\u306f\u6b21\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u3053\u3068\u3092\u8003\u3048\u306a\u304f\u3066\u3082\u3044\u3044\u300d &#8211; \u3068\u8a00\u3063\u3066\u3082\u3001cargo 0.16.0\u304c\u51fa\u305f\u6642\u70b9\u3067\u3082\u3001master\u306ehead\u306f\u3060\u3044\u3076\u9055\u3046\u30b3\u30fc\u30c9\u306b\u306a\u3063\u3066\u3066\u56f0\u308b\u3002\u00a0\u21a9<\/p>\n<p>\u300cVirtualBox\u300d &#8211; \u306a\u304a\u3001rustc\u306f\u7d50\u69cb\u30e1\u30e2\u30ea\u98df\u3044\u306a\u306e\u3067\u3001\u4eee\u60f3\u30de\u30b7\u30f3\u306b\u306f\u591a\u3081\u306e\u30e1\u30e2\u30ea\u3092\u5272\u308a\u5f53\u3066\u305f\u307b\u3046\u304c\u3044\u3044\u3067\u3059\u3002\u00a0\u21a9<\/p>\n<p>\u300crust-mode\u300d &#8211; \u5b9f\u306f racer \u306e Requires \u306b\u5165\u3063\u3066\u308b\u306e\u3067\u3001\u660e\u793a\u7684\u306b\u5165\u308c\u308b\u5fc5\u8981\u306f\u306a\u3044\u3002\u00a0\u21a9<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u6700\u8fd1\u3001\u4e16\u9593\u304b\u3089\u6ce8\u76ee\u3055\u308c\u3066\u3044\u308b\u8a00\u8a9e\u3092\u3044\u308d\u3044\u308d\u773a\u3081\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u306a\u304b\u3067\u79c1\u304c\u8208\u5473\u3092\u6301\u3063\u305f\u8a00\u8a9e\u306fSca [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-45406","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>- Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:description\" content=\"\u306f\u3058\u3081\u306b \u6700\u8fd1\u3001\u4e16\u9593\u304b\u3089\u6ce8\u76ee\u3055\u308c\u3066\u3044\u308b\u8a00\u8a9e\u3092\u3044\u308d\u3044\u308d\u773a\u3081\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u306a\u304b\u3067\u79c1\u304c\u8208\u5473\u3092\u6301\u3063\u305f\u8a00\u8a9e\u306fSca [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-09T23:05:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T08:45:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d5ebb37434c4406cf60cd\/50-0.png\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/\",\"name\":\"- Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-11-09T23:05:31+00:00\",\"dateModified\":\"2024-04-30T08:45:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"- Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/","og_locale":"zh_CN","og_type":"article","og_description":"\u306f\u3058\u3081\u306b \u6700\u8fd1\u3001\u4e16\u9593\u304b\u3089\u6ce8\u76ee\u3055\u308c\u3066\u3044\u308b\u8a00\u8a9e\u3092\u3044\u308d\u3044\u308d\u773a\u3081\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u306a\u304b\u3067\u79c1\u304c\u8208\u5473\u3092\u6301\u3063\u305f\u8a00\u8a9e\u306fSca [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-11-09T23:05:31+00:00","article_modified_time":"2024-04-30T08:45:06+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d5ebb37434c4406cf60cd\/50-0.png"}],"author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/","name":"- Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-11-09T23:05:31+00:00","dateModified":"2024-04-30T08:45:06+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/45406-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/45406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=45406"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/45406\/revisions"}],"predecessor-version":[{"id":93080,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/45406\/revisions\/93080"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=45406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=45406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=45406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}