Skip to content

Commit f7b063e

Browse files
committed
---
yaml --- r: 129610 b: refs/heads/auto c: bcb0717 h: refs/heads/master v: v3
1 parent 34c13ec commit f7b063e

File tree

85 files changed

+659
-322
lines changed

Some content is hidden

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

85 files changed

+659
-322
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 0d3bd7720c50e3ada4bac77331d43926493be4fe
16+
refs/heads/auto: bcb07175ceca3e9a4b2644625bb510fa3f3d7368
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/guide-tasks.md

Lines changed: 274 additions & 125 deletions
Large diffs are not rendered by default.

branches/auto/src/doc/guide.md

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,7 @@ Let's try compiling what Cargo gave us:
18011801
```{bash}
18021802
$ cargo build
18031803
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
1804+
$
18041805
```
18051806

18061807
Excellent! Open up your `src/main.rs` again. We'll be writing all of
@@ -1813,9 +1814,10 @@ Try it out:
18131814

18141815
```{notrust,ignore}
18151816
$ cargo run
1816-
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
1817+
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
18171818
Running `target/guessing_game`
18181819
Hello, world!
1820+
$
18191821
```
18201822

18211823
Great! The `run` command comes in handy when you need to rapidly iterate on a project.
@@ -1955,12 +1957,18 @@ fn main() {
19551957
}
19561958
```
19571959

1958-
Try running our new program a few times:
1960+
... and then recompile:
19591961

19601962
```{notrust,ignore}
1961-
$ cargo run
1962-
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
1963-
Running `target/guessing_game`
1963+
$ cargo build
1964+
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
1965+
$
1966+
```
1967+
1968+
Excellent! Try running our new program a few times:
1969+
1970+
```{notrust,ignore}
1971+
$ ./target/guessing_game
19641972
Guess the number!
19651973
The secret number is: 7
19661974
Please input your guess.
@@ -2011,9 +2019,9 @@ fn main() {
20112019
And trying it out:
20122020

20132021
```{notrust,ignore}
2014-
$ cargo run
2015-
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2016-
Running `target/guessing_game`
2022+
$ cargo build
2023+
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2024+
$ ./target/guessing_game
20172025
Guess the number!
20182026
The secret number is: 57
20192027
Please input your guess.
@@ -2282,14 +2290,15 @@ We use a `match` to either give us the `uint` inside of the `Option`, or we
22822290
print an error message and return. Let's give this a shot:
22832291

22842292
```{notrust,ignore}
2285-
$ cargo run
2286-
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2287-
Running `target/guessing_game`
2293+
$ cargo build
2294+
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2295+
$ ./target/guessing_game
22882296
Guess the number!
22892297
The secret number is: 17
22902298
Please input your guess.
22912299
5
22922300
Please input a number!
2301+
$
22932302
```
22942303

22952304
Uh, what? But we did!
@@ -2347,15 +2356,16 @@ fn cmp(a: uint, b: uint) -> Ordering {
23472356
Let's try it!
23482357

23492358
```{notrust,ignore}
2350-
$ cargo run
2351-
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2352-
Running `target/guessing_game`
2359+
$ cargo build
2360+
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2361+
$ ./target/guessing_game
23532362
Guess the number!
23542363
The secret number is: 58
23552364
Please input your guess.
23562365
76
23572366
You guessed: 76
23582367
Too big!
2368+
$
23592369
```
23602370

23612371
Nice! You can see I even added spaces before my guess, and it still figured
@@ -2424,9 +2434,9 @@ And try it out. But wait, didn't we just add an infinite loop? Yup. Remember
24242434
that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24252435

24262436
```{notrust,ignore}
2427-
$ cargo run
2428-
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2429-
Running `target/guessing_game`
2437+
$ cargo build
2438+
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2439+
$ ./target/guessing_game
24302440
Guess the number!
24312441
The secret number is: 59
24322442
Please input your guess.
@@ -2444,6 +2454,7 @@ You win!
24442454
Please input your guess.
24452455
quit
24462456
Please input a number!
2457+
$
24472458
```
24482459

24492460
Ha! `quit` actually quits. As does any other non-number input. Well, this is
@@ -2555,10 +2566,10 @@ fn cmp(a: uint, b: uint) -> Ordering {
25552566

25562567
Now we should be good! Let's try:
25572568

2558-
```{notrust,ignore}
2559-
$ cargo run
2560-
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2561-
Running `target/guessing_game`
2569+
```{rust,ignore}
2570+
$ cargo build
2571+
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2572+
$ ./target/guessing_game
25622573
Guess the number!
25632574
The secret number is: 61
25642575
Please input your guess.
@@ -2760,6 +2771,7 @@ $ cargo run
27602771
Compiling modules v0.0.1 (file:///home/you/projects/modules)
27612772
Running `target/modules`
27622773
Hello, world!
2774+
$
27632775
```
27642776

27652777
Nice!
@@ -2799,7 +2811,8 @@ be named, by convention.
27992811
Next, we added an `extern crate modules` to the top of our `src/main.rs`. This,
28002812
as you can guess, lets Rust know that our crate relies on another, external
28012813
crate. We also had to modify our call to `print_hello`: now that it's in
2802-
another crate, we need to specify that crate first.
2814+
another crate, we need to first specify the crate, then the module inside of it,
2815+
then the function name.
28032816

28042817
This doesn't _quite_ work yet. Try it:
28052818

@@ -2910,6 +2923,7 @@ This should all compile as usual:
29102923
```{notrust,ignore}
29112924
$ cargo build
29122925
Compiling modules v0.0.1 (file:///home/you/projects/modules)
2926+
$
29132927
```
29142928

29152929
We've seen how the `::` operator can be used to call into modules, but when
@@ -3083,6 +3097,7 @@ $ cargo run
30833097
Compiling testing v0.0.1 (file:///home/you/projects/testing)
30843098
Running `target/testing`
30853099
Hello, world!
3100+
$
30863101
```
30873102

30883103
Great. Rust's infrastructure supports tests in two sorts of places, and they're
@@ -3235,6 +3250,7 @@ running 1 test
32353250
test foo ... ok
32363251
32373252
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
3253+
$
32383254
```
32393255

32403256
Nice! Our test passes, as we expected. Let's get rid of that warning for our `main`

branches/auto/src/doc/rust.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,9 @@ There are several kinds of view item:
891891
##### Extern crate declarations
892892

893893
~~~~ {.ebnf .gram}
894-
extern_crate_decl : "extern" "crate" crate_name
895-
crate_name: ident | ( string_lit as ident )
894+
extern_crate_decl : "extern" "crate" ident [ '(' link_attrs ')' ] ? [ '=' string_lit ] ? ;
895+
link_attrs : link_attr [ ',' link_attrs ] + ;
896+
link_attr : ident '=' literal ;
896897
~~~~
897898

898899
An _`extern crate` declaration_ specifies a dependency on an external crate.
@@ -912,9 +913,11 @@ Four examples of `extern crate` declarations:
912913
~~~~ {.ignore}
913914
extern crate pcre;
914915
915-
extern crate std; // equivalent to: extern crate std as std;
916+
extern crate std; // equivalent to: extern crate std = "std";
916917
917-
extern crate "std" as ruststd; // linking to 'std' under another name
918+
extern crate ruststd = "std"; // linking to 'std' under another name
919+
920+
extern crate foo = "some/where/rust-foo#foo:1.0"; // a full crate ID for external tools
918921
~~~~
919922

920923
##### Use declarations

branches/auto/src/libglob/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@
2424
*/
2525

2626
#![crate_name = "glob"]
27-
#![deprecated = "This is now a cargo package located at: \
28-
https://github.com/rust-lang/glob"]
27+
#![experimental]
2928
#![crate_type = "rlib"]
3029
#![crate_type = "dylib"]
3130
#![license = "MIT/ASL2"]
3231
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
3332
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
3433
html_root_url = "http://doc.rust-lang.org/master/",
3534
html_playground_url = "http://play.rust-lang.org/")]
36-
#![allow(deprecated)]
3735

