Skip to content

Commit a3de137

Browse files
Merge remote-tracking branch 'origin/master' into rust-2018-cargo
2 parents 5ac7b09 + aa0e433 commit a3de137

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2743
-1748
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
jobs:
44
build:
55
docker:
6-
- image: quay.io/rust-lang-ja/circleci:edition-guide-mdbook-0.4.5
6+
- image: quay.io/rust-lang-ja/circleci:edition-guide-mdbook-0.4.13
77
steps:
88
- checkout
99
- run: rustc --version --verbose
@@ -24,9 +24,9 @@ jobs:
2424
- store_artifacts:
2525
path: /tmp/docs.txz
2626
destination: docs.txz
27-
# - run:
28-
# name: Testing book
29-
# command: mdbook test
27+
- run:
28+
name: Testing book
29+
command: mdbook test
3030
# - run:
3131
# name: Check for broken links
3232
# command: |

TranslationTable.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
| binary | バイナリ
3131
| binding | 束縛
3232
| block | ブロック
33+
| body (関数の) | 本体
3334
| borrowing | 借用
3435
| bounds | 境界
3536
| boxed | ボックス化された
@@ -53,6 +54,7 @@
5354
| composable | 合成可能
5455
| computer science | コンピュータサイエンス
5556
| concurrency | 並行性
57+
| conditional compilation | 条件付きコンパイル
5658
| constant | 定数
5759
| constructor | コンストラクタ
5860
| continuous integration | 継続的インテグレーション
@@ -106,6 +108,7 @@
106108
| growable | 伸張可能
107109
| guard | ガード
108110
| handle | ハンドル
111+
| hard error | ハードエラー
109112
| hash | ハッシュ
110113
| identifier | 識別子
111114
| immutable | イミュータブル
@@ -212,6 +215,7 @@
212215
| standard library | 標準ライブラリ
213216
| statement | 文
214217
| static dispatch | 静的ディスパッチ
218+
| strict keyword | 正格キーワード
215219
| string | 文字列
216220
| string interpolation | 文字列インターポーレーション
217221
| string slice | 文字列スライス

docs/404.html

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,35 @@
44
<!-- Book generated using mdBook -->
55
<meta charset="UTF-8">
66
<title></title>
7-
8-
97
<base href="/">
10-
118

129

1310
<!-- Custom HTML head -->
14-
15-
1611

1712
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
1813
<meta name="description" content="">
1914
<meta name="viewport" content="width=device-width, initial-scale=1">
2015
<meta name="theme-color" content="#ffffff" />
2116

22-
2317
<link rel="icon" href="favicon.svg">
24-
25-
2618
<link rel="shortcut icon" href="favicon.png">
27-
2819
<link rel="stylesheet" href="css/variables.css">
2920
<link rel="stylesheet" href="css/general.css">
3021
<link rel="stylesheet" href="css/chrome.css">
31-
3222
<link rel="stylesheet" href="css/print.css" media="print">
33-
3423

3524
<!-- Fonts -->
3625
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
37-
3826
<link rel="stylesheet" href="fonts/fonts.css">
39-
4027

4128
<!-- Highlight.js Stylesheets -->
4229
<link rel="stylesheet" href="highlight.css">
4330
<link rel="stylesheet" href="tomorrow-night.css">
4431
<link rel="stylesheet" href="ayu-highlight.css">
4532

4633
<!-- Custom theme stylesheets -->
47-
4834
<link rel="stylesheet" href="theme/em-to-bold.css">
49-
5035

51-
5236
</head>
5337
<body>
5438
<!-- Provide site root to javascript -->
@@ -99,15 +83,14 @@
9983

