Skip to content

Commit d5eac74

Browse files
committed
---
yaml --- r: 130745 b: refs/heads/master c: c2fcd4c h: refs/heads/master i: 130743: 8b1c946 v: v3
1 parent 565ead2 commit d5eac74

File tree

14 files changed

+110
-177
lines changed

14 files changed

+110
-177
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 679b4e1b3870d8dd9349b99a68be4bb95b3d5fa7
2+
refs/heads/master: c2fcd4ca723426c9d708a4cc49da873124e44891
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6faa4f33a42de32579e02a8d030db920d360e2b5
55
refs/heads/try: a2473a89da106f7dd3be86e9d52fe23f43d5bfa5

trunk/Makefile.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
#
6666
# * `VERBOSE=1` - Print all commands. Use this to see what's going on.
6767
# * `RUSTFLAGS=...` - Add compiler flags to all `rustc` invocations
68-
# * `JEMALLOC_FLAGS=...` - Pass flags to jemalloc's configure script
6968
#
7069
# * `TESTNAME=...` - Specify the name of tests to run
7170
# * `CHECK_IGNORED=1` - Run normally-ignored tests

trunk/mk/main.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,15 @@ endif
9090
CFG_RUSTC_FLAGS := $(RUSTFLAGS)
9191
CFG_GCCISH_CFLAGS :=
9292
CFG_GCCISH_LINK_FLAGS :=
93-
CFG_JEMALLOC_FLAGS :=
9493

9594
ifdef CFG_DISABLE_OPTIMIZE
9695
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
9796
CFG_RUSTC_FLAGS +=
98-
CFG_JEMALLOC_FLAGS += --enable-debug
9997
else
10098
# The rtopt cfg turns off runtime sanity checks
10199
CFG_RUSTC_FLAGS += -O --cfg rtopt
102100
endif
103101

104-
CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS)
105-
106102
ifdef CFG_DISABLE_DEBUG
107103
CFG_RUSTC_FLAGS += --cfg ndebug
108104
CFG_GCCISH_CFLAGS += -DRUST_NDEBUG

trunk/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ JEMALLOC_LOCAL_$(1) := $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1
301301
$$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
302302
@$$(call E, make: jemalloc)
303303
cd "$$(JEMALLOC_BUILD_DIR_$(1))"; "$(S)src/jemalloc/configure" \
304-
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ $(CFG_JEMALLOC_FLAGS) \
304+
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ \
305305
--build=$(CFG_BUILD) --host=$(1) \
306306
CC="$$(CC_$(1))" \
307307
AR="$$(AR_$(1))" \

trunk/src/doc/index.md

Lines changed: 63 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,18 @@
11
% Rust Documentation
22

