Skip to content

Commit 81f3b05

Browse files
committed
---
yaml --- r: 194615 b: refs/heads/snap-stage3 c: 9754b06 h: refs/heads/master i: 194613: 8cc586f 194611: 18fd6a9 194607: 996d8d6 v: v3
1 parent 181ddb6 commit 81f3b05

File tree

1,512 files changed

+7892
-7660
lines changed

Some content is hidden

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

1,512 files changed

+7892
-7660
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: 242ed0b7c0f6a21096f2cc3e1ad1bdb176d02545
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 28a6b16130388b126635773694d450ddbc9120d4
4+
refs/heads/snap-stage3: 9754b06cd80cfcc523573535090519bec935fec3
55
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#![feature(box_syntax)]
1414
#![feature(collections)]
15+
#![feature(int_uint)]
1516
#![feature(old_io)]
1617
#![feature(old_path)]
1718
#![feature(rustc_private)]

branches/snap-stage3/src/compiletest/errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ use std::io::prelude::*;
1515
use std::path::Path;
1616

1717
pub struct ExpectedError {
18-
pub line: usize,
18+
pub line: uint,
1919
pub kind: String,
2020
pub msg: String,
2121
}
2222

2323
#[derive(PartialEq, Debug)]
24-
enum WhichLine { ThisLine, FollowPrevious(usize), AdjustBackward(usize) }
24+
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
2525

2626
/// Looks for either "//~| KIND MESSAGE" or "//~^^... KIND MESSAGE"
2727
/// The former is a "follow" that inherits its target from the preceding line;
@@ -58,8 +58,8 @@ pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {
5858
}).collect()
5959
}
6060

61-
fn parse_expected(last_nonfollow_error: Option<usize>,
62-
line_num: usize,
61+
fn parse_expected(last_nonfollow_error: Option<uint>,
62+
line_num: uint,
6363
line: &str) -> Option<(WhichLine, ExpectedError)> {
6464
let start = match line.find("//~") { Some(i) => i, None => return None };
6565
let (follow, adjusts) = if line.char_at(start + 3) == '|' {

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ pub fn parse_name_value_directive(line: &str, directive: &str)
357357
}
358358
}
359359

360-
pub fn gdb_version_to_int(version_string: &str) -> isize {
360+
pub fn gdb_version_to_int(version_string: &str) -> int {
361361
let error_string = format!(
362362
"Encountered GDB version string with unexpected format: {}",
363363
version_string);
@@ -369,17 +369,17 @@ pub fn gdb_version_to_int(version_string: &str) -> isize {
369369
panic!("{}", error_string);
370370
}
371371

372-
let major: isize = components[0].parse().ok().expect(&error_string);
373-
let minor: isize = components[1].parse().ok().expect(&error_string);
372+
let major: int = components[0].parse().ok().expect(&error_string);
373+
let minor: int = components[1].parse().ok().expect(&error_string);
374374

375375
return major * 1000 + minor;
376376
}
377377

378-
pub fn lldb_version_to_int(version_string: &str) -> isize {
378+
pub fn lldb_version_to_int(version_string: &str) -> int {
379379
let error_string = format!(
380380
"Encountered LLDB version string with unexpected format: {}",
381381
version_string);
382382
let error_string = error_string;
383-
let major: isize = version_string.parse().ok().expect(&error_string);
383+
let major: int = version_string.parse().ok().expect(&error_string);
384384
return major;
385385
}

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
758758
struct DebuggerCommands {
759759
commands: Vec<String>,
760760
check_lines: Vec<String>,
761-
breakpoint_lines: Vec<usize>,
761+
breakpoint_lines: Vec<uint>,
762762
}
763763

764764
fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
@@ -1036,7 +1036,7 @@ fn is_compiler_error_or_warning(line: &str) -> bool {
10361036
scan_string(line, "warning", &mut i));
10371037
}
10381038

1039-
fn scan_until_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
1039+
fn scan_until_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
10401040
if *idx >= haystack.len() {
10411041
return false;
10421042
}
@@ -1048,7 +1048,7 @@ fn scan_until_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
10481048
return true;
10491049
}
10501050

1051-
fn scan_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
1051+
fn scan_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
10521052
if *idx >= haystack.len() {
10531053
return false;
10541054
}
@@ -1060,7 +1060,7 @@ fn scan_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
10601060
return true;
10611061
}
10621062