10084
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
10185
<div class="sidebar-scrollbox">
102-
<ol class="chapter"><li class="chapter-item expanded affix "><a href="introduction.html">序文</a></li><li class="chapter-item expanded "><a href="editions/index.html"><strong aria-hidden="true">1.</strong> エディションとは?</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="editions/creating-a-new-project.html"><strong aria-hidden="true">1.1.</strong> 新しいプロジェクトを作成する</a></li><li class="chapter-item expanded "><a href="editions/transitioning-an-existing-project-to-a-new-edition.html"><strong aria-hidden="true">1.2.</strong> 既存のプロジェクトのエディションを移行する</a></li><li class="chapter-item expanded "><a href="editions/advanced-migrations.html"><strong aria-hidden="true">1.3.</strong> Advanced migrations</a></li></ol></li><li class="chapter-item expanded "><a href="rust-2015/index.html"><strong aria-hidden="true">2.</strong> Rust 2015</a></li><li class="chapter-item expanded "><a href="rust-2018/index.html"><strong aria-hidden="true">3.</strong> Rust 2018</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="rust-2018/path-changes.html"><strong aria-hidden="true">3.1.</strong> Path and module system changes</a></li><li class="chapter-item expanded "><a href="rust-2018/trait-fn-parameters.html"><strong aria-hidden="true">3.2.</strong> Anonymous trait function parameters deprecated</a></li><li class="chapter-item expanded "><a href="rust-2018/new-keywords.html"><strong aria-hidden="true">3.3.</strong> New keywords</a></li><li class="chapter-item expanded "><a href="rust-2018/tyvar-behind-raw-pointer.html"><strong aria-hidden="true">3.4.</strong> Method dispatch for raw pointers to inference variables</a></li><li class="chapter-item expanded "><a href="rust-2018/cargo.html"><strong aria-hidden="true">3.5.</strong> Cargo changes</a></li></ol></li><li class="chapter-item expanded "><a href="rust-2021/index.html"><strong aria-hidden="true">4.</strong> Rust 2021</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="rust-2021/prelude.html"><strong aria-hidden="true">4.1.</strong> Prelude への追加</a></li><li class="chapter-item expanded "><a href="rust-2021/default-cargo-resolver.html"><strong aria-hidden="true">4.2.</strong> デフォルトの Cargo のフィーチャリゾルバ</a></li><li class="chapter-item expanded "><a href="rust-2021/IntoIterator-for-arrays.html"><strong aria-hidden="true">4.3.</strong> 配列に対する IntoIterator</a></li><li class="chapter-item expanded "><a href="rust-2021/disjoint-capture-in-closures.html"><strong aria-hidden="true">4.4.</strong> クロージャはフィールドごとにキャプチャする</a></li><li class="chapter-item expanded "><a href="rust-2021/panic-macro-consistency.html"><strong aria-hidden="true">4.5.</strong> panic マクロの一貫性</a></li><li class="chapter-item expanded "><a href="rust-2021/reserving-syntax.html"><strong aria-hidden="true">4.6.</strong> 構文の予約</a></li><li class="chapter-item expanded "><a href="rust-2021/warnings-promoted-to-error.html"><strong aria-hidden="true">4.7.</strong> 警告からエラーへの格上げ</a></li><li class="chapter-item expanded "><a href="rust-2021/or-patterns-macro-rules.html"><strong aria-hidden="true">4.8.</strong> マクロ規則における OR パターン</a></li></ol></li></ol>
86+
<ol class="chapter"><li class="chapter-item expanded affix "><a href="introduction.html">序文</a></li><li class="chapter-item expanded "><a href="editions/index.html"><strong aria-hidden="true">1.</strong> エディションとは?</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="editions/creating-a-new-project.html"><strong aria-hidden="true">1.1.</strong> 新しいプロジェクトを作成する</a></li><li class="chapter-item expanded "><a href="editions/transitioning-an-existing-project-to-a-new-edition.html"><strong aria-hidden="true">1.2.</strong> 既存のプロジェクトのエディションを移行する</a></li><li class="chapter-item expanded "><a href="editions/advanced-migrations.html"><strong aria-hidden="true">1.3.</strong> 発展的な移行戦略</a></li></ol></li><li class="chapter-item expanded "><a href="rust-2015/index.html"><strong aria-hidden="true">2.</strong> Rust 2015</a></li><li class="chapter-item expanded "><a href="rust-2018/index.html"><strong aria-hidden="true">3.</strong> Rust 2018</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="rust-2018/path-changes.html"><strong aria-hidden="true">3.1.</strong> パスとモジュールシステムへの変更</a></li><li class="chapter-item expanded "><a href="rust-2018/trait-fn-parameters.html"><strong aria-hidden="true">3.2.</strong> トレイト関数の匿名パラメータの非推奨化</a></li><li class="chapter-item expanded "><a href="rust-2018/new-keywords.html"><strong aria-hidden="true">3.3.</strong> 新しいキーワード</a></li><li class="chapter-item expanded "><a href="rust-2018/tyvar-behind-raw-pointer.html"><strong aria-hidden="true">3.4.</strong> 推論変数への生ポインタに対するメソッドのディスパッチ</a></li><li class="chapter-item expanded "><a href="rust-2018/cargo.html"><strong aria-hidden="true">3.5.</strong> Cargo changes</a></li></ol></li><li class="chapter-item expanded "><a href="rust-2021/index.html"><strong aria-hidden="true">4.</strong> Rust 2021</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="rust-2021/prelude.html"><strong aria-hidden="true">4.1.</strong> Prelude への追加</a></li><li class="chapter-item expanded "><a href="rust-2021/default-cargo-resolver.html"><strong aria-hidden="true">4.2.</strong> デフォルトの Cargo のフィーチャリゾルバ</a></li><li class="chapter-item expanded "><a href="rust-2021/IntoIterator-for-arrays.html"><strong aria-hidden="true">4.3.</strong> 配列に対する IntoIterator</a></li><li class="chapter-item expanded "><a href="rust-2021/disjoint-capture-in-closures.html"><strong aria-hidden="true">4.4.</strong> クロージャはフィールドごとにキャプチャする</a></li><li class="chapter-item expanded "><a href="rust-2021/panic-macro-consistency.html"><strong aria-hidden="true">4.5.</strong> panic マクロの一貫性</a></li><li class="chapter-item expanded "><a href="rust-2021/reserving-syntax.html"><strong aria-hidden="true">4.6.</strong> 構文の予約</a></li><li class="chapter-item expanded "><a href="rust-2021/warnings-promoted-to-error.html"><strong aria-hidden="true">4.7.</strong> 警告からエラーへの格上げ</a></li><li class="chapter-item expanded "><a href="rust-2021/or-patterns-macro-rules.html"><strong aria-hidden="true">4.8.</strong> マクロ規則における OR パターン</a></li></ol></li></ol>
10387
</div>
10488
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
10589
</nav>
10690