3836
use std::cell::Cell;
3937
use std::{cmp, os, path};
@@ -66,7 +64,6 @@ pub struct Paths {
6664
/// `puppies.jpg` and `hamsters.gif`:
6765
///
6866
/// ```rust
69-
/// # #![allow(deprecated)]
7067
/// use glob::glob;
7168
///
7269
/// for path in glob("/media/pictures/*.jpg") {

branches/auto/src/librustc/lint/builtin.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ impl LintPass for NonCamelCaseTypes {
754754

755755
// start with a non-lowercase letter rather than non-uppercase
756756
// ones (some scripts don't have a concept of upper/lowercase)
757-
ident.len() > 0 && !ident.char_at(0).is_lowercase() && !ident.contains_char('_')
757+
!ident.char_at(0).is_lowercase() && !ident.contains_char('_')
758758
}
759759

760760
fn to_camel_case(s: &str) -> String {
@@ -768,13 +768,9 @@ impl LintPass for NonCamelCaseTypes {
768768
let s = token::get_ident(ident);
769769

770770
if !is_camel_case(ident) {
771-
let c = to_camel_case(s.get());
772-
let m = if c.is_empty() {
773-
format!("{} `{}` should have a camel case name such as `CamelCase`", sort, s)
774-
} else {
775-
format!("{} `{}` should have a camel case name such as `{}`", sort, s, c)
776-
};
777-
cx.span_lint(NON_CAMEL_CASE_TYPES, span, m.as_slice());
771+
cx.span_lint(NON_CAMEL_CASE_TYPES, span,
772+
format!("{} `{}` should have a camel case name such as `{}`",
773+
sort, s, to_camel_case(s.get())).as_slice());
778774
}
779775
}
780776

branches/auto/src/librustc/middle/intrinsicck.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,21 @@ struct IntrinsicCheckingVisitor<'a> {
7373

7474
impl<'a> IntrinsicCheckingVisitor<'a> {
7575
fn def_id_is_transmute(&self, def_id: DefId) -> bool {
76-
let intrinsic = match ty::get(ty::lookup_item_type(self.tcx, def_id).ty).sty {
77-
ty::ty_bare_fn(ref bfty) => bfty.abi == RustIntrinsic,
78-
_ => return false
79-
};
8076
if def_id.krate == ast::LOCAL_CRATE {
8177
match self.tcx.map.get(def_id.node) {
82-
NodeForeignItem(ref item) if intrinsic => {
78+
NodeForeignItem(ref item) => {
8379
token::get_ident(item.ident) ==
8480
token::intern_and_get_ident("transmute")
8581
}
8682
_ => false,
8783
}
8884
} else {
8985
match csearch::get_item_path(self.tcx, def_id).last() {
90-
Some(ref last) if intrinsic => {
86+
None => false,
87+
Some(ref last) => {
9188
token::get_name(last.name()) ==
9289
token::intern_and_get_ident("transmute")
9390
}
94-
_ => false,
9591
}
9692
}
9793
}

branches/auto/src/librustdoc/clean/inline.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,14 @@ fn try_inline_def(cx: &core::DocContext,
124124
pub fn load_attrs(tcx: &ty::ctxt, did: ast::DefId) -> Vec<clean::Attribute> {
125125
let mut attrs = Vec::new();
126126
csearch::get_item_attrs(&tcx.sess.cstore, did, |v| {
127-
attrs.extend(v.move_iter().map(|a| {
127+
attrs.extend(v.move_iter().map(|mut a| {
128+
// FIXME this isn't quite always true, it's just true about 99% of
129+
// the time when dealing with documentation. For example,
130+
// this would treat doc comments of the form `#[doc = "foo"]`
131+
// incorrectly.
132+
if a.name().get() == "doc" && a.value_str().is_some() {
133+
a.node.is_sugared_doc = true;
134+
}
128135
a.clean()
129136
}));
130137
});

branches/auto/src/librustdoc/html/render.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -819,16 +819,17 @@ impl DocFolder for Cache {
819819
// Index this method for searching later on
820820
match item.name {
821821
Some(ref s) => {
822-
let parent = match item.inner {
822+
let (parent, is_method) = match item.inner {
823823
clean::TyMethodItem(..) |
824824
clean::StructFieldItem(..) |
825825
clean::VariantItem(..) => {
826-
(Some(*self.parent_stack.last().unwrap()),
827-
Some(self.stack.slice_to(self.stack.len() - 1)))
826+
((Some(*self.parent_stack.last().unwrap()),
827+
Some(self.stack.slice_to(self.stack.len() - 1))),
828+
false)
828829
}
829830
clean::MethodItem(..) => {
830831
if self.parent_stack.len() == 0 {
831-
(None, None)
832+
((None, None), false)
832833
} else {
833834
let last = self.parent_stack.last().unwrap();
834835
let did = *last;
@@ -844,17 +845,18 @@ impl DocFolder for Cache {
844845
Some(..) => Some(self.stack.as_slice()),
845846
None => None
846847
};
847-
(Some(*last), path)
848+
((Some(*last), path), true)
848849
}
849850
}
850-
_ => (None, Some(self.stack.as_slice()))
851+
_ => ((None, Some(self.stack.as_slice())), false)
851852
};
852853
let hidden_field = match item.inner {
853854
clean::StructFieldItem(clean::HiddenStructField) => true,
854855
_ => false
855856
};
857+
856858
match parent {
857-
(parent, Some(path)) if !self.privmod && !hidden_field => {
859+
(parent, Some(path)) if is_method || (!self.privmod && !hidden_field) => {
858860
self.search_index.push(IndexItem {
859861
ty: shortty(&item),
860862
name: s.to_string(),
@@ -863,7 +865,7 @@ impl DocFolder for Cache {
863865
parent: parent,
864866
});
865867
}
866-
(Some(parent), None) if !self.privmod => {
868+
(Some(parent), None) if is_method || (!self.privmod && !hidden_field)=> {
867869
if ast_util::is_local(parent) {
868870
// We have a parent, but we don't know where they're
869871
// defined yet. Wait for later to index this item.

branches/auto/src/libstd/rand/os.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ mod imp {
8585
marker: marker::NoCopy
8686
}
8787

88-
#[repr(C)]
8988
struct SecRandom;
9089

9190
static kSecRandomDefault: *const SecRandom = 0 as *const SecRandom;

branches/auto/src/libsync/comm/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@
8686
//!
8787
//! ```
8888
//! // Create a shared channel which can be sent along from many tasks
89-
//! // where tx is the sending half (tx for transmission), and rx is the receiving
90-
//! // half (rx for receiving).
9189
//! let (tx, rx) = channel();
9290
//! for i in range(0i, 10i) {
9391
//! let tx = tx.clone();
@@ -475,8 +473,6 @@ impl<T> UnsafeFlavor<T> for Receiver<T> {
475473
/// # Example
476474
///
477475
/// ```
478-
/// // tx is is the sending half (tx for transmission), and rx is the receiving
479-
/// // half (rx for receiving).
480476
/// let (tx, rx) = channel();
481477
///
482478
/// // Spawn off an expensive computation

0 commit comments

Comments
 (0)