Skip to content

Commit 9b9dfe3

Browse files
committed
---
yaml --- r: 136981 b: refs/heads/dist-snap c: 4e5666e h: refs/heads/master i: 136979: a650b74 v: v3
1 parent 10c7eaa commit 9b9dfe3

File tree

391 files changed

+5830
-2802
lines changed

Some content is hidden

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

391 files changed

+5830
-2802
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 189b7332968972f34cdbbbd9b62d97ababf53059
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: c348550f4f188bd127b85ed20b1e63fd42622e96
9+
refs/heads/dist-snap: 4e5666eace14651539ca2a1f5eed8cdf0ccfb130
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/.travis.yml

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,60 @@
11
# Use something that's not 'ruby' so we don't set up things like
2-
# RVM/bundler/ruby and whatnot. Right now 'rust' as a language actually
3-
# downloads a rust/cargo snapshot, which we don't really want for building rust.
2+
# RVM/bundler/ruby and whatnot. Right now 'rust' isn't a language on travis and
3+
# it treats unknown languages as ruby-like I believe.
44
language: c
55

6-
# The test suite is in general way too stressful for travis, especially in
7-
# terms of time limit and reliability. In the past we've tried to scale things
8-
# back to only build the stage1 compiler and run a subset of tests, but this
9-
# didn't end up panning out very well.
6+
# Before we start doing anything, install a stock LLVM
7+
install:
8+
- sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.4 main' >> /etc/apt/sources.list"
9+
- sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' >> /etc/apt/sources.list"
10+
- sudo sh -c "echo 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main' >> /etc/apt/sources.list"
11+
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
12+
- sudo apt-get update -qq
13+
- sudo apt-get install -qq --force-yes -y llvm-$LLVM_VERSION
14+
llvm-${LLVM_VERSION}-dev clang-$LLVM_VERSION lldb-$LLVM_VERSION
15+
16+
17+
# All of the llvm tools are suffixed with "-$VERS" which we don't want, so
18+
# symlink them all into a local directory and just use that
1019
#
11-
# As a result, we're just using travis to run `make tidy` now. It'll help
12-
# everyone find out about their trailing spaces early on!
20+
# FIXME: this shouldn't update the src/llvm sub-repo, that takes about a minute
21+
# it's gotta download so much stuff.
1322
before_script:
14-
- ./configure --llvm-root=path/to/nowhere
15-
script:
16-
- make tidy
23+
- mkdir -p local-llvm/bin
24+
- ln -nsf /usr/bin/llvm-config-$LLVM_VERSION local-llvm/bin/llvm-config
25+
- ln -nsf /usr/bin/llvm-mc-$LLVM_VERSION local-llvm/bin/llvm-mc
26+
- ln -nsf /usr/bin/llvm-as-$LLVM_VERSION local-llvm/bin/llvm-as
27+
- ln -nsf /usr/bin/llvm-dis-$LLVM_VERSION local-llvm/bin/llvm-dis
28+
- ln -nsf /usr/bin/llc-$LLVM_VERSION local-llvm/bin/llc
29+
- ln -nsf /usr/include/llvm-$LLVM_VERSION local-llvm/include
30+
- ./configure --disable-optimize-tests --llvm-root=`pwd`/local-llvm
31+
--enable-fast-make --enable-clang
32+
33+
# Tidy everything up first, then build a few things, and then run a few tests.
34+
# Note that this is meant to run in a "fairly small" amount of time, so this
35+
# isn't exhaustive at all.
36+
#
37+
# As a result of https://github.com/travis-ci/travis-ci/issues/1066, we run
38+
# everything in one large command instead of multiple commands.
39+
script: |
40+
if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then
41+
if [[ $LLVM_VERSION != '3.4' ]]; then exit 0; fi
42+
fi &&
43+
make tidy &&
44+
make -j4 rustc-stage1 RUSTFLAGS='-Z time-passes' &&
45+
make check-stage1-std check-stage1-rpass check-stage1-cfail check-stage1-rfail check-stage1-doc
46+
47+
env:
48+
global:
49+
- NO_BENCH=1
50+
matrix:
51+
- LLVM_VERSION=3.3
52+
- LLVM_VERSION=3.4
53+
54+
# We track this ourselves, and in theory we don't have to update the LLVM repo
55+
# (but sadly we do right now anyway).
56+
git:
57+
submodules: false
1758

1859
notifications:
1960
email: false

branches/dist-snap/configure

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,6 @@ do
921921
make_dir $h/test/doc-guide-pointers
922922
make_dir $h/test/doc-guide-container
923923
make_dir $h/test/doc-guide-tasks
924-
make_dir $h/test/doc-guide-plugin
925924
make_dir $h/test/doc-rust
926925
done
927926

