Skip to content

Commit 9d36c9a

Browse files
committed
---
yaml --- r: 152053 b: refs/heads/try2 c: 6ddd40d h: refs/heads/master i: 152051: 434f2fb v: v3
1 parent 68314d6 commit 9d36c9a

File tree

14 files changed

+43
-212
lines changed

14 files changed

+43
-212
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: 1e2bb09bbbbae4470fef295d245304fe08e1acab
8+
refs/heads/try2: 6ddd40d4368b1dbbc6bfa18d73d47beb05a55447
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/tutorial.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,13 @@ they don't contain references to names that aren't actually defined.
5757
5858
# Getting started
5959

60-
There are two ways to install the Rust compiler: by building from source or
61-
by downloading prebuilt binaries or installers for your platform. The
62-
[install page][rust-install] contains links to download binaries for both
63-
the nightly build and the most current Rust major release. For Windows and
64-
OS X, the install page provides links to native installers.
60+
> *Warning:* The tarball and installer links are for the most recent
61+
> release, not master. To use master, you **must** build from [git].
6562
66-
> *Note:* Windows users should read the detailed
67-
> [Getting started][wiki-start] notes on the wiki. Even when using
68-
> the binary installer, the Windows build requires a MinGW installation,
69-
> the precise details of which are not discussed here.
70-
71-
For Linux and OS X, the install page provides links to binary tarballs.
72-
To install the Rust compiler from the from a binary tarball, download
73-
the binary package, extract it, and execute the `install.sh` script in
74-
the root directory of the package.
75-
76-
To build the Rust compiler from source, you will need to obtain the source through
77-
[Git][git] or by downloading the source package from the [install page][rust-install].
63+
The Rust compiler currently must be built from a [tarball] or [git], unless
64+
you are on Windows, in which case using the [installer][win-exe] is
65+
recommended. There is a list of community-maintained nightly builds and
66+
packages [on the wiki][wiki-packages].
7867