3-
Welcome to the Rust documentation! You can use the section headings above
4-
to jump to any particular section.
5-
6-
# Getting Started
7-
8-
If you haven't seen Rust at all yet, the first thing you should read is the [30
9-
minute intro](intro.html). It will give you an overview of the basic ideas of Rust
10-
at a high level.
11-
12-
Once you know you really want to learn Rust, the next step is reading [the
13-
guide](guide.html). It is a lengthy explanation of Rust, its syntax, and its
14-
concepts. Upon completing the guide, you'll be an intermediate Rust developer,
15-
and will have a good grasp of the fundamental ideas behind Rust.
16-
17-
# Community & Getting Help
18-
19-
If you need help with something, or just want to talk about Rust with others,
20-
there's a few places you can do that:
21-
22-
The Rust IRC channels on [irc.mozilla.org](http://irc.mozilla.org/) are the
23-
fastest way to get help.
24-
[`#rust`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) is
25-
the general discussion channel, and you'll find people willing to help you with
26-
any questions you may have.
27-
28-
There are also three specialty channels:
29-
[`#rust-gamedev`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-gamedev)
30-
and
31-
[`#rust-osdev`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-osdev)
32-
are for game development and operating system development, respectively.
33-
There's also
34-
[`#rust-internals`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals), which is for discussion of the development of Rust itself.
35-
36-
You can also get help on [Stack
37-
Overflow](http://stackoverflow.com/questions/tagged/rust). Searching for your
38-
problem might reveal someone who has asked it before!
39-
40-
There is an active [subreddit](http://reddit.com/r/rust) with lots of
41-
discussion about Rust.
42-
43-
There is also a [developer forum](http://discuss.rust-lang.org/), where the
44-
development of Rust itself is discussed.
3+
<!-- Completely hide the TOC and the section numbers -->
4+
<style type="text/css">
5+
#TOC { display: none; }
6+
.header-section-number { display: none; }
7+
li {list-style-type: none; }
8+
</style>
459

10+
* [A 30-minute Intro to Rust](intro.html)
11+
* [The Rust tutorial](tutorial.html) (* [PDF](tutorial.pdf))
12+
* [The Rust reference manual](rust.html) (* [PDF](rust.pdf))
4613

4714
# Guides
4815

49-
Rust Guides are in-depth looks at a particular topic that's relevant to Rust
50-
development. If you're trying to figure out how to do something, there may be
51-
a guide that can help you out:
52-
5316
* [Strings](guide-strings.html)
5417
* [Pointers](guide-pointers.html)
5518
* [References and Lifetimes](guide-lifetimes.html)
@@ -61,43 +24,70 @@ a guide that can help you out:
6124
* [Testing](guide-testing.html)
6225
* [Rust's Runtime](guide-runtime.html)
6326

64-
# Tools
65-
66-
Rust's still a young language, so there isn't a ton of tooling yet, but the
67-
tools we have are really nice.
68-
69-
[Cargo](http://crates.io) is Rust's package manager, and its website contains
70-
lots of good documentation.
71-
72-
[The `rustdoc` manual](rustdoc.html) contains information about Rust's
73-
documentation tool.
74-
7527
# FAQs
7628

77-
There are questions that are asked quite often, and so we've made FAQs for them:
78-
7929
* [Language Design FAQ](complement-design-faq.html)
8030
* [Language FAQ](complement-lang-faq.html)
8131
* [Project FAQ](complement-project-faq.html)
8232
* [How to submit a bug report](complement-bugreport.html)
8333

84-
# The standard library
85-
86-
You can find function-level documentation for the entire standard library
87-
[here](std/index.html). There's a list of crates on the left with more specific
88-
sections, or you can use the search bar at the top to search for something if
89-
you know its name.
34+
# Libraries
35+
36+
* [The standard library, `std`](std/index.html)
37+
38+
<!-- force the two lists to be separate -->
39+
40+
* [The `arena` allocation library](arena/index.html)
41+
* [The `collections` library](collections/index.html)
42+
* [The `flate` compression library](flate/index.html)
43+
* [The `fourcc` four-character code library](fourcc/index.html)
44+
* [The `getopts` argument parsing library](getopts/index.html)
45+
* [The `glob` file path matching library](glob/index.html)
46+
* [The `green` M:N runtime library](green/index.html)
47+
* [The `hexfloat` library for hexadecimal floating-point literals](hexfloat/index.html)
48+
* [The `libc` bindings](libc/index.html)
49+
* [The `native` 1:1 threading runtime](native/index.html)
50+
* [The `num` arbitrary precision numerics library](num/index.html)
51+
* [The `rand` library for random numbers and distributions](rand/index.html)
52+
* [The `regex` library for regular expressions](regex/index.html)
53+
* [The `rustc` compiler](rustc/index.html)
54+
* [The `rustuv` M:N I/O library](rustuv/index.html)
55+
* [The `semver` version collation library](semver/index.html)
56+
* [The `serialize` value encoding/decoding library](serialize/index.html)
57+
* [The `sync` library for concurrency-enabled mechanisms and primitives](sync/index.html)
58+
* [The `syntax` library, the Rust parser](syntax/index.html)
59+
* [The `term` terminal-handling library](term/index.html)
60+
* [The `test` library containing the unit-testing & micro-benchmark framework](test/index.html)
61+
* [The `time` library](time/index.html)
62+
* [The `uuid` 128-bit universally unique identifier library](uuid/index.html)
63+
* [The `url` library](url/index.html)
64+
* [The `log` library](log/index.html)
65+
66+
# Tooling
67+
68+
* [The `rustdoc` manual](rustdoc.html)
9069

9170
# External documentation
9271

93-
*Note: While these are great resources for learning Rust, they may track a
94-
particular version of Rust that is likely not exactly the same as that for
95-
which this documentation was generated.*
72+
*Note: While these are great resources for learning Rust, they may
73+
track a particular version of Rust that is likely not exactly the same
74+
as that for which this documentation was generated.*
9675

97-
* [Rust by Example] - Short examples of common tasks in Rust (tracks the master
98-
branch).
99-
* [Rust for Rubyists] - The first community tutorial for Rust. Tracks the last
100-
stable release. Not just for Ruby programmers.
76+
* [Rust for Rubyists] - An excellent introduction for Rust; not just for Rubyists (tracks the most recent release).
77+
* [Rust by Example] - Short examples of common tasks in Rust (tracks the master branch).
78+
* [The Rust wiki](http://github.com/rust-lang/rust/wiki)
10179

102-
[Rust by Example]: http://rustbyexample.com/
10380
[Rust for Rubyists]: http://www.rustforrubyists.com/
81+
[Rust by Example]: http://rustbyexample.com/
82+
83+
# Community
84+
85+
* [Reddit](http://reddit.com/r/rust)
86+
* [Stack Overflow](http://stackoverflow.com/questions/tagged/rust)
87+
* [Developer Forum](http://discuss.rust-lang.org/)
88+
* The Rust IRC channels on [irc.mozilla.org](http://irc.mozilla.org/):
89+
* [`#rust`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) - general discussion
90+
* [`#rust-gamedev`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-gamedev) - game development
91+
* [`#rust-internals`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals) - compiler and libraries
92+
* [`#rust-osdev`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-osdev) - operating system development
93+

trunk/src/doc/rust.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,36 +3564,34 @@ let (a, b) = p;
35643564
assert!(b != "world");
35653565
~~~~
35663566

3567-
### Vector, Array, and Slice types
3567+
### Vector types
35683568

3569-
Rust has three different types for a list of items:
3569+
The vector type constructor represents a homogeneous array of values of a given type.
3570+
A vector has a fixed size.
3571+
(Operations like `vec.push` operate solely on owned vectors.)
3572+
A vector type can be annotated with a _definite_ size, such as `[int, ..10]`.
3573+
Such a definite-sized vector type is a first-class type, since its size is known statically.
3574+
A vector without such a size is said to be of _indefinite_ size,
3575+
and is therefore not a _first-class_ type.
3576+
An indefinite-size vector can only be instantiated through a pointer type,
3577+
such as `&[T]` or `Vec<T>`.
3578+
The kind of a vector type depends on the kind of its element type,
3579+
as with other simple structural types.
35703580

3571-
* `Vec<T>`, a 'vector'
3572-
* `[T ..N]`, an 'array'
3573-
* `&[T]`, a 'slice'.
3581+
Expressions producing vectors of definite size cannot be evaluated in a
3582+
context expecting a vector of indefinite size; one must copy the
3583+
definite-sized vector contents into a distinct vector of indefinite size.
35743584

3575-
A vector is a heap-allocated list of `T`. A vector has ownership over the data
3576-
inside of it. It is also able to grow and change in size. It's important to note
3577-
that `Vec<T>` is a library type, it's not actually part of the core language.
3585+
An example of a vector type and its use:
35783586

3579-
An array has a fixed size, and can be allocated on either the stack or the heap.
3580-
3581-
A slice is a 'view' into a vector or array. It doesn't own the data it points
3582-
to, it borrows it.
3583-
3584-
An example of each kind:
3585-
3586-
```{rust}
3587-
let vec: Vec<int> = vec![1, 2, 3];
3588-
let arr: [int, ..3] = [1, 2, 3];
3589-
let s: &[int] = vec.as_slice();
3590-
```
3591-
3592-
As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
3593-
`vec!` macro is also part of the standard library, rather than the language.
3587+
~~~~
3588+
let v: &[int] = &[7, 5, 3];
3589+
let i: int = v[2];
3590+
assert!(i == 3);
3591+
~~~~
35943592

3595-
All in-bounds elements of vectors, arrays, and slices are always initialized,
3596-
and access to a vector, array, or slice is always bounds-checked.
3593+
All in-bounds elements of a vector are always initialized,
3594+
and access to a vector is always bounds-checked.
35973595

35983596
### Structure types
35993597

trunk/src/libcore/ops.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
*
5656
*/
5757

58+
use kinds::Sized;
59+
5860
/**
5961
*
6062
* The `Drop` trait is used to run some code when a value goes out of scope. This
@@ -700,7 +702,7 @@ pub trait IndexMut<Index,Result> {
700702
* ```
701703
*/
702704
#[lang="deref"]
703-
pub trait Deref<Result> {
705+
pub trait Deref<Sized? Result> {
704706
/// The method called to dereference a value
705707
fn deref<'a>(&'a self) -> &'a Result;
706708
}
@@ -740,7 +742,7 @@ pub trait Deref<Result> {
740742
* ```
741743
*/
742744
#[lang="deref_mut"]
743-
pub trait DerefMut<Result>: Deref<Result> {
745+
pub trait DerefMut<Sized? Result>: Deref<Result> {
744746
/// The method called to mutably dereference a value
745747
fn deref_mut<'a>(&'a mut self) -> &'a mut Result;
746748
}

trunk/src/librand/isaac.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,7 @@ impl Rng for IsaacRng {
185185
self.isaac();
186186
}
187187
self.cnt -= 1;
188-
189-
// self.cnt is at most RAND_SIZE, but that is before the
190-
// subtraction above. We want to index without bounds
191-
// checking, but this could lead to incorrect code if someone
192-
// misrefactors, so we check, sometimes.
193-
//
194-
// (Changes here should be reflected in Isaac64Rng.next_u64.)
195-
debug_assert!(self.cnt < RAND_SIZE);
196-
197-
// (the % is cheaply telling the optimiser that we're always
198-
// in bounds, without unsafe. NB. this is a power of two, so
199-
// it optimises to a bitwise mask).
200-
self.rsl[(self.cnt % RAND_SIZE) as uint]
188+
self.rsl[self.cnt as uint]
201189
}
202190
}
203191

@@ -428,11 +416,7 @@ impl Rng for Isaac64Rng {
428416
self.isaac64();
429417
}
430418
self.cnt -= 1;
431-
432-
// See corresponding location in IsaacRng.next_u32 for
433-
// explanation.
434-
debug_assert!(self.cnt < RAND_SIZE_64)
435-
self.rsl[(self.cnt % RAND_SIZE_64) as uint]
419+
unsafe { *self.rsl.unsafe_get(self.cnt) }
436420
}
437421
}
438422

trunk/src/librustc/middle/kind.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,15 @@ fn check_item(cx: &mut Context, item: &Item) {
199199
cx,
200200
item.span,
201201
&*trait_ref);
202+
203+
let trait_def = ty::lookup_trait_def(cx.tcx, trait_ref.def_id);
204+
for (ty, type_param_def) in trait_ref.substs.types
205+
.iter()
206+
.zip(trait_def.generics
207+
.types
208+
.iter()) {
209+
check_typaram_bounds(cx, item.span, *ty, type_param_def);
210+
}
202211
}
203212
}
204213
}

0 commit comments

Comments
 (0)