Skip to content

Commit 8ee67e7

Browse files
committed
---
yaml --- r: 233328 b: refs/heads/beta c: 9d0bca4 h: refs/heads/master v: v3
1 parent 1a3f3b9 commit 8ee67e7

File tree

15 files changed

+302
-112
lines changed

15 files changed

+302
-112
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 67c7fd710be56cf3ba5ca03b7291add856e73a8d
26+
refs/heads/beta: 9d0bca42e0fc63af49072826cec462e25310bd9c
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/mk/docs.mk

Lines changed: 2 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
#
1414
# The DOCS variable is their names (with no file extension).
1515
#
16-
# PDF_DOCS lists the targets for which PDF documentation should be
17-
# build.
18-
#
1916
# RUSTDOC_FLAGS_xyz variables are extra arguments to pass to the
2017
# rustdoc invocation for xyz.
2118
#
@@ -35,8 +32,6 @@ DOCS += guide-crates guide-error-handling guide-ffi guide-macros guide \
3532
guide-testing
3633

3734

38-
PDF_DOCS := reference
39-
4035
RUSTDOC_DEPS_reference := doc/full-toc.inc
4136
RUSTDOC_FLAGS_reference := --html-in-header=doc/full-toc.inc
4237

@@ -52,13 +47,6 @@ RUSTDOC_HTML_OPTS_NO_CSS = --html-before-content=doc/version_info.html \
5247

5348
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
5449

55-
PANDOC_BASE_OPTS := --standalone --toc --number-sections
56-
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --from=markdown --to=latex \
57-
--include-before-body=doc/version.tex \
58-
--include-before-body=doc/footer.tex \
59-
--include-in-header=doc/uptack.tex
60-
PANDOC_EPUB_OPTS = $(PANDOC_BASE_OPTS) --to=epub
61-
6250
# The rustdoc executable...
6351
RUSTDOC_EXE = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
6452
# ...with rpath included in case --disable-rpath was provided to
@@ -89,30 +77,10 @@ else
8977
HTML_DEPS :=
9078
endif
9179

92-
# Check for xelatex
93-
94-
ifneq ($(CFG_XELATEX),)
95-
CFG_LATEX := $(CFG_XELATEX)
96-
XELATEX = 1
97-
else
98-
$(info cfg: no xelatex found, disabling LaTeX docs)
99-
NO_PDF_DOCS = 1
100-
endif
101-
102-
ifeq ($(CFG_PANDOC),)
103-
$(info cfg: no pandoc found, omitting PDF and EPUB docs)
104-
ONLY_HTML_DOCS = 1
105-
endif
106-
107-
10880
######################################################################
10981
# Rust version
11082
######################################################################
11183