7968
Since the Rust compiler is written in Rust, it must be built by
8069
a precompiled "snapshot" version of itself (made in an earlier state
@@ -90,9 +79,13 @@ Snapshot binaries are currently built and tested on several platforms:
9079
You may find that other platforms work, but these are our "tier 1"
9180
supported build environments that are most likely to work.
9281

82+
> *Note:* Windows users should read the detailed
83+
> [Getting started][wiki-start] notes on the wiki. Even when using
84+
> the binary installer, the Windows build requires a MinGW installation,
85+
> the precise details of which are not discussed here.
86+
9387
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
9488
[git]: https://github.com/mozilla/rust.git
95-
[rust-install]: http://www.rust-lang.org/install.html
9689

9790
To build from source you will also need the following prerequisite
9891
packages:
@@ -1106,7 +1099,7 @@ let ys = xs;
11061099
11071100
xs = Nil;
11081101
1109-
// `xs` can't be used again
1102+
// `xs` can be used again
11101103
~~~
11111104

11121105
A destructor call will only occur for a variable that has not been moved from,

branches/try2/src/libcore/tuple.rs

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,55 +9,8 @@
99
// except according to those terms.
1010

1111
//! Operations on tuples
12-
//!
13-
//! To access a single element of a tuple one can use the following
14-
//! methods:
15-
//!
16-
//! * `valN` - returns a value of _N_-th element
17-
//! * `refN` - returns a reference to _N_-th element
18-
//! * `mutN` - returns a mutable reference to _N_-th element
19-
//!
20-
//! Indexing starts from zero, so `val0` returns first value, `val1`
21-
//! returns second value, and so on. In general, a tuple with _S_
22-
//! elements provides aforementioned methods suffixed with numbers
23-
//! from `0` to `S-1`. Traits which contain these methods are
24-
//! implemented for tuples with up to 12 elements.
25-
//!
26-
//! If every type inside a tuple implements one of the following
27-
//! traits, then a tuple itself also implements it.
28-
//!
29-
//! * `Clone`
30-
//! * `Eq`
31-
//! * `TotalEq`
32-
//! * `Ord`
33-
//! * `TotalOrd`
34-
//! * `Default`
35-
//!
36-
//! # Examples
37-
//!
38-
//! Using methods:
39-
//!
40-
//! ```
41-
//! let pair = ("pi", 3.14);
42-
//! assert_eq!(pair.val0(), "pi");
43-
//! assert_eq!(pair.val1(), 3.14);
44-
//! ```
45-
//!
46-
//! Using traits implemented for tuples:
47-
//!
48-
//! ```
49-
//! use std::default::Default;
50-
//!
51-
//! let a = (1, 2);
52-
//! let b = (3, 4);
53-
//! assert!(a != b);
54-
//!
55-
//! let c = b.clone();
56-
//! assert!(b == c);
57-
//!
58-
//! let d : (u32, f32) = Default::default();
59-
//! assert_eq!(d, (0u32, 0.0f32));
60-
//! ```
12+
13+
#![allow(missing_doc)]
6114

6215
use clone::Clone;
6316
#[cfg(not(test))] use cmp::*;
@@ -73,7 +26,6 @@ macro_rules! tuple_impls {
7326
}
7427
)+) => {
7528
$(
76-
#[allow(missing_doc)]
7729
pub trait $Tuple<$($T),+> {
7830
$(fn $valN(self) -> $T;)+
7931
$(fn $refN<'a>(&'a self) -> &'a $T;)+

branches/try2/src/librustc/middle/privacy.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -297,23 +297,6 @@ impl<'a> Visitor<()> for EmbargoVisitor<'a> {
297297
}
298298
}
299299

300-
ast::ItemTy(ref ty, _) if public_first => {
301-
match ty.node {
302-
ast::TyPath(_, _, id) => {
303-
match self.tcx.def_map.borrow().get_copy(&id) {
304-
ast::DefPrimTy(..) => {},
305-
def => {
306-
let did = def_id_of_def(def);
307-
if is_local(did) {
308-
self.exported_items.insert(did.node);
309-
}
310-
}
311-
}
312-
}
313-
_ => {}
314-
}
315-
}
316-
317300
_ => {}
318301
}
319302

branches/try2/src/libstd/str.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,24 @@ Unicode string manipulation (`str` type)
1616
1717
Rust's string type is one of the core primitive types of the language. While
1818
represented by the name `str`, the name `str` is not actually a valid type in
19-
Rust. Each string must also be decorated with a pointer. `String` is used
20-
for an owned string, so there is only one commonly-used `str` type in Rust:
21-
`&str`.
19+
Rust. Each string must also be decorated with its ownership. This means that
20+
there is one common kind of string in Rust:
2221
23-
`&str` is the borrowed string type. This type of string can only be created
24-
from other strings, unless it is a static string (see below). As the word
25-
"borrowed" implies, this type of string is owned elsewhere, and this string
26-
cannot be moved out of.
22+
* `&str` - This is the borrowed string type. This type of string can only be
23+
created from the other kind of string. As the name "borrowed"
24+
implies, this type of string is owned elsewhere, and this string
25+
cannot be moved out of.
2726
28-
As an example, here's some code that uses a string.
27+
As an example, here's the one kind of string.
2928
3029
```rust
3130
fn main() {
3231
let borrowed_string = "This string is borrowed with the 'static lifetime";
3332
}
3433
```
3534
36-
From the example above, you can see that Rust's string literals have the
37-
`'static` lifetime. This is akin to C's concept of a static string.
35+
From the example above, you can see that Rust has 1 different kind of string
36+
literal. The "borrowed literal" is akin to C's concept of a static string.
3837
3938
String literals are allocated statically in the rodata of the
4039
executable/library. The string then has the type `&'static str` meaning that
@@ -510,7 +509,7 @@ pub fn from_utf8_lossy<'a>(v: &'a [u8]) -> MaybeOwned<'a> {
510509
Section: MaybeOwned
511510
*/
512511

513-
/// A `MaybeOwned` is a string that can hold either a `String` or a `&str`.
512+
/// A MaybeOwned is a string that can hold either a String or a &str.
514513
/// This can be useful as an optimization when an allocation is sometimes
515514
/// needed but not always.
516515
pub enum MaybeOwned<'a> {
@@ -520,7 +519,7 @@ pub enum MaybeOwned<'a> {
520519
Owned(String)
521520
}
522521

523-
/// `SendStr` is a specialization of `MaybeOwned` to be sendable
522+
/// SendStr is a specialization of `MaybeOwned` to be sendable
524523
pub type SendStr = MaybeOwned<'static>;
525524