1063-
fn scan_integer(haystack: &str, idx: &mut usize) -> bool {
1063+
fn scan_integer(haystack: &str, idx: &mut uint) -> bool {
10641064
let mut i = *idx;
10651065
while i < haystack.len() {
10661066
let ch = haystack.char_at(i);
@@ -1076,7 +1076,7 @@ fn scan_integer(haystack: &str, idx: &mut usize) -> bool {
10761076
return true;
10771077
}
10781078

1079-
fn scan_string(haystack: &str, needle: &str, idx: &mut usize) -> bool {
1079+
fn scan_string(haystack: &str, needle: &str, idx: &mut uint) -> bool {
10801080
let mut haystack_i = *idx;
10811081
let mut needle_i = 0;
10821082
while needle_i < needle.len() {
@@ -1725,7 +1725,7 @@ fn disassemble_extract(config: &Config, _props: &TestProps,
17251725
}
17261726

17271727

1728-
fn count_extracted_lines(p: &Path) -> usize {
1728+
fn count_extracted_lines(p: &Path) -> uint {
17291729
let mut x = Vec::new();
17301730
File::open(&p.with_extension("ll")).unwrap().read_to_end(&mut x).unwrap();
17311731
let x = str::from_utf8(&x).unwrap();

branches/snap-stage3/src/compiletest/util.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,33 @@ use common::Config;
1313

1414
/// Conversion table from triple OS name to Rust SYSNAME
1515
const OS_TABLE: &'static [(&'static str, &'static str)] = &[
16-
("android", "android"),
17-
("bitrig", "bitrig"),
18-
("darwin", "macos"),
19-
("dragonfly", "dragonfly"),
20-
("freebsd", "freebsd"),
21-
("ios", "ios"),
22-
("linux", "linux"),
2316
("mingw32", "windows"),
24-
("openbsd", "openbsd"),
2517
("win32", "windows"),
2618
("windows", "windows"),
19+
("darwin", "macos"),
20+
("android", "android"),
21+
("linux", "linux"),
22+
("freebsd", "freebsd"),
23+
("dragonfly", "dragonfly"),
24+
("bitrig", "bitrig"),
25+
("openbsd", "openbsd"),
2726
];
2827

2928
const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
30-
("aarch64", "aarch64"),
31-
("amd64", "x86_64"),
32-
("arm", "arm"),
33-
("arm64", "aarch64"),
34-
("hexagon", "hexagon"),
3529
("i386", "x86"),
3630
("i686", "x86"),
31+
("amd64", "x86_64"),
32+
("x86_64", "x86_64"),
33+
("sparc", "sparc"),
34+
("powerpc", "powerpc"),
35+
("arm64", "aarch64"),
36+
("arm", "arm"),
37+
("aarch64", "aarch64"),
3738
("mips", "mips"),
39+
("xcore", "xcore"),
3840
("msp430", "msp430"),
39-
("powerpc", "powerpc"),
41+
("hexagon", "hexagon"),
4042
("s390x", "systemz"),
41-
("sparc", "sparc"),
42-
("x86_64", "x86_64"),
43-
("xcore", "xcore"),
4443
];
4544

4645
pub fn get_os(triple: &str) -> &'static str {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,6 +2440,9 @@ The currently implemented features of the reference compiler are:
24402440
* `intrinsics` - Allows use of the "rust-intrinsics" ABI. Compiler intrinsics
24412441
are inherently unstable and no promise about them is made.
24422442

2443+
* `int_uint` - Allows the use of the `int` and `uint` types, which are deprecated.
2444+
Use `isize` and `usize` instead.
2445+
24432446
* `lang_items` - Allows use of the `#[lang]` attribute. Like `intrinsics`,
24442447
lang items are inherently unstable and no promise about them
24452448
is made.
@@ -2756,7 +2759,7 @@ The following are examples of structure expressions:
27562759
```
27572760
# struct Point { x: f64, y: f64 }
27582761
# struct TuplePoint(f64, f64);
2759-
# mod game { pub struct User<'a> { pub name: &'a str, pub age: u32, pub score: usize } }
2762+
# mod game { pub struct User<'a> { pub name: &'a str, pub age: u32, pub score: uint } }
27602763
# struct Cookie; fn some_fn<T>(t: T) {}
27612764
Point {x: 10.0, y: 20.0};
27622765
TuplePoint(10.0, 20.0);
@@ -3399,7 +3402,7 @@ subpattern`. For example:
33993402
#![feature(box_patterns)]
34003403
#![feature(box_syntax)]
34013404
3402-
enum List { Nil, Cons(u32, Box<List>) }
3405+
enum List { Nil, Cons(uint, Box<List>) }
34033406
34043407
fn is_sorted(list: &List) -> bool {
34053408
match *list {

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ navigate through the menu on the left.
1111
<h2 class="section-header"><a href="basic.html">Basics</a></h2>
1212

1313
This section is a linear introduction to the basic syntax and semantics of
14-
Rust. It has individual sections on each part of Rust's syntax.
14+
Rust. It has individual sections on each part of Rust's syntax, and culminates
15+
in a small project: a guessing game.
1516

1617
After reading "Basics," you will have a good foundation to learn more about
1718
Rust, and can write very simple programs.
@@ -28,12 +29,7 @@ and will be able to understand most Rust code and write more complex programs.
2829

2930
In a similar fashion to "Intermediate," this section is full of individual,
3031
deep-dive chapters, which stand alone and can be read in any order. These
31-
chapters focus on the most complex features,
32+
chapters focus on the most complex features, as well as some things that
33+
are only available in upcoming versions of Rust.
3234

33-
<h2 class="section-header"><a href="unstable.html">Unstable</a></h2>
34-
35-
In a similar fashion to "Intermediate," this section is full of individual,
36-
deep-dive chapters, which stand alone and can be read in any order.
37-
38-
This chapter contains things that are only available on the nightly channel of
39-
Rust.
35+
After reading "Advanced," you'll be a Rust expert!

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636
* [FFI](ffi.md)
3737
* [Unsafe Code](unsafe.md)
3838
* [Advanced Macros](advanced-macros.md)
39-
* [Unstable Rust](unstable.md)
4039
* [Compiler Plugins](plugins.md)
41-
* [Inline Assembly](inline-assembly.md)
42-
* [No stdlib](no-stdlib.md)
43-
* [Intrinsics](intrinsics.md)
44-
* [Lang items](lang-items.md)
45-
* [Link args](link-args.md)
4640
* [Conclusion](conclusion.md)
4741
* [Glossary](glossary.md)

branches/snap-stage3/src/doc/trpl/advanced-macros.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ the [Bitwise Cyclic Tag](http://esolangs.org/wiki/Bitwise_Cyclic_Tag) automaton
206206
within Rust's macro system.
207207

208208
```rust
209+
#![feature(trace_macros)]
210+
209211
macro_rules! bct {
210212
// cmd 0: d ... => ...
211213
(0, $($ps:tt),* ; $_d:tt)
@@ -227,6 +229,13 @@ macro_rules! bct {
227229
( $($ps:tt),* ; )
228230
=> (());
229231
}
232+
233+
fn main() {
234+
trace_macros!(true);
235+
# /* just check the definition
236+
bct!(0, 0, 1, 1, 1 ; 1, 0, 1);
237+
# */
238+
}
230239
```
231240

232241
Exercise: use macros to reduce duplication in the above definition of the

branches/snap-stage3/src/doc/trpl/arrays-vectors-and-slices.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,7 @@ You can also take a slice of a vector, `String`, or `&str`, because they are
9999
backed by arrays. Slices have type `&[T]`, which we'll talk about when we cover
100100
generics.
101101

102-
We have now learned all of the most basic Rust concepts. Next, we learn how to
103-
get input from the keyboard.
102+
We have now learned all of the most basic Rust concepts. We're ready to start
103+
building ourselves a guessing game, we just need to know one last thing: how to
104+
get input from the keyboard. You can't have a guessing game without the ability
105+
to guess!
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
% Basics
22

33
This section is a linear introduction to the basic syntax and semantics of
4-
Rust. It has individual sections on each part of Rust's syntax.
4+
Rust. It has individual sections on each part of Rust's syntax, and cumulates
5+
in a small project: a guessing game.
56

67
After reading "Basics," you will have a good foundation to learn more about
78
Rust, and can write very simple programs.

branches/snap-stage3/src/doc/trpl/compound-data-types.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,4 +361,5 @@ and brittle `if`/`else`s.
361361

362362
[arity]: ./glossary.html#arity
363363
[match]: ./match.html
364+
[game]: ./guessing-game.html#comparing-guesses
364365
[generics]: ./generics.html

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ Here’s an example of documenting a macro:
352352
/// # }
353353
/// ```
354354
///
355-
/// ```should_panic
355+
/// ```should_fail
356356
/// # #[macro_use] extern crate foo;
357357
/// # fn main() {
358358
/// panic_unless!(true == false, “I’m broken.”);

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

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,31 @@ A few examples of how this model can be used are:
366366
367367
On OSX, frameworks behave with the same semantics as a dynamic library.
368368
369+
## The `link_args` attribute
370+
371+
There is one other way to tell rustc how to customize linking, and that is via
372+
the `link_args` attribute. This attribute is applied to `extern` blocks and
373+
specifies raw flags which need to get passed to the linker when producing an
374+
artifact. An example usage would be:
375+
376+
``` no_run
377+
#![feature(link_args)]
378+
379+
#[link_args = "-foo -bar -baz"]
380+
extern {}
381+
# fn main() {}
382+
```
383+
384+
Note that this feature is currently hidden behind the `feature(link_args)` gate
385+
because this is not a sanctioned way of performing linking. Right now rustc
386+
shells out to the system linker, so it makes sense to provide extra command line
387+
arguments, but this will not always be the case. In the future rustc may use
388+
LLVM directly to link native libraries in which case `link_args` will have no
389+
meaning.
390+
391+
It is highly recommended to *not* use this attribute, and rather use the more
392+
formal `#[link(...)]` attribute on `extern` blocks instead.
393+
369394
# Unsafe blocks
370395

371396
Some operations, like dereferencing unsafe pointers or calling functions that have been marked
@@ -376,7 +401,7 @@ Unsafe functions, on the other hand, advertise it to the world. An unsafe functi
376401
this:
377402

378403
```
379-
unsafe fn kaboom(ptr: *const i32) -> i32 { *ptr }
404+
unsafe fn kaboom(ptr: *const int) -> int { *ptr }
380405
```
381406

382407
This function can only be called from an `unsafe` block or another `unsafe` function.
@@ -398,7 +423,7 @@ extern {
398423
399424
fn main() {
400425
println!("You have readline version {} installed.",
401-
rl_readline_version as i32);
426+
rl_readline_version as int);
402427
}
403428
```
404429

0 commit comments

Comments
 (0)