10791
<div id="page-wrapper" class="page-wrapper">
10892

10993
<div class="page">
110-
11194
<div id="menu-bar-hover-placeholder"></div>
11295
<div id="menu-bar" class="menu-bar sticky bordered">
11396
<div class="left-buttons">
@@ -124,41 +107,34 @@
124107
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
125108
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
126109
</ul>
127-
128110
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
129111
<i class="fa fa-search"></i>
130112
</button>
131-
132113
</div>
133114

134115
<h1 class="menu-title">エディションガイド</h1>
135116

136117
<div class="right-buttons">
137-
138118
<a href="print.html" title="Print this book" aria-label="Print this book">
139119
<i id="print-button" class="fa fa-print"></i>
140120
</a>
141-
142-
143121
<a href="https://github.com/rust-lang-ja/edition-guide" title="Git repository" aria-label="Git repository">
144122
<i id="git-repository-button" class="fa fa-github"></i>
145123
</a>
146-
124+
147125
</div>
148126
</div>
149127

150-
151128
<div id="search-wrapper" class="hidden">
152129
<form id="searchbar-outer" class="searchbar-outer">
153-
<input type="search" name="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
130+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
154131
</form>
155132
<div id="searchresults-outer" class="searchresults-outer hidden">
156133
<div id="searchresults-header" class="searchresults-header"></div>
157134
<ul id="searchresults">
158135
</ul>
159136
</div>
160137
</div>
161-
162138

163139
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
164140
<script type="text/javascript">
@@ -171,58 +147,44 @@ <h1 class="menu-title">エディションガイド</h1>
171147

172148
<div id="content" class="content">
173149
<main>
174-
<h1><a class="header" href="#document-not-found-404" id="document-not-found-404">Document not found (404)</a></h1>
150+
<h1 id="document-not-found-404"><a class="header" href="#document-not-found-404">Document not found (404)</a></h1>
175151
<p>This URL is invalid, sorry. Please use the navigation bar or search to continue.</p>
176152

177153
</main>
178154

179155
<nav class="nav-wrapper" aria-label="Page navigation">
180156
<!-- Mobile navigation buttons -->
181-
182157

183-
184158

185159
<div style="clear: both"></div>
186160
</nav>
187161
</div>
188162
</div>
189163

190164
<nav class="nav-wide-wrapper" aria-label="Page navigation">
191-
192165

193-
194166
</nav>
195167

196168
</div>
197169

198-
199170

200-
201171

202-
203172

204-
205173
<script type="text/javascript">
206174
window.playground_copyable = true;
207175
</script>
208-
209176

210-
211177

212-
213178
<script src="elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
214179
<script src="mark.min.js" type="text/javascript" charset="utf-8"></script>
215180
<script src="searcher.js" type="text/javascript" charset="utf-8"></script>
216-
217181

218182
<script src="clipboard.min.js" type="text/javascript" charset="utf-8"></script>
219183
<script src="highlight.js" type="text/javascript" charset="utf-8"></script>
220184
<script src="book.js" type="text/javascript" charset="utf-8"></script>
221185

