Skip to content

Commit 3a34da0

Browse files
committed
---
yaml --- r: 165759 b: refs/heads/auto c: 7d55249 h: refs/heads/master i: 165757: 1ee5885 165755: 03611c1 165751: 599bd20 165743: 506386d 165727: 7e4a376 165695: 93200a6 165631: 63e04e2 v: v3
1 parent 6045cda commit 3a34da0

File tree

417 files changed

+6597
-7815
lines changed

Some content is hidden

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

417 files changed

+6597
-7815
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: d3f3ae3aa2571bdf0250e019dc4cdb0df05abdbe
13+
refs/heads/auto: 7d55249c91eb556f13f7e5b7043b06747c5782af
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/docs.mk

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,36 @@ endef
216216
$(foreach docname,$(DOCS),$(eval $(call DEF_DOC,$(docname))))
217217

218218

219+
# Localized documentation
220+
221+
# FIXME: I (huonw) haven't actually been able to test properly, since
222+
# e.g. (by default) I'm doing an out-of-tree build (#12763), but even
223+
# adjusting for that, the files are too old(?) and are rejected by
224+
# po4a.
225+
#
226+
# As such, I've attempted to get it working as much as possible (and
227+
# switching from pandoc to rustdoc), but preserving the old behaviour
228+
# (e.g. only running on the guide)
229+
.PHONY: l10n-mds
230+
l10n-mds: $(D)/po4a.conf \
231+
$(foreach lang,$(L10N_LANG),$(D)/po/$(lang)/*.md.po)
232+
$(warning WARNING: localized documentation is experimental)
233+
po4a --copyright-holder="The Rust Project Developers" \
234+
--package-name="Rust" \
235+
--package-version="$(CFG_RELEASE)" \
236+
-M UTF-8 -L UTF-8 \
237+
$(D)/po4a.conf
238+
239+
define DEF_L10N_DOC
240+
DOC_L10N_TARGETS += doc/l10n/$(1)/$(2).html
241+
doc/l10n/$(1)/$(2).html: l10n-mds $$(HTML_DEPS) $$(RUSTDOC_DEPS_$(2))
242+
@$$(call E, rustdoc: $$@)
243+
$$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) doc/l10n/$(1)/$(2).md
244+
endef
245+
246+
$(foreach lang,$(L10N_LANGS),$(eval $(call DEF_L10N_DOC,$(lang),guide)))
247+
248+
219249
######################################################################
220250
# Rustdoc (libstd/extra)
221251
######################################################################
@@ -264,3 +294,7 @@ endif
264294

265295
docs: $(DOC_TARGETS)
266296
compiler-docs: $(COMPILER_DOC_TARGETS)
297+
298+
docs-l10n: $(DOC_L10N_TARGETS)
299+
300+
.PHONY: docs-l10n

branches/auto/mk/tests.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ endif
7474
TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
7575
TEST_OK_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).ok
7676

77+
TEST_RATCHET_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4)-metrics.json
78+
TEST_RATCHET_NOISE_PERCENT=10.0
79+
80+
# Whether to ratchet or merely save benchmarks
81+
ifdef CFG_RATCHET_BENCH
82+
CRATE_TEST_EXTRA_ARGS= \
83+
--test $(TEST_BENCH) \
84+
--ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
85+
--ratchet-noise-percent $(TEST_RATCHET_NOISE_PERCENT)
86+
else
87+
CRATE_TEST_EXTRA_ARGS= \
88+
--test $(TEST_BENCH) \
89+
--save-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4))
90+
endif
91+
7792
# If we're sharding the testsuite between parallel testers,
7893
# pass this argument along to the compiletest and crate test
7994
# invocations.
@@ -440,6 +455,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
440455
$$(Q)touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
441456
$$(Q)$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
442457
$$(Q)$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
458+
$$(Q)$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/$$(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) tmp/
443459
@if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
444460
then \
445461
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
@@ -681,6 +697,7 @@ CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
681697
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
682698
--src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
683699
--build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
700+
--ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
684701
--mode $$(CTEST_MODE_$(4)) \
685702
$$(CTEST_RUNTOOL_$(4))
686703

branches/auto/src/compiletest/compiletest.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
152152
matches.opt_str("ratchet-metrics").map(|s| Path::new(s)),
153153
ratchet_noise_percent:
154154
matches.opt_str("ratchet-noise-percent")
155-
.and_then(|s| s.as_slice().parse::<f64>()),
155+
.and_then(|s| from_str::<f64>(s.as_slice())),
156156
runtool: matches.opt_str("runtool"),
157157
host_rustcflags: matches.opt_str("host-rustcflags"),
158158
target_rustcflags: matches.opt_str("target-rustcflags"),
@@ -190,7 +190,9 @@ pub fn log_config(config: &Config) {
190190
logv(c, format!("filter: {}",
191191
opt_str(&config.filter
192192
.as_ref()
193-
.map(|re| re.to_string()))));
193+
.map(|re| {
194+
re.to_string().into_string()
195+
}))));
194196
logv(c, format!("runtool: {}", opt_str(&config.runtool)));
195197
logv(c, format!("host-rustcflags: {}",
196198
opt_str(&config.host_rustcflags)));

branches/auto/src/compiletest/header.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ pub fn gdb_version_to_int(version_string: &str) -> int {
351351
panic!("{}", error_string);
352352
}
353353

354-
let major: int = components[0].parse().expect(error_string);
355-
let minor: int = components[1].parse().expect(error_string);
354+
let major: int = from_str(components[0]).expect(error_string);
355+
let minor: int = from_str(components[1]).expect(error_string);
356356

357357
return major * 1000 + minor;
358358
}
@@ -362,6 +362,6 @@ pub fn lldb_version_to_int(version_string: &str) -> int {
362362
"Encountered LLDB version string with unexpected format: {}",
363363
version_string);
364364
let error_string = error_string.as_slice();
365-
let major: int = version_string.parse().expect(error_string);
365+
let major: int = from_str(version_string).expect(error_string);
366366
return major;
367367
}

branches/auto/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ fn split_maybe_args(argstr: &Option<String>) -> Vec<String> {
13611361
s.as_slice()
13621362
.split(' ')
13631363
.filter_map(|s| {
1364-
if s.chars().all(|c| c.is_whitespace()) {
1364+
if s.is_whitespace() {
13651365
None
13661366
} else {
13671367
Some(s.to_string())
@@ -1609,7 +1609,7 @@ fn _arm_exec_compiled_test(config: &Config,
16091609
stderr_out.as_slice());
16101610

16111611
ProcRes {
1612-
status: process::ProcessExit::ExitStatus(exitcode),
1612+
status: process::ExitStatus(exitcode),
16131613
stdout: stdout_out,
16141614
stderr: stderr_out,
16151615
cmdline: cmdline

branches/auto/src/doc/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
document converter, is required to generate docs as HTML from Rust's
77
source code.
88

9+
[po4a](http://po4a.alioth.debian.org/) is required for generating translated
10+
docs from the master (English) docs.
11+
12+
[GNU gettext](http://www.gnu.org/software/gettext/) is required for managing
13+
the translation data.
14+
915
## Building
1016

1117
To generate all the docs, just run `make docs` from the root of the repository.
@@ -38,3 +44,43 @@ The syntax for pandoc flavored markdown can be found at:
3844
A nice quick reference (for non-pandoc markdown) is at:
3945

4046
- http://kramdown.gettalong.org/quickref.html
47+
48+
## Notes for translators
49+
50+
Notice: The procedure described below is a work in progress. We are working on
51+
translation system but the procedure contains some manual operations for now.
52+
53+
To start the translation for a new language, see `po4a.conf` at first.
54+
55+
To generate `.pot` and `.po` files, do something like:
56+
57+
~~~~
58+
po4a --copyright-holder="The Rust Project Developers" \
59+
--package-name="Rust" \
60+
--package-version="0.13.0" \
61+
-M UTF-8 -L UTF-8 \
62+
src/doc/po4a.conf
63+
~~~~
64+
65+
(the version number must be changed if it is not `0.13.0` now.)
66+
67+
Now you can translate documents with `.po` files, commonly used with gettext. If
68+
you are not familiar with gettext-based translation, please read the online
69+
manual linked from http://www.gnu.org/software/gettext/ . We use UTF-8 as the
70+
file encoding of `.po` files.
71+
72+
When you want to make a commit, do the command below before staging your
73+
change:
74+
75+
~~~~
76+
for f in src/doc/po/**/*.po; do
77+
msgattrib --translated $f -o $f.strip
78+
if [ -e $f.strip ]; then
79+
mv $f.strip $f
80+
else
81+
rm $f
82+
fi
83+
done
84+
~~~~
85+
86+
This removes untranslated entries from `.po` files to save disk space.

branches/auto/src/doc/guide-ownership.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ fn main() {
324324
let f = Foo { x: y }; // -+ f goes into scope
325325
// stuff // |
326326
// |
327-
} // -+ f and y go out of scope
327+
} // -+ f & y go out of scope
328328
```
329329

330330
Our `f` lives within the scope of `y`, so everything works. What if it didn't?
@@ -342,7 +342,7 @@ fn main() {
342342
let y = &5i; // ---+ y goes into scope
343343
let f = Foo { x: y }; // ---+ f goes into scope
344344
x = &f.x; // | | error here
345-
} // ---+ f and y go out of scope
345+
} // ---+ f & y go out of scope
346346
// |
347347
println!("{}", x); // |
348348
} // -+ x goes out of scope
@@ -395,7 +395,7 @@ struct Wheel {
395395
}
396396
397397
fn main() {
398-
let car = Car { name: "DeLorean".to_string() };
398+
let car = Car { name: "DeLorian".to_string() };
399399
400400
for _ in range(0u, 4) {
401401
Wheel { size: 360, owner: car };
@@ -431,7 +431,7 @@ struct Wheel {
431431
}
432432

433433
fn main() {
434-
let car = Car { name: "DeLorean".to_string() };
434+
let car = Car { name: "DeLorian".to_string() };
435435

436436
let car_owner = Rc::new(car);
437437

0 commit comments

Comments
 (0)