112-
doc/version.tex: $(MKFILE_DEPS) $(wildcard $(D)/*.*) | doc/
113-
@$(call E, version-stamp: $@)
114-
$(Q)echo "$(CFG_VERSION)" >$@
115-
11684
HTML_DEPS += doc/version_info.html
11785
doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
11886
$(wildcard $(D)/*.*) | doc/
@@ -121,10 +89,10 @@ doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
12189
s/SHORT_HASH/$(CFG_SHORT_VER_HASH)/; \
12290
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
12391

124-
GENERATED += doc/version.tex doc/version_info.html
92+
GENERATED += doc/version_info.html
12593

12694
######################################################################
127-
# Docs, from rustdoc and sometimes pandoc
95+
# Docs from rustdoc
12896
######################################################################
12997

13098
doc/:
@@ -150,20 +118,6 @@ doc/footer.inc: $(D)/footer.inc | doc/
150118
$(Q)cp -PRp $< $@ 2> /dev/null
151119

152120
# The (english) documentation for each doc item.
153-
154-
define DEF_SHOULD_BUILD_PDF_DOC
155-
SHOULD_BUILD_PDF_DOC_$(1) = 1
156-
endef
157-
$(foreach docname,$(PDF_DOCS),$(eval $(call DEF_SHOULD_BUILD_PDF_DOC,$(docname))))
158-
159-
doc/footer.tex: $(D)/footer.inc | doc/
160-
@$(call E, pandoc: $@)
161-
$(CFG_PANDOC) --from=html --to=latex $< --output=$@
162-
163-
doc/uptack.tex: $(D)/uptack.tex | doc/
164-
$(Q)cp $< $@
165-
166-
# HTML (rustdoc)
167121
DOC_TARGETS += doc/not_found.html
168122
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
169123
@$(call E, rustdoc: $@)
@@ -179,47 +133,6 @@ doc/$(1).html: $$(D)/$(1).md $$(HTML_DEPS) $$(RUSTDOC_DEPS_$(1)) | doc/
179133
@$$(call E, rustdoc: $$@)
180134
$$(Q)$$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) $$<
181135

182-
ifneq ($(ONLY_HTML_DOCS),1)
183-
184-
# EPUB (pandoc directly)
185-
DOC_TARGETS += doc/$(1).epub
186-
doc/$(1).epub: $$(D)/$(1).md | doc/
187-
@$$(call E, pandoc: $$@)
188-
$$(CFG_PANDOC) $$(PANDOC_EPUB_OPTS) $$< --output=$$@
189-
190-
# PDF (md =(pandoc)=> tex =(pdflatex)=> pdf)
191-
DOC_TARGETS += doc/$(1).tex
192-
doc/$(1).tex: $$(D)/$(1).md doc/uptack.tex doc/footer.tex doc/version.tex | doc/
193-
@$$(call E, pandoc: $$@)
194-
$$(CFG_PANDOC) $$(PANDOC_TEX_OPTS) $$< --output=$$@
195-
196-
ifneq ($(NO_PDF_DOCS),1)
197-
ifeq ($$(SHOULD_BUILD_PDF_DOC_$(1)),1)
198-
DOC_TARGETS += doc/$(1).pdf
199-
ifneq ($(XELATEX),1)
200-
doc/$(1).pdf: doc/$(1).tex
201-
@$$(call E, latex compiler: $$@)
202-
$$(Q)$$(CFG_LATEX) \
203-
-interaction=batchmode \
204-
-output-directory=doc \
205-
$$<
206-
else
207-
# The version of xelatex on the snap bots seemingly ingores -output-directory
208-
# So we'll output to . and move to the doc directory manually.
209-
# This will leave some intermediate files in the build directory.
210-
doc/$(1).pdf: doc/$(1).tex
211-
@$$(call E, latex compiler: $$@)
212-
$$(Q)$$(CFG_LATEX) \
213-
-interaction=batchmode \
214-
-output-directory=. \
215-
$$<
216-
$$(Q)mv ./$(1).pdf $$@
217-
endif # XELATEX
218-
endif # SHOULD_BUILD_PDF_DOCS_$(1)
219-
endif # NO_PDF_DOCS
220-
221-
endif # ONLY_HTML_DOCS
222-
223136
endef
224137

225138
$(foreach docname,$(DOCS),$(eval $(call DEF_DOC,$(docname))))

branches/beta/src/doc/README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Rust documentations
22

3-
## Dependencies
4-
5-
[Pandoc](http://johnmacfarlane.net/pandoc/installing.html), a universal
6-
document converter, is required to generate docs as HTML from Rust's
7-
source code.
8-
93
## Building
104

115
To generate all the docs, just run `make docs` from the root of the repository.
@@ -26,15 +20,12 @@ To generate an HTML version of a doc from Markdown manually, you can do
2620
something like:
2721

2822
~~~~
29-
pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md
23+
rustdoc reference.md
3024
~~~~
3125

3226
(`reference.md` being the Rust Reference Manual.)
3327

34-
The syntax for pandoc flavored markdown can be found at:
35-
36-
- http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown
37-
38-
A nice quick reference (for non-pandoc markdown) is at:
28+
An overview of how to use the `rustdoc` command is available [in the docs][1].
29+
Further details are available from the command line by with `rustdoc --help`.
3930

40-
- http://kramdown.gettalong.org/quickref.html
31+
[1]: https://github.com/rust-lang/rust/blob/master/src/doc/trpl/documentation.md

branches/beta/src/etc/make-win-dist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def make_win_dist(rust_root, gcc_root, target_triple):
4545
elif key == "libraries":
4646
lib_path.extend(val.lstrip(' =').split(';'))
4747

48-
target_tools = ["gcc.exe", "ld.exe", "ar.exe", "dlltool.exe", "windres.exe"]
48+
target_tools = ["gcc.exe", "ld.exe", "ar.exe", "dlltool.exe"]
4949

5050
rustc_dlls = ["libstdc++-6.dll"]
5151
if target_triple.startswith("i686-"):

branches/beta/src/libcore/slice.rs

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ use ptr;
5050
use mem;
5151
use mem::size_of;
5252
use marker::{Send, Sync, self};
53+
use num::wrapping::OverflowingOps;
5354
use raw::Repr;
5455
// Avoid conflicts with *both* the Slice trait (buggy) and the `slice::raw` module.
5556
use raw::Slice as RawSlice;
@@ -1180,6 +1181,34 @@ impl<'a, T> Iterator for Windows<'a, T> {
11801181
(size, Some(size))
11811182
}
11821183
}
1184+
1185+
#[inline]
1186+
fn count(self) -> usize {
1187+
self.size_hint().0
1188+
}
1189+
1190+
#[inline]
1191+
fn nth(&mut self, n: usize) -> Option<Self::Item> {
1192+
let (end, overflow) = self.size.overflowing_add(n);
1193+
if end > self.v.len() || overflow {
1194+
self.v = &[];
1195+
None
1196+
} else {
1197+
let nth = &self.v[n..end];
1198+
self.v = &self.v[n+1..];
1199+
Some(nth)
1200+
}
1201+
}
1202+
1203+
#[inline]
1204+
fn last(self) -> Option<Self::Item> {
1205+
if self.size > self.v.len() {
1206+
None
1207+
} else {
1208+
let start = self.v.len() - self.size;
1209+
Some(&self.v[start..])
1210+
}
1211+
}
11831212
}
11841213

11851214
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1266,6 +1295,38 @@ impl<'a, T> Iterator for Chunks<'a, T> {
12661295
(n, Some(n))
12671296
}
12681297
}
1298+
1299+
#[inline]
1300+
fn count(self) -> usize {
1301+
self.size_hint().0
1302+
}
1303+
1304+
#[inline]
1305+
fn nth(&mut self, n: usize) -> Option<Self::Item> {
1306+
let (start, overflow) = n.overflowing_mul(self.size);
1307+
if start >= self.v.len() || overflow {
1308+
self.v = &[];
1309+
None
1310+
} else {
1311+
let end = match start.checked_add(self.size) {
1312+
Some(sum) => cmp::min(self.v.len(), sum),
1313+
None => self.v.len(),
1314+
};
1315+
let nth = &self.v[start..end];
1316+
self.v = &self.v[end..];
1317+
Some(nth)
1318+
}
1319+
}
1320+
1321+
#[inline]
1322+
fn last(self) -> Option<Self::Item> {
1323+
if self.v.is_empty() {
1324+
None
1325+
} else {
1326+
let start = (self.v.len() - 1) / self.size * self.size;
1327+
Some(&self.v[start..])
1328+
}
1329+
}
12691330
}
12701331

12711332
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1346,6 +1407,40 @@ impl<'a, T> Iterator for ChunksMut<'a, T> {
13461407
(n, Some(n))
13471408
}
13481409
}
1410+
1411+
#[inline]
1412+
fn count(self) -> usize {
1413+
self.size_hint().0
1414+
}
1415+
1416+
#[inline]
1417+
fn nth(&mut self, n: usize) -> Option<&'a mut [T]> {
1418+
let (start, overflow) = n.overflowing_mul(self.chunk_size);
1419+
if start >= self.v.len() || overflow {
1420+
self.v = &mut [];
1421+
None
1422+
} else {
1423+
let end = match start.checked_add(self.chunk_size) {
1424+
Some(sum) => cmp::min(self.v.len(), sum),
1425+
None => self.v.len(),
1426+
};
1427+
let tmp = mem::replace(&mut self.v, &mut []);
1428+
let (head, tail) = tmp.split_at_mut(end);
1429+
let (_, nth) = head.split_at_mut(start);
1430+
self.v = tail;
1431+
Some(nth)
1432+
}
1433+
}
1434+
1435+
#[inline]
1436+
fn last(self) -> Option<Self::Item> {
1437+
if self.v.is_empty() {
1438+
None
1439+
} else {
1440+
let start = (self.v.len() - 1) / self.chunk_size * self.chunk_size;
1441+
Some(&mut self.v[start..])
1442+
}
1443+
}
13491444
}
13501445

13511446
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)