Skip to content

Commit 9d6ea81

Browse files
committed
---
yaml --- r: 207742 b: refs/heads/snap-stage3 c: cadc67e h: refs/heads/master v: v3
1 parent 636a05b commit 9d6ea81

File tree

120 files changed

+3534
-932
lines changed

Some content is hidden

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

120 files changed

+3534
-932
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 38a97becdf3e6a6157f6f7ec2d98ade8d8edc193
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 247842b741db380fbd0e0d73f37e86f6c561ca9d
4+
refs/heads/snap-stage3: cadc67e8fd942e0a3896ed0d5375444b221e60d7
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,7 @@ do
11521152
make_dir $h/test/run-pass-valgrind
11531153
make_dir $h/test/run-pass-fulldeps
11541154
make_dir $h/test/run-fail
1155+
make_dir $h/test/run-fail-fulldeps
11551156
make_dir $h/test/compile-fail
11561157
make_dir $h/test/parse-fail
11571158
make_dir $h/test/compile-fail-fulldeps

branches/snap-stage3/mk/tests.mk

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
304304
check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
305305
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
306306
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
307+
check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
307308
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
308309
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
309310
check-stage$(1)-T-$(2)-H-$(3)-rustdocck-exec \
@@ -345,6 +346,7 @@ check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
345346
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-valgrind-exec \
346347
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
347348
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-exec \
349+
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-full-exec \
348350
check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-exec \
349351
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-exec
350352

