Skip to content

Commit a131166

Browse files
committed
---
yaml --- r: 147431 b: refs/heads/try2 c: 619c4fc h: refs/heads/master i: 147429: 33f8b32 147427: e15170b 147423: 443e61e v: v3
1 parent 2a47a53 commit a131166

File tree

373 files changed

+8583
-7722
lines changed

Some content is hidden

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

373 files changed

+8583
-7722
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ee887d70780bce4c89a8977d04f724064ee1ae8f
8+
refs/heads/try2: 619c4fce891f31ec234a3ac162d40d3def95956e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
lexer.ml
5353
TAGS
5454
TAGS.emacs
55-
TAGS.vim
55+
TAGS.vi
5656
version.ml
5757
version.texi
5858
/Makefile

branches/try2/Makefile.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,6 @@ ifneq ($(strip $(findstring snap,$(MAKECMDGOALS)) \
657657
include $(CFG_SRC_DIR)mk/snap.mk
658658
endif
659659

660-
ifneq ($(findstring reformat,$(MAKECMDGOALS)),)
661-
CFG_INFO := $(info cfg: including reformat rules)
662-
include $(CFG_SRC_DIR)mk/pp.mk
663-
endif
664-
665660
ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
666661
$(findstring test,$(MAKECMDGOALS)) \
667662
$(findstring perf,$(MAKECMDGOALS)) \

branches/try2/configure

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,27 @@ then
559559
step_msg "on OS X 10.9, forcing use of clang"
560560
CFG_ENABLE_CLANG=1
561561
putvar CFG_ENABLE_CLANG
562+
else
563+
# on OS X, with xcode 5 and newer, certain developers may have
564+
# cc, gcc and g++ point to a mixture of clang and gcc
565+
# if so, this will create very strange build errors
566+
# this last stanza is to detect some such problems and save the future rust
567+
# contributor some time solving that issue.
568+
# this detection could be generalized to other OSes aside from OS X
569+
# but the issue seems most likely to happen on OS X
570+
571+
chk_cc () {
572+
$1 --version 2> /dev/null | grep -q $2
573+
}
574+
# check that gcc, cc and g++ all point to the same compiler.
575+
# note that for xcode 5, g++ points to clang, not clang++
576+
if !((chk_cc gcc clang && chk_cc g++ clang) ||
577+
(chk_cc gcc gcc &&( chk_cc g++ g++ || chk g++ gcc))) then
578+
err "the gcc and g++ in your path point to different compilers.
579+
Check which versions are in your path with cc --version and g++ --version.
580+
To resolve this problem, either fix your PATH or run configure with --enable-clang"
581+
fi
582+
562583
fi
563584
fi
564585

@@ -889,9 +910,11 @@ do
889910
# Try to have LLVM pull in as few dependencies as possible (#9397)
890911
LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi"
891912

892-
# pthreads works badly on mingw-w64 systems: #8996
913+
# Use win32 native thread/lock apis instead of pthread wrapper.
914+
# (llvm's configure tries to find pthread first, so we have to disable it explicitly.)
915+
# Also note that pthreads works badly on mingw-w64 systems: #8996
893916
case "$CFG_BUILD" in
894-
(*w64-mingw32)
917+
(*-mingw32)
895918
LLVM_OPTS="$LLVM_OPTS --disable-pthreads"
896919
;;
897920
esac

branches/try2/doc/rust.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ dd {
216216
list-style-type: none;
217217
padding-left: 0px;
218218
}
219+
/* Only display one level of hierarchy in the TOC */
220+
#TOC ul ul {
221+
display: none;
222+
}
219223

220224
sub,
221225
sup {

branches/try2/doc/rust.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ extern mod extra; // equivalent to: extern mod extra = "extra";
790790
791791
extern mod rustextra = "extra"; // linking to 'extra' under another name
792792
793-
extern mod foo = "some/where/foo#1.0"; // a full package ID for rustpkg
793+
extern mod foo = "some/where/rust-foo#foo:1.0"; // a full package ID for rustpkg
794794
~~~~
795795

796796
##### Use declarations
@@ -2177,7 +2177,11 @@ Expressions are divided into two main categories: _lvalues_ and _rvalues_.
21772177
Likewise within each expression, sub-expressions may occur in _lvalue context_ or _rvalue context_.
21782178
The evaluation of an expression depends both on its own category and the context it occurs within.
21792179

2180-
[Path](#path-expressions), [field](#field-expressions) and [index](#index-expressions) expressions are lvalues.
2180+
An lvalue is an expression that represents a memory location. These
2181+
expressions are [paths](#path-expressions) (which refer to local
2182+
variables, function and method arguments, or static variables),
2183+
dereferences (`*expr`), [indexing expressions](#index-expressions)
2184+
(`expr[expr]`), and [field references](#field-expressions) (`expr.f`).
21812185
All other expressions are rvalues.
21822186

21832187
The left operand of an [assignment](#assignment-expressions),
@@ -3325,6 +3329,12 @@ The kinds are:
33253329
This kind includes scalars, owning pointers, owned closures, and
33263330
structural types containing only other owned types.
33273331
All `Send` types are `'static`.
3332+
`Pod`
3333+
: Types of this kind consist of "Plain Old Data"
3334+
which can be copied by simply moving bits.
3335+
All values of this kind can be implicitly copied.
3336+
This kind includes scalars and immutable references,
3337+
as well as structural types containing other `Pod` types.
33283338
`'static`
33293339
: Types of this kind do not contain any borrowed pointers;
33303340
this can be a useful guarantee for code

branches/try2/doc/rustdoc.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,92 @@ javascript and a statically-generated search index. No special web server is
8585
required for the search.
8686

8787
[sundown]: https://github.com/vmg/sundown/
88+
89+
# Testing the Documentation
90+
91+
`rustdoc` has support for testing code examples which appear in the
92+
documentation. This is helpful for keeping code examples up to date with the
93+
source code.
94+
95+
To test documentation, the `--test` argument is passed to rustdoc:
96+
97+
~~~
98+
rustdoc --test crate.rs
99+
~~~
100+
101+
## Defining tests
102+
103+
Rust documentation currently uses the markdown format, and code blocks can refer
104+
to any piece of code-related documentation, which isn't always rust. Because of
105+
this, only code blocks with the language of "rust" will be considered for
106+
testing.
107+
108+
~~~
109+
```rust
110+
// This is a testable code block
111+
```
112+
113+
```
114+
// This is not a testable code block
115+
```
116+
117+
// This is not a testable code block (4-space indent)
118+
~~~
119+
120+
In addition to only testing "rust"-language code blocks, there are additional
121+
specifiers that can be used to dictate how a code block is tested:
122+
123+
~~~
124+
```rust,ignore
125+
// This code block is ignored by rustdoc, but is passed through to the test
126+
// harness
127+
```
128+
129+
```rust,should_fail
130+
// This code block is expected to generate a failure
131+
```
132+
~~~
133+
134+
Rustdoc also supplies some extra sugar for helping with some tedious
135+
documentation examples. If a line is prefixed with a `#` character, then the
136+
line will not show up in the HTML documentation, but it will be used when
137+
testing the code block.
138+
139+
~~~
140+
```rust
141+
# // showing 'fib' in this documentation would just be tedious and detracts from
142+
# // what's actualy being documented.
143+
# fn fib(n: int) { n + 2 }
144+
145+
do spawn { fib(200); }
146+
```
147+
~~~
148+
149+
The documentation online would look like `do spawn { fib(200); }`, but when
150+
testing this code, the `fib` function will be included (so it can compile).
151+
152+
## Running tests (advanced)
153+
154+
Running tests often requires some special configuration to filter tests, find
155+
libraries, or try running ignored examples. The testing framework that rustdoc
156+
uses is build on `extra::test`, which is also used when you compile crates with
157+
rustc's `--test` flag. Extra arguments can be passed to rustdoc's test harness
158+
with the `--test-args` flag.
159+
160+
~~~
161+
// Only run tests containing 'foo' in their name
162+
rustdoc --test lib.rs --test-args 'foo'
163+
164+
// See what's possible when running tests
165+
rustdoc --test lib.rs --test-args '--help'
166+
167+
// Run all ignored tests
168+
rustdoc --test lib.rs --test-args '--ignored'
169+
~~~
170+
171+
When testing a library, code examples will often show how functions are used,
172+
and this code often requires `use`-ing paths from the crate. To accomodate this,
173+
rustdoc will implicitly add `extern mod <crate>;` where `<crate>` is the name of
174+
the crate being tested to the top of each code example. This means that rustdoc
175+
must be able to find a compiled version of the library crate being tested. Extra
176+
search paths may be added via the `-L` flag to `rustdoc`.

0 commit comments

Comments
 (0)