branches/dist-snap/mk/ctags.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/llvm,, \
2828
$(patsubst ${CFG_SRC_DIR}src/rt/sundown,, \
2929
$(patsubst ${CFG_SRC_DIR}src/rt/vg,, \
3030
$(wildcard ${CFG_SRC_DIR}src/*) $(wildcard ${CFG_SRC_DIR}src/rt/*) \
31-
)))))))))
31+
)))))))))))
3232
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=-javascript --recurse ${CTAGS_LOCATIONS}
3333
# We could use `--languages=Rust`, but there is value in producing tags for the
3434
# C++ parts of the code base too (at the time of writing, those are .h and .cpp

branches/dist-snap/mk/docs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
######################################################################
2828
DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
2929
guide-tasks guide-container guide-pointers guide-testing \
30-
guide-runtime guide-plugin complement-bugreport \
30+
guide-runtime complement-bugreport \
3131
complement-lang-faq complement-design-faq complement-project-faq rust \
3232
rustdoc guide-unsafe guide-strings reference
3333

branches/dist-snap/mk/rt.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# that's per-target so you're allowed to conditionally add files based on the
3636
# target.
3737
################################################################################
38-
NATIVE_LIBS := rust_builtin hoedown morestack miniz context_switch \
38+
NATIVE_LIBS := rust_builtin hoedown uv_support morestack miniz context_switch \
3939
rustrt_native rust_test_helpers
4040

4141
# $(1) is the target triple
@@ -50,6 +50,7 @@ NATIVE_DEPS_hoedown_$(1) := hoedown/src/autolink.c \
5050
hoedown/src/html_smartypants.c \
5151
hoedown/src/stack.c \
5252
hoedown/src/version.c
53+
NATIVE_DEPS_uv_support_$(1) := rust_uv.c
5354
NATIVE_DEPS_miniz_$(1) = miniz.c
5455
NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
5556
rust_android_dummy.c

branches/dist-snap/mk/tests.mk

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,12 @@ ALL_HS := $(filter-out $(S)src/rt/valgrind/valgrind.h \
261261
tidy:
262262
@$(call E, check: formatting)
263263
$(Q)find $(S)src -name '*.r[sc]' \
264-
-and -not -regex '^$(S)src/jemalloc.*' \
265-
-and -not -regex '^$(S)src/libuv.*' \
266-
-and -not -regex '^$(S)src/llvm.*' \
267-
-and -not -regex '^$(S)src/gyp.*' \
268-
-and -not -regex '^$(S)src/libbacktrace.*' \
269-
-print0 \
270-
| xargs -0 -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
264+
| grep '^$(S)src/jemalloc' -v \
265+
| grep '^$(S)src/libuv' -v \
266+
| grep '^$(S)src/llvm' -v \
267+
| grep '^$(S)src/gyp' -v \
268+
| grep '^$(S)src/libbacktrace' -v \
269+
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
271270
$(Q)find $(S)src/etc -name '*.py' \
272271
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
273272
$(Q)find $(S)src/doc -name '*.js' \

branches/dist-snap/src/doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ something like:
3333
pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md
3434
~~~~
3535

36-
(reference.md being the Rust Reference Manual.)
36+
(rust.md being the Rust Reference Manual.)
3737

3838
The syntax for pandoc flavored markdown can be found at:
3939
http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown

branches/dist-snap/src/doc/complement-design-faq.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ representation as a primitive. This allows using Rust `enum`s in FFI where C
3939
`enum`s are also used, for most use cases. The attribute can also be applied
4040
to `struct`s to get the same layout as a C struct would.
4141

42-
[repr]: reference.html#miscellaneous-attributes
42+
[repr]: http://doc.rust-lang.org/rust.html#miscellaneous-attributes
4343

4444
## There is no GC
4545

@@ -56,7 +56,7 @@ Types which are [`Sync`][sync] are thread-safe when multiple shared
5656
references to them are used concurrently. Types which are not `Sync` are not
5757
thread-safe, and thus when used in a global require unsafe code to use.
5858

59-
[sync]: core/kinds/trait.Sync.html
59+
[sync]: http://doc.rust-lang.org/core/kinds/trait.Sync.html
6060

6161
### If mutable static items that implement `Sync` are safe, why is taking &mut SHARABLE unsafe?
6262

@@ -139,8 +139,8 @@ and explicitly calling the `clone` method. Making user-defined copy operators
139139
explicit surfaces the underlying complexity, forcing the developer to opt-in
140140
to potentially expensive operations.
141141

142-
[copy]: core/kinds/trait.Copy.html
143-
[clone]: core/clone/trait.Clone.html
142+
[copy]: http://doc.rust-lang.org/core/kinds/trait.Copy.html
143+
[clone]: http://doc.rust-lang.org/core/clone/trait.Clone.html
144144

145145
## No move constructors
146146

branches/dist-snap/src/doc/guide-lifetimes.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,21 @@ copying.
305305
# Circle(Point, f64), // origin, radius
306306
# Rectangle(Point, Size) // upper-left, dimensions
307307
# }
308+
# static tau: f64 = 6.28;
308309
fn compute_area(shape: &Shape) -> f64 {
309310
match *shape {
310-
Circle(_, radius) => std::f64::consts::PI * radius * radius,
311+
Circle(_, radius) => 0.5 * tau * radius * radius,
311312
Rectangle(_, ref size) => size.w * size.h
312313
}
313314
}
314315
~~~
315316

316317
The first case matches against circles. Here, the pattern extracts the
317318
radius from the shape variant and the action uses it to compute the
318-
area of the circle.
319+
area of the circle. (Like any up-to-date engineer, we use the [tau
320+
circle constant][tau] and not that dreadfully outdated notion of pi).
321+
322+
[tau]: http://www.math.utah.edu/~palais/pi.html
319323

320324
The second match is more interesting. Here we match against a
321325
rectangle and extract its size: but rather than copy the `size`

branches/dist-snap/src/doc/guide-macros.md

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
% The Rust Macros Guide
22

3-
<div class="unstable-feature">
4-
<b>Warning:</b> There are currently various problems with invoking macros, how
5-
they interact with their environment, and how they are used outside of the
6-
location in which they are defined. Macro definitions are likely to change
7-
slightly in the future. For this reason, they are hidden behind the
8-
<code>macro_rules</code> <a href="reference.html#compiler-features">feature
9-
attribute</a>.
10-
</div>
11-
123
# Introduction
134

145
Functions are the primary tool that programmers can use to build abstractions.
@@ -457,66 +448,6 @@ fn main() {
457448
The two `'x` names did not clash, which would have caused the loop
458449
to print "I am never printed" and to run forever.
459450

460-
# Scoping and macro import/export
461-
462-
Macros occupy a single global namespace. The interaction with Rust's system of
463-
modules and crates is somewhat complex.
464-
465-
Definition and expansion of macros both happen in a single depth-first,
466-
lexical-order traversal of a crate's source. So a macro defined at module scope
467-
is visible to any subsequent code in the same module, which includes the body
468-
of any subsequent child `mod` items.
469-
470-
If a module has the `macro_escape` attribute, its macros are also visible in
471-
its parent module after the child's `mod` item. If the parent also has
472-
`macro_escape` then the macros will be visible in the grandparent after the
473-
parent's `mod` item, and so forth.
474-
475-
Independent of `macro_escape`, the `macro_export` attribute controls visibility
476-
between crates. Any `macro_rules!` definition with the `macro_export`
477-
attribute will be visible to other crates that have loaded this crate with
478-
`phase(plugin)`. There is currently no way for the importing crate to control
479-
which macros are imported.
480-
481-
An example:
482-
483-
```rust
484-
# #![feature(macro_rules)]
485-
macro_rules! m1 (() => (()))
486-
487-
// visible here: m1
488-
489-
mod foo {
490-
// visible here: m1
491-
492-
#[macro_export]
493-
macro_rules! m2 (() => (()))
494-
495-
// visible here: m1, m2
496-
}
497-
498-
// visible here: m1
499-
500-
macro_rules! m3 (() => (()))
501-
502-
// visible here: m1, m3
503-
504-
#[macro_escape]
505-
mod bar {
506-
// visible here: m1, m3
507-
508-
macro_rules! m4 (() => (()))
509-
510-
// visible here: m1, m3, m4
511-
}
512-
513-
// visible here: m1, m3, m4
514-
# fn main() { }
515-
```
516-
517-
When this library is loaded with `#[phase(plugin)] extern crate`, only `m2`
518-
will be imported.
519-
520451
# A final note
521452

522453
Macros, as currently implemented, are not for the faint of heart. Even
@@ -526,10 +457,3 @@ tricky. Invoking the `log_syntax!` macro can help elucidate intermediate
526457
states, invoking `trace_macros!(true)` will automatically print those
527458
intermediate states out, and passing the flag `--pretty expanded` as a
528459
command-line argument to the compiler will show the result of expansion.
529-
530-
If Rust's macro system can't do what you need, you may want to write a
531-
[compiler plugin](guide-plugin.html) instead. Compared to `macro_rules!`
532-
macros, this is significantly more work, the interfaces are much less stable,
533-
and the warnings about debugging apply ten-fold. In exchange you get the
534-
flexibility of running arbitrary Rust code within the compiler. Syntax
535-
extension plugins are sometimes called "procedural macros" for this reason.

0 commit comments

Comments
 (0)