@@ -464,6 +466,7 @@ $(foreach host,$(CFG_HOST), \
464466
RPASS_RS := $(wildcard $(S)src/test/run-pass/*.rs)
465467
RPASS_VALGRIND_RS := $(wildcard $(S)src/test/run-pass-valgrind/*.rs)
466468
RPASS_FULL_RS := $(wildcard $(S)src/test/run-pass-fulldeps/*.rs)
469+
RFAIL_FULL_RS := $(wildcard $(S)src/test/run-fail-fulldeps/*.rs)
467470
CFAIL_FULL_RS := $(wildcard $(S)src/test/compile-fail-fulldeps/*.rs)
468471
RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
469472
CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
@@ -483,6 +486,7 @@ PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
483486
RPASS_TESTS := $(RPASS_RS)
484487
RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
485488
RPASS_FULL_TESTS := $(RPASS_FULL_RS)
489+
RFAIL_FULL_TESTS := $(RFAIL_FULL_RS)
486490
CFAIL_FULL_TESTS := $(CFAIL_FULL_RS)
487491
RFAIL_TESTS := $(RFAIL_RS)
488492
CFAIL_TESTS := $(CFAIL_RS)
@@ -510,6 +514,11 @@ CTEST_BUILD_BASE_rpass-full = run-pass-fulldeps
510514
CTEST_MODE_rpass-full = run-pass
511515
CTEST_RUNTOOL_rpass-full = $(CTEST_RUNTOOL)
512516

517+
CTEST_SRC_BASE_rfail-full = run-fail-fulldeps
518+
CTEST_BUILD_BASE_rfail-full = run-fail-fulldeps
519+
CTEST_MODE_rfail-full = run-fail
520+
CTEST_RUNTOOL_rfail-full = $(CTEST_RUNTOOL)
521+
513522
CTEST_SRC_BASE_cfail-full = compile-fail-fulldeps
514523
CTEST_BUILD_BASE_cfail-full = compile-fail-fulldeps
515524
CTEST_MODE_cfail-full = compile-fail
@@ -661,6 +670,7 @@ endif
661670
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
662671
CTEST_DEPS_rpass-valgrind_$(1)-T-$(2)-H-$(3) = $$(RPASS_VALGRIND_TESTS)
663672
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
673+
CTEST_DEPS_rfail-full_$(1)-T-$(2)-H-$(3) = $$(RFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
664674
CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
665675
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
666676
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
@@ -737,7 +747,7 @@ endif
737747

738748
endef
739749

740-
CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail pfail \
750+
CTEST_NAMES = rpass rpass-valgrind rpass-full rfail-full cfail-full rfail cfail pfail \
741751
bench perf debuginfo-gdb debuginfo-lldb codegen rustdocck
742752

743753
$(foreach host,$(CFG_HOST), \
@@ -746,22 +756,26 @@ $(foreach host,$(CFG_HOST), \
746756
$(eval $(foreach name,$(CTEST_NAMES), \
747757
$(eval $(call DEF_RUN_COMPILETEST,$(stage),$(target),$(host),$(name))))))))))
748758

749-
PRETTY_NAMES = pretty-rpass pretty-rpass-valgrind pretty-rpass-full pretty-rfail pretty-bench pretty-pretty
759+
PRETTY_NAMES = pretty-rpass pretty-rpass-valgrind pretty-rpass-full pretty-rfail-full pretty-rfail \
760+
pretty-bench pretty-pretty
750761
PRETTY_DEPS_pretty-rpass = $(RPASS_TESTS)
751762
PRETTY_DEPS_pretty-rpass-valgrind = $(RPASS_VALGRIND_TESTS)
752763
PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
764+
PRETTY_DEPS_pretty-rfail-full = $(RFAIL_FULL_TESTS)
753765
PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
754766
PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
755767
PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
756768
PRETTY_DIRNAME_pretty-rpass = run-pass
757769
PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind
758770
PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
771+
PRETTY_DIRNAME_pretty-rfail-full = run-fail-fulldeps
759772
PRETTY_DIRNAME_pretty-rfail = run-fail
760773
PRETTY_DIRNAME_pretty-bench = bench
761774
PRETTY_DIRNAME_pretty-pretty = pretty
762775

763776
define DEF_PRETTY_FULLDEPS
764777
PRETTY_DEPS$(1)_T_$(2)_H_$(3)_pretty-rpass-full = $$(CSREQ$(1)_T_$(3)_H_$(3))
778+
PRETTY_DEPS$(1)_T_$(2)_H_$(3)_pretty-rfail-full = $$(CSREQ$(1)_T_$(3)_H_$(3))
765779
endef
766780

767781
$(foreach host,$(CFG_HOST), \
@@ -901,6 +915,7 @@ TEST_GROUPS = \
901915
rpass \
902916
rpass-valgrind \
903917
rpass-full \
918+
rfail-full \
904919
cfail-full \
905920
rfail \
906921
cfail \
@@ -918,6 +933,7 @@ TEST_GROUPS = \
918933
pretty-rpass \
919934
pretty-rpass-valgrind \
920935
pretty-rpass-full \
936+
pretty-rfail-full \
921937
pretty-rfail \
922938
pretty-bench \
923939
pretty-pretty \

branches/snap-stage3/src/doc/reference.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ that does _not_ occur in the set of [keywords](#keywords).
8484
## Comments
8585

8686
Comments in Rust code follow the general C++ style of line (`//`) and
87-
block-comment (`/* ... */`) forms. Nested block comments are supported.
87+
block (`/* ... */`) comment forms. Nested block comments are supported.
8888

8989
Line comments beginning with exactly _three_ slashes (`///`), and block
9090
comments beginning with exactly one repeated asterisk in the block-open
@@ -192,13 +192,13 @@ which must be _escaped_ by a preceding `U+005C` character (`\`).
192192

193193
A _string literal_ is a sequence of any Unicode characters enclosed within two
194194
`U+0022` (double-quote) characters, with the exception of `U+0022` itself,
195-
which must be _escaped_ by a preceding `U+005C` character (`\`), or a _raw
196-
string literal_.
195+
which must be _escaped_ by a preceding `U+005C` character (`\`).
197196

198-
A multi-line string literal may be defined by terminating each line with a
199-
`U+005C` character (`\`) immediately before the newline. This causes the
200-
`U+005C` character, the newline, and all whitespace at the beginning of the
201-
next line to be ignored.
197+
Line-break characters are allowed in string literals. Normally they represent
198+
themselves (i.e. no translation), but as a special exception, when a `U+005C`
199+
character (`\`) occurs immediately before the newline, the `U+005C` character,
200+
the newline, and all whitespace at the beginning of the next line are ignored.
201+
Thus `a` and `b` are equal:
202202

203203
```rust
204204
let a = "foobar";
@@ -366,11 +366,19 @@ A _floating-point literal_ has one of two forms:
366366
optionally followed by another decimal literal, with an optional _exponent_.
367367
* A single _decimal literal_ followed by an _exponent_.
368368

369-
By default, a floating-point literal has a generic type, and, like integer
370-
literals, the type must be uniquely determined from the context. There are two valid
369+
Like integer literals, a floating-point literal may be followed by a
370+
suffix, so long as the pre-suffix part does not end with `U+002E` (`.`).
371+
The suffix forcibly sets the type of the literal. There are two valid
371372
_floating-point suffixes_, `f32` and `f64` (the 32-bit and 64-bit floating point
372373
types), which explicitly determine the type of the literal.
373374

375+
The type of an _unsuffixed_ floating-point literal is determined by type
376+
inference. If a floating-point type can be _uniquely_ determined from the
377+
surrounding program context, the unsuffixed floating-point literal has that type.
378+
If the program context underconstrains the type, it defaults to double-precision `f64`;
379+
if the program context overconstrains the type, it is considered a static type
380+
error.
381+
374382
Examples of floating-point literals of various forms:
375383

376384
```
@@ -2127,7 +2135,10 @@ The currently implemented features of the reference compiler are:
21272135
semantics are likely to change, so this macro usage must be opted
21282136
into.
21292137

2130-
* `associated_types` - Allows type aliases in traits. Experimental.
2138+
* `associated_consts` - Allows constants to be defined in `impl` and `trait`
2139+
blocks, so that they can be associated with a type or
2140+
trait in a similar manner to methods and associated
2141+
types.
21312142

21322143
* `box_patterns` - Allows `box` patterns, the exact semantics of which
21332144
is subject to change.

branches/snap-stage3/src/doc/trpl/hello-cargo.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ $ mkdir src
3232
$ mv main.rs src/main.rs
3333
```
3434

35+
Note that since we're creating an executable, we used `main.rs`. If we
36+
want to make a library instead, we should use `lib.rs`.
37+
Custom file locations for the entry point can be specified
38+
with a [`[[lib]]` or `[[bin]]`][crates-custom] key in the TOML file described below.
39+
40+
[crates-custom]: http://doc.crates.io/manifest.html#configuring-a-target
41+
3542
Cargo expects your source files to live inside a `src` directory. That leaves
3643
the top level for other things, like READMEs, license information, and anything
3744
not related to your code. Cargo helps us keep our projects nice and tidy. A

branches/snap-stage3/src/doc/trpl/ufcs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ not, and so we need to pass an explicit `&b`.
8989
The form of UFCS we just talked about:
9090

9191
```rust,ignore
92-
Type::method(args);
92+
Trait::method(args);
9393
```
9494

9595
Is a short-hand. There’s an expanded form of this that’s needed in some

branches/snap-stage3/src/doc/trpl/vectors.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
% Vectors
22

33
A ‘vector’ is a dynamic or ‘growable’ array, implemented as the standard
4-
library type [`Vec<T>`][vec]. That `<T>` is a [generic][generic], meaning we
5-
can have vectors of any type. Vectors always allocate their data on the heap.
4+
library type [`Vec<T>`][vec]. The `T` means that we can have vectors
5+
of any type (see the chapter on [generics][generic] for more).
6+
Vectors always allocate their data on the heap.
67
You can create them with the `vec!` macro:
78

89
```rust

branches/snap-stage3/src/grammar/parser-lalr.y

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,20 @@ trait_items
505505
;
506506

507507
trait_item
508-
: trait_type
508+
: trait_const
509+
| trait_type
509510
| trait_method
510511
;
511512

513+
trait_const
514+
: maybe_outer_attrs CONST ident maybe_const_default ';' { $$ = mk_node("ConstTraitItem", 3, $1, $3, $4); }
515+
;
516+
517+
maybe_const_default
518+
: '=' expr { $$ = mk_node("ConstDefault", 1, $2); }
519+
| %empty { $$ = mk_none(); }
520+
;
521+
512522
trait_type
513523
: maybe_outer_attrs TYPE ty_param ';' { $$ = mk_node("TypeTraitItem", 2, $1, $3); }
514524
;
@@ -611,7 +621,16 @@ impl_items
611621
impl_item
612622
: impl_method
613623
| item_macro
614-
| trait_type
624+
| impl_const
625+
| impl_type
626+
;
627+
628+
impl_const
629+
: attrs_and_vis item_const { $$ = mk_node("ImplConst", 1, $1, $2); }
630+
;
631+
632+
impl_type
633+
: attrs_and_vis TYPE ident generic_params '=' ty_sum ';' { $$ = mk_node("ImplType", 4, $1, $3, $4, $6); }
615634
;
616635

617636
item_fn

branches/snap-stage3/src/libcollections/string.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,12 +951,13 @@ impl<'a> Deref for DerefString<'a> {
951951
/// # #![feature(collections)]
952952
/// use std::string::as_string;
953953
///
954-
/// fn string_consumer(s: String) {
955-
/// assert_eq!(s, "foo".to_string());
954+
/// // Let's pretend we have a function that requires `&String`
955+
/// fn string_consumer(s: &String) {
956+
/// assert_eq!(s, "foo");
956957
/// }
957958
///
958-
/// let string = as_string("foo").clone();
959-
/// string_consumer(string);
959+
/// // Provide a `&String` from a `&str` without allocating
960+
/// string_consumer(&as_string("foo"));
960961
/// ```
961962
#[unstable(feature = "collections")]
962963
pub fn as_string<'a>(x: &'a str) -> DerefString<'a> {

branches/snap-stage3/src/libcollections/vec.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ impl<T> Vec<T> {
536536
///
537537
/// # Panics
538538
///
539-
/// Panics if `i` is out of bounds.
539+
/// Panics if `index` is out of bounds.
540540
///
541541
/// # Examples
542542
///
@@ -1915,6 +1915,22 @@ impl<'a, T> Drop for DerefVec<'a, T> {
19151915
}
19161916

19171917
/// Converts a slice to a wrapper type providing a `&Vec<T>` reference.
1918+
///
1919+
/// # Examples
1920+
///
1921+
/// ```
1922+
/// # #![feature(collections)]
1923+
/// use std::vec::as_vec;
1924+
///
1925+
/// // Let's pretend we have a function that requires `&Vec<i32>`
1926+
/// fn vec_consumer(s: &Vec<i32>) {
1927+
/// assert_eq!(s, &[1, 2, 3]);
1928+
/// }
1929+
///
1930+
/// // Provide a `&Vec<i32>` from a `&[i32]` without allocating
1931+
/// let values = [1, 2, 3];
1932+
/// vec_consumer(&as_vec(&values));
1933+
/// ```
19181934
#[unstable(feature = "collections")]
19191935
pub fn as_vec<'a, T>(x: &'a [T]) -> DerefVec<'a, T> {
19201936
unsafe {

branches/snap-stage3/src/libcore/convert.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ pub trait Into<T>: Sized {
8383
/// `String` implements `From<&str>`:
8484
///
8585
/// ```
86-
/// let s = "hello";
8786
/// let string = "hello".to_string();
88-
///
89-
/// let other_string: String = From::from(s);
87+
/// let other_string = String::from("hello");
9088
///
9189
/// assert_eq!(string, other_string);
9290
/// ```

0 commit comments

Comments
 (0)