222186
<!-- Custom JS scripts -->
223-
224187

225-
226188

227189
</body>
228190
</html>

docs/book.js

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,12 @@ function playground_text(playground) {
108108

109109
let text = playground_text(code_block);
110110
let classes = code_block.querySelector('code').classList;
111-
let has_2018 = classes.contains("edition2018");
112-
let edition = has_2018 ? "2018" : "2015";
113-
111+
let edition = "2015";
112+
if(classes.contains("edition2018")) {
113+
edition = "2018";
114+
} else if(classes.contains("edition2021")) {
115+
edition = "2021";
116+
}
114117
var params = {
115118
version: "stable",
116119
optimize: "0",
@@ -133,7 +136,15 @@ function playground_text(playground) {
133136
body: JSON.stringify(params)
134137
})
135138
.then(response => response.json())
136-
.then(response => result_block.innerText = response.result)
139+
.then(response => {
140+
if (response.result.trim() === '') {
141+
result_block.innerText = "No output";
142+
result_block.classList.add("result-no-output");
143+
} else {
144+
result_block.innerText = response.result;
145+
result_block.classList.remove("result-no-output");
146+
}
147+
})
137148
.catch(error => result_block.innerText = "Playground Communication: " + error.message);
138149
}
139150

@@ -151,12 +162,13 @@ function playground_text(playground) {
151162
if (window.ace) {
152163
// language-rust class needs to be removed for editable
153164
// blocks or highlightjs will capture events
154-
Array
155-
.from(document.querySelectorAll('code.editable'))
165+
code_nodes
166+
.filter(function (node) {return node.classList.contains("editable"); })
156167
.forEach(function (block) { block.classList.remove('language-rust'); });
157168

158169
Array
159-
.from(document.querySelectorAll('code:not(.editable)'))
170+
code_nodes
171+
.filter(function (node) {return !node.classList.contains("editable"); })
160172
.forEach(function (block) { hljs.highlightBlock(block); });
161173
} else {
162174
code_nodes.forEach(function (block) { hljs.highlightBlock(block); });
@@ -359,7 +371,14 @@ function playground_text(playground) {
359371
});
360372

361373
themePopup.addEventListener('click', function (e) {
362-
var theme = e.target.id || e.target.parentElement.id;
374+
var theme;
375+
if (e.target.className === "theme") {
376+
theme = e.target.id;
377+
} else if (e.target.parentElement.className === "theme") {
378+
theme = e.target.parentElement.id;
379+
} else {
380+
return;
381+
}
363382
set_theme(theme);
364383
});
365384

docs/css/chrome.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ a > .hljs {
9393
.menu-title {
9494
display: inline-block;
9595
font-weight: 200;
96-
font-size: 2rem;
96+
font-size: 2.4rem;
9797
line-height: var(--menu-bar-height);
9898
text-align: center;
9999
margin: 0;

docs/css/general.css

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,23 @@ h4, h5 { margin-top: 2em; }
4545
margin-top: 1em;
4646
}
4747

48-
h1 a.header:target::before,
49-
h2 a.header:target::before,
50-
h3 a.header:target::before,
51-
h4 a.header:target::before {
48+
h1:target::before,
49+
h2:target::before,
50+
h3:target::before,
51+
h4:target::before,
52+
h5:target::before,
53+
h6:target::before {
5254
display: inline-block;
5355
content: "»";
5456
margin-left: -30px;
5557
width: 30px;
5658
}
5759

58-
h1 a.header:target,
59-
h2 a.header:target,
60-
h3 a.header:target,
61-
h4 a.header:target {
60+
/* This is broken on Safari as of version 14, but is fixed
61+
in Safari Technology Preview 117 which I think will be Safari 14.2.
62+
https://bugs.webkit.org/show_bug.cgi?id=218076
63+
*/
64+
:target {
6265
scroll-margin-top: calc(var(--menu-bar-height) + 0.5em);
6366
}
6467

@@ -89,7 +92,7 @@ h4 a.header:target {
8992
.content ul { line-height: 1.45em; }
9093
.content a { text-decoration: none; }
9194
.content a:hover { text-decoration: underline; }
92-
.content img { max-width: 100%; }
95+
.content img, .content video { max-width: 100%; }
9396
.content .header:link,
9497
.content .header:visited {
9598
color: var(--fg);
@@ -172,3 +175,7 @@ blockquote {
172175
margin: 5px 0px;
173176
font-weight: bold;
174177
}
178+
179+
.result-no-output {
180+
font-style: italic;
181+
}

0 commit comments

Comments
 (0)