526525
impl<'a> MaybeOwned<'a> {

branches/try2/src/libsyntax/ast.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,14 @@ pub enum Stmt_ {
417417
StmtMac(Mac, bool),
418418
}
419419

420+
/// Where a local declaration came from: either a true `let ... =
421+
/// ...;`, or one desugared from the pattern of a for loop.
422+
#[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
423+
pub enum LocalSource {
424+
LocalLet,
425+
LocalFor,
426+
}
427+
420428
// FIXME (pending discussion of #1697, #2178...): local should really be
421429
// a refinement on pat.
422430
/// Local represents a `let` statement, e.g., `let <pat>:<ty> = <expr>;`
@@ -427,6 +435,7 @@ pub struct Local {
427435
pub init: Option<@Expr>,
428436
pub id: NodeId,
429437
pub span: Span,
438+
pub source: LocalSource,
430439
}
431440

432441
pub type Decl = Spanned<Decl_>;

branches/try2/src/libsyntax/ext/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
439439
init: Some(ex),
440440
id: ast::DUMMY_NODE_ID,
441441
span: sp,
442+
source: ast::LocalLet,
442443
};
443444
let decl = respan(sp, ast::DeclLocal(local));
444445
@respan(sp, ast::StmtDecl(@decl, ast::DUMMY_NODE_ID))
@@ -462,6 +463,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
462463
init: Some(ex),
463464
id: ast::DUMMY_NODE_ID,
464465
span: sp,
466+
source: ast::LocalLet,
465467
};
466468
let decl = respan(sp, ast::DeclLocal(local));
467469
@respan(sp, ast::StmtDecl(@decl, ast::DUMMY_NODE_ID))

branches/try2/src/libsyntax/ext/expand.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,8 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
669669
pat: pat,
670670
init: init,
671671
id: id,
672-
span: span
672+
span: span,
673+
source: source,
673674
} = **local;
674675
// expand the pat (it might contain exprs... #:(o)>
675676
let expanded_pat = fld.fold_pat(pat);
@@ -703,6 +704,7 @@ fn expand_non_macro_stmt(s: &Stmt, fld: &mut MacroExpander)
703704
init: new_init_opt,
704705
id: id,
705706
span: span,
707+
source: source
706708
};
707709
SmallVector::one(@Spanned {
708710
node: StmtDecl(@Spanned {

branches/try2/src/libsyntax/fold.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ pub trait Folder {
288288
pat: self.fold_pat(l.pat),
289289
init: l.init.map(|e| self.fold_expr(e)),
290290
span: self.new_span(l.span),
291+
source: l.source,
291292
}
292293
}
293294

branches/try2/src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use ast::{Ident, NormalFn, Inherited, Item, Item_, ItemStatic};
3434
use ast::{ItemEnum, ItemFn, ItemForeignMod, ItemImpl};
3535
use ast::{ItemMac, ItemMod, ItemStruct, ItemTrait, ItemTy, Lit, Lit_};
3636
use ast::{LitBool, LitFloat, LitFloatUnsuffixed, LitInt, LitChar};
37-
use ast::{LitIntUnsuffixed, LitNil, LitStr, LitUint, Local};
37+
use ast::{LitIntUnsuffixed, LitNil, LitStr, LitUint, Local, LocalLet};
3838
use ast::{MutImmutable, MutMutable, Mac_, MacInvocTT, Matcher, MatchNonterminal};
3939
use ast::{MatchSeq, MatchTok, Method, MutTy, BiMul, Mutability};
4040
use ast::{NamedField, UnNeg, NoReturn, UnNot, P, Pat, PatEnum};
@@ -3034,6 +3034,7 @@ impl<'a> Parser<'a> {
30343034
init: init,
30353035
id: ast::DUMMY_NODE_ID,
30363036
span: mk_sp(lo, self.last_span.hi),
3037+
source: LocalLet,
30373038
}
30383039
}
30393040

branches/try2/src/test/auxiliary/issue-14421.rs

Lines changed: 0 additions & 34 deletions
This file was deleted.

branches/try2/src/test/auxiliary/issue-14422.rs

Lines changed: 0 additions & 34 deletions
This file was deleted.

branches/try2/src/test/run-pass/issue-14421.rs

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)