Skip to content

Commit 6d80f70

Browse files
author
Eljay
committed
---
yaml --- r: 229177 b: refs/heads/try c: acf9d67 h: refs/heads/master i: 229175: 43f2f83 v: v3
1 parent f854417 commit 6d80f70

File tree

4 files changed

+36
-16
lines changed

4 files changed

+36
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: c980aba9a88704717229da3c1ec02685333c0db2
4+
refs/heads/try: acf9d6768e93bbffce7e57de647042af7d40b33d
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/doc/trpl/concurrency.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ languages. It will not compile:
115115
use std::thread;
116116
117117
fn main() {
118-
let mut data = vec![1, 2, 3];
118+
let mut data = vec![1u32, 2, 3];
119119
120120
for i in 0..3 {
121121
thread::spawn(move || {
@@ -153,7 +153,7 @@ use std::thread;
153153
use std::sync::Mutex;
154154
155155
fn main() {
156-
let mut data = Mutex::new(vec![1, 2, 3]);
156+
let mut data = Mutex::new(vec![1u32, 2, 3]);
157157
158158
for i in 0..3 {
159159
let data = data.lock().unwrap();
@@ -195,7 +195,7 @@ use std::sync::{Arc, Mutex};
195195
use std::thread;
196196

197197
fn main() {
198-
let data = Arc::new(Mutex::new(vec![1, 2, 3]));
198+
let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
199199

200200
for i in 0..3 {
201201
let data = data.clone();
@@ -217,7 +217,7 @@ thread more closely:
217217
# use std::sync::{Arc, Mutex};
218218
# use std::thread;
219219
# fn main() {
220-
# let data = Arc::new(Mutex::new(vec![1, 2, 3]));
220+
# let data = Arc::new(Mutex::new(vec![1u32, 2, 3]));
221221
# for i in 0..3 {
222222
# let data = data.clone();
223223
thread::spawn(move || {
@@ -255,7 +255,7 @@ use std::thread;
255255
use std::sync::mpsc;
256256

257257
fn main() {
258-
let data = Arc::new(Mutex::new(0));
258+
let data = Arc::new(Mutex::new(0u32));
259259

260260
let (tx, rx) = mpsc::channel();
261261

@@ -293,7 +293,7 @@ fn main() {
293293
let tx = tx.clone();
294294

295295
thread::spawn(move || {
296-
let answer = 42;
296+
let answer = 42u32;
297297

298298
tx.send(answer);
299299
});

branches/try/src/librustdoc/html/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ r##"<!DOCTYPE html>
113113
<p>
114114
Accepted types are: <code>fn</code>, <code>mod</code>,
115115
<code>struct</code>, <code>enum</code>,
116-
<code>trait</code>, <code>typedef</code> (or
117-
<code>tdef</code>).
116+
<code>trait</code>, <code>type</code>, <code>macro</code>,
117+
and <code>const</code>.
118118
</p>
119119
120120
<p>

branches/try/src/librustdoc/html/static/main.js

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,28 @@
230230
}
231231
}
232232

233+
function typePassesFilter(filter, type) {
234+
// No filter
235+
if (filter < 0) return true;
236+
237+
// Exact match
238+
if (filter === type) return true;
239+
240+
// Match related items
241+
var name = itemTypes[type];
242+
switch (itemTypes[filter]) {
243+
case "constant":
244+
return (name == "associatedconstant");
245+
case "fn":
246+
return (name == "method" || name == "tymethod");
247+
case "type":
248+
return (name == "primitive");
249+
}
250+
251+
// No match
252+
return false;
253+
}
254+
233255
// quoted values mean literal search
234256
var nSearchWords = searchWords.length;
235257
if ((val.charAt(0) === "\"" || val.charAt(0) === "'") &&
@@ -239,7 +261,7 @@
239261
for (var i = 0; i < nSearchWords; ++i) {
240262
if (searchWords[i] === val) {
241263
// filter type: ... queries
242-
if (typeFilter < 0 || typeFilter === searchIndex[i].ty) {
264+
if (typePassesFilter(typeFilter, searchIndex[i].ty)) {
243265
results.push({id: i, index: -1});
244266
}
245267
}
@@ -285,7 +307,7 @@
285307
searchWords[j].replace(/_/g, "").indexOf(val) > -1)
286308
{
287309
// filter type: ... queries
288-
if (typeFilter < 0 || typeFilter === searchIndex[j].ty) {
310+
if (typePassesFilter(typeFilter, searchIndex[j].ty)) {
289311
results.push({
290312
id: j,
291313
index: searchWords[j].replace(/_/g, "").indexOf(val),
@@ -295,7 +317,7 @@
295317
} else if (
296318
(lev_distance = levenshtein(searchWords[j], val)) <=
297319
MAX_LEV_DISTANCE) {
298-
if (typeFilter < 0 || typeFilter === searchIndex[j].ty) {
320+
if (typePassesFilter(typeFilter, searchIndex[j].ty)) {
299321
results.push({
300322
id: j,
301323
index: 0,
@@ -451,11 +473,9 @@
451473
var matches, type, query, raw = $('.search-input').val();
452474
query = raw;
453475

454-
matches = query.match(/^(fn|mod|struct|enum|trait|t(ype)?d(ef)?)\s*:\s*/i);
476+
matches = query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);
455477
if (matches) {
456-
type = matches[1].replace(/^td$/, 'typedef')
457-
.replace(/^tdef$/, 'typedef')
458-
.replace(/^typed$/, 'typedef');
478+
type = matches[1].replace(/^const$/, 'constant');
459479
query = query.substring(matches[0].length);
460480
}
461481

0 commit comments

Comments
 (0)