Skip to content

Commit fcf9f8c

Browse files
committed
---
yaml --- r: 228125 b: refs/heads/try c: 2ceaa77 h: refs/heads/master i: 228123: 73f33c6 v: v3
1 parent 015cf74 commit fcf9f8c

File tree

190 files changed

+3180
-2836
lines changed

Some content is hidden

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

190 files changed

+3180
-2836
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: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 3e26e56a79ae33dfc8f2f4d0123b5080fd0a7853
4+
refs/heads/try: 2ceaa77ae26f38b599b5ab09ee925632ad613e1b
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Read ["Installing Rust"] from [The Book].
7373
```
7474
7575
3. Run `mingw32_shell.bat` or `mingw64_shell.bat` from wherever you installed
76-
MYSY2 (i.e. `C:\msys`), depending on whether you want 32-bit or 64-bit Rust.
76+
MSYS2 (i.e. `C:\msys`), depending on whether you want 32-bit or 64-bit Rust.
7777
7878
4. Navigate to Rust's source code, configure and build it:
7979

branches/try/configure

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ case $CFG_OSTYPE in
405405
CFG_OSTYPE=unknown-openbsd
406406
;;
407407

408+
NetBSD)
409+
CFG_OSTYPE=unknown-netbsd
410+
;;
411+
408412
Darwin)
409413
CFG_OSTYPE=apple-darwin
410414
;;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# x86_64-unknown-netbsd configuration
2+
CC_x86_64-unknown-netbsd=$(CC)
3+
CXX_x86_64-unknown-netbsd=$(CXX)
4+
CPP_x86_64-unknown-netbsd=$(CPP)
5+
AR_x86_64-unknown-netbsd=$(AR)
6+
CFG_LIB_NAME_x86_64-unknown-netbsd=lib$(1).so
7+
CFG_STATIC_LIB_NAME_x86_64-unknown-netbsd=lib$(1).a
8+
CFG_LIB_GLOB_x86_64-unknown-netbsd=lib$(1)-*.so
9+
CFG_LIB_DSYM_GLOB_x86_64-unknown-netbsd=$(1)-*.dylib.dSYM
10+
CFG_JEMALLOC_CFLAGS_x86_64-unknown-netbsd := -I/usr/local/include $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_x86_64-unknown-netbsd := -Wall -Werror -g -fPIC -I/usr/local/include $(CFLAGS)
12+
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-netbsd := -shared -fPIC -g -pthread -lrt
13+
CFG_GCCISH_DEF_FLAG_x86_64-unknown-netbsd := -Wl,--export-dynamic,--dynamic-list=
14+
CFG_LLC_FLAGS_x86_64-unknown-netbsd :=
15+
CFG_INSTALL_NAME_x86_64-unknown-netbsd =
16+
CFG_EXE_SUFFIX_x86_64-unknown-netbsd :=
17+
CFG_WINDOWSY_x86_64-unknown-netbsd :=
18+
CFG_UNIXY_x86_64-unknown-netbsd := 1
19+
CFG_LDPATH_x86_64-unknown-netbsd :=
20+
CFG_RUN_x86_64-unknown-netbsd=$(2)
21+
CFG_RUN_TARG_x86_64-unknown-netbsd=$(call CFG_RUN_x86_64-unknown-netbsd,,$(2))
22+
CFG_GNU_TRIPLE_x86_64-unknown-netbsd := x86_64-unknown-netbsd

branches/try/mk/main.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
295295
LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
296296
LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
297297
LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))"
298-
LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
299298
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
300299
ifeq ($$(findstring freebsd,$(1)),freebsd)
301300
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),

branches/try/src/compiletest/runtest.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,16 +1126,10 @@ impl fmt::Display for Status {
11261126

11271127
fn compile_test(config: &Config, props: &TestProps,
11281128
testfile: &Path) -> ProcRes {
1129-
compile_test_(config, props, testfile, &[])
1130-
}
1131-
1132-
fn compile_test_(config: &Config, props: &TestProps,
1133-
testfile: &Path, extra_args: &[String]) -> ProcRes {
11341129
let aux_dir = aux_output_dir_name(config, testfile);
11351130
// FIXME (#9639): This needs to handle non-utf8 paths
1136-
let mut link_args = vec!("-L".to_string(),
1137-
aux_dir.to_str().unwrap().to_string());
1138-
link_args.extend(extra_args.iter().cloned());
1131+
let link_args = vec!("-L".to_string(),
1132+
aux_dir.to_str().unwrap().to_string());
11391133
let args = make_compile_args(config,
11401134
props,
11411135
link_args,
@@ -1144,7 +1138,7 @@ fn compile_test_(config: &Config, props: &TestProps,
11441138
}
11451139

11461140
fn document(config: &Config, props: &TestProps,
1147-
testfile: &Path, extra_args: &[String]) -> (ProcRes, PathBuf) {
1141+
testfile: &Path) -> (ProcRes, PathBuf) {
11481142
let aux_dir = aux_output_dir_name(config, testfile);
11491143
let out_dir = output_base_name(config, testfile);
11501144
let _ = fs::remove_dir_all(&out_dir);
@@ -1154,7 +1148,6 @@ fn document(config: &Config, props: &TestProps,
11541148
"-o".to_string(),
11551149
out_dir.to_str().unwrap().to_string(),
11561150
testfile.to_str().unwrap().to_string()];
1157-
args.extend(extra_args.iter().cloned());
11581151
args.extend(split_maybe_args(&props.compile_flags));
11591152
let args = ProcArgs {
11601153
prog: config.rustdoc_path.to_str().unwrap().to_string(),
@@ -1717,7 +1710,7 @@ fn charset() -> &'static str {
17171710
}
17181711

17191712
fn run_rustdoc_test(config: &Config, props: &TestProps, testfile: &Path) {
1720-
let (proc_res, out_dir) = document(config, props, testfile, &[]);
1713+
let (proc_res, out_dir) = document(config, props, testfile);
17211714
if !proc_res.status.success() {
17221715
fatal_proc_rec("rustdoc failed!", &proc_res);
17231716
}

branches/try/src/compiletest/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
2121
("ios", "ios"),
2222
("linux", "linux"),
2323
("mingw32", "windows"),
24+
("netbsd", "netbsd"),
2425
("openbsd", "openbsd"),
2526
("win32", "windows"),
2627
("windows", "windows"),

branches/try/src/doc/reference.md

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,16 @@ type of the literal. The integer suffix must be the name of one of the
338338
integral types: `u8`, `i8`, `u16`, `i16`, `u32`, `i32`, `u64`, `i64`,
339339
`isize`, or `usize`.
340340

341-
The type of an _unsuffixed_ integer literal is determined by type inference.
342-
If an integer type can be _uniquely_ determined from the surrounding program
343-
context, the unsuffixed integer literal has that type. If the program context
344-
underconstrains the type, it defaults to the signed 32-bit integer `i32`; if
345-
the program context overconstrains the type, it is considered a static type
346-
error.
341+
The type of an _unsuffixed_ integer literal is determined by type inference:
342+
343+
* If an integer type can be _uniquely_ determined from the surrounding
344+
program context, the unsuffixed integer literal has that type.
345+
346+
* If the program context underconstrains the type, it defaults to the
347+
signed 32-bit integer `i32`.
348+
349+
* If the program context overconstrains the type, it is considered a
350+
static type error.
347351

348352
Examples of integer literals of various forms:
349353

@@ -371,12 +375,17 @@ The suffix forcibly sets the type of the literal. There are two valid
371375
_floating-point suffixes_, `f32` and `f64` (the 32-bit and 64-bit floating point
372376
types), which explicitly determine the type of the literal.
373377

374-
The type of an _unsuffixed_ floating-point literal is determined by type
375-
inference. If a floating-point type can be _uniquely_ determined from the
376-
surrounding program context, the unsuffixed floating-point literal has that type.
377-
If the program context underconstrains the type, it defaults to double-precision `f64`;
378-
if the program context overconstrains the type, it is considered a static type
379-
error.
378+
The type of an _unsuffixed_ floating-point literal is determined by
379+
type inference:
380+
381+
* If a floating-point type can be _uniquely_ determined from the
382+
surrounding program context, the unsuffixed floating-point literal
383+
has that type.
384+
385+
* If the program context underconstrains the type, it defaults to `f64`.
386+
387+
* If the program context overconstrains the type, it is considered a
388+
static type error.
380389

381390
Examples of floating-point literals of various forms:
382391

@@ -2023,7 +2032,7 @@ The following configurations must be defined by the implementation:
20232032
as a configuration itself, like `unix` or `windows`.
20242033
* `target_os = "..."`. Operating system of the target, examples include
20252034
`"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
2026-
`"bitrig"` or `"openbsd"`.
2035+
`"bitrig"` , `"openbsd"` or `"netbsd"`.
20272036
* `target_pointer_width = "..."`. Target pointer width in bits. This is set
20282037
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
20292038
64-bit pointers.
@@ -2963,14 +2972,12 @@ move values (depending on their type) from the environment into the lambda
29632972
expression's captured environment.
29642973

29652974
In this example, we define a function `ten_times` that takes a higher-order
2966-
function argument, and call it with a lambda expression as an argument:
2975+
function argument, and we then call it with a lambda expression as an argument:
29672976

29682977
```
29692978
fn ten_times<F>(f: F) where F: Fn(i32) {
2970-
let mut i = 0i32;
2971-
while i < 10 {
2972-
f(i);
2973-
i += 1;
2979+
for index in 0..10 {
2980+
f(index);
29742981
}
29752982
}
29762983
@@ -3319,10 +3326,13 @@ An example of a tuple type and its use:
33193326

33203327
```
33213328
type Pair<'a> = (i32, &'a str);
3322-
let p: Pair<'static> = (10, "hello");
3329+
let p: Pair<'static> = (10, "ten");
33233330
let (a, b) = p;
3324-
assert!(b != "world");
3325-
assert!(p.0 == 10);
3331+
3332+
assert_eq!(a, 10);
3333+
assert_eq!(b, "ten");
3334+
assert_eq!(p.0, 10);
3335+
assert_eq!(p.1, "ten");
33263336
```
33273337

33283338
For historical reasons and convenience, the tuple type with no elements (`()`)
@@ -3332,27 +3342,32 @@ is often called ‘unit’ or ‘the unit type’.
33323342

33333343
Rust has two different types for a list of items:
33343344

3335-
* `[T; N]`, an 'array'.
3336-
* `&[T]`, a 'slice'.
3345+
* `[T; N]`, an 'array'
3346+
* `&[T]`, a 'slice'
33373347

33383348
An array has a fixed size, and can be allocated on either the stack or the
33393349
heap.
33403350

33413351
A slice is a 'view' into an array. It doesn't own the data it points
33423352
to, it borrows it.
33433353

3344-
An example of each kind:
3354+
Examples:
33453355

33463356
```{rust}
3347-
let vec: Vec<i32> = vec![1, 2, 3];
3348-
let arr: [i32; 3] = [1, 2, 3];
3349-
let s: &[i32] = &vec[..];
3357+
// A stack-allocated array
3358+
let array: [i32; 3] = [1, 2, 3];
3359+
3360+
// A heap-allocated array
3361+
let vector: Vec<i32> = vec![1, 2, 3];
3362+
3363+
// A slice into an array
3364+
let slice: &[i32] = &vector[..];
33503365
```
33513366

33523367
As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
33533368
`vec!` macro is also part of the standard library, rather than the language.
33543369

3355-
All in-bounds elements of arrays, and slices are always initialized, and access
3370+
All in-bounds elements of arrays and slices are always initialized, and access
33563371
to an array or slice is always bounds-checked.
33573372

33583373
### Structure types
@@ -3486,7 +3501,7 @@ x = bo(5,7);
34863501

34873502
#### Function types for specific items
34883503

3489-
Internally to the compiler, there are also function types that are specific to a particular
3504+
Internal to the compiler, there are also function types that are specific to a particular
34903505
function item. In the following snippet, for example, the internal types of the functions
34913506
`foo` and `bar` are different, despite the fact that they have the same signature:
34923507

@@ -3514,13 +3529,14 @@ more of the closure traits:
35143529

35153530
* `FnMut`
35163531
: The closure can be called multiple times as mutable. A closure called as
3517-
`FnMut` can mutate values from its environment. `FnMut` implies
3518-
`FnOnce`.
3532+
`FnMut` can mutate values from its environment. `FnMut` inherits from
3533+
`FnOnce` (i.e. anything implementing `FnMut` also implements `FnOnce`).
35193534

35203535
* `Fn`
35213536
: The closure can be called multiple times through a shared reference.
35223537
A closure called as `Fn` can neither move out from nor mutate values
3523-
from its environment. `Fn` implies `FnMut` and `FnOnce`.
3538+
from its environment. `Fn` inherits from `FnMut`, which itself
3539+
inherits from `FnOnce`.
35243540

35253541

35263542
### Trait objects
@@ -3643,7 +3659,7 @@ Coercions are defined in [RFC401]. A coercion is implicit and has no syntax.
36433659
### Coercion sites
36443660

36453661
A coercion can only occur at certain coercion sites in a program; these are
3646-
typically places where the desired type is explicit or can be dervied by
3662+
typically places where the desired type is explicit or can be derived by
36473663
propagation from explicit types (without type inference). Possible coercion
36483664
sites are:
36493665

branches/try/src/doc/trpl/comments.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ fn add_one(x: i32) -> i32 {
3838
}
3939
```
4040

41+
There is another style of doc comment, `//!`, to comment containing items (e.g.
42+
crates, modules or functions), instead of the items following it. Commonly used
43+
inside crates root (lib.rs) or modules root (mod.rs):
44+
45+
```
46+
//! # The Rust Standard Library
47+
//!
48+
//! The Rust Standard Library provides the essential runtime
49+
//! functionality for building portable Rust software.
50+
```
51+
4152
When writing doc comments, providing some examples of usage is very, very
4253
helpful. You’ll notice we’ve used a new macro here: `assert_eq!`. This compares
4354
two values, and `panic!`s if they’re not equal to each other. It’s very helpful

branches/try/src/etc/mklldeps.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414

1515
f = open(sys.argv[1], 'wb')
1616

17-
components = sys.argv[2].split(' ')
18-
components = [i for i in components if i] # ignore extra whitespaces
17+
components = sys.argv[2].split() # splits on whitespace
1918
enable_static = sys.argv[3]
20-
llconfig = sys.argv[4]
19+
llvm_config = sys.argv[4]
2120

2221
f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2322
// file at the top-level directory of this distribution and at
@@ -39,15 +38,15 @@ def run(args):
3938
out, err = proc.communicate()
4039

4140
if err:
42-
print("failed to run llconfig: args = `{}`".format(args))
41+
print("failed to run llvm_config: args = `{}`".format(args))
4342
print(err)
4443
sys.exit(1)
4544
return out
4645

4746
f.write("\n")
4847

4948
# LLVM libs
50-
args = [llconfig, '--libs', '--system-libs']
49+
args = [llvm_config, '--libs', '--system-libs']
5150

5251
args.extend(components)
5352
out = run(args)
@@ -69,13 +68,13 @@ def run(args):
6968
f.write(")]\n")
7069

7170
# LLVM ldflags
72-
out = run([llconfig, '--ldflags'])
71+
out = run([llvm_config, '--ldflags'])
7372
for lib in out.strip().split(' '):
7473
if lib[:2] == "-l":
7574
f.write("#[link(name = \"" + lib[2:] + "\")]\n")
7675

7776
# C++ runtime library
78-
out = run([llconfig, '--cxxflags'])
77+
out = run([llvm_config, '--cxxflags'])
7978
if enable_static == '1':
8079
assert('stdlib=libc++' not in out)
8180
f.write("#[link(name = \"stdc++\", kind = \"static\")]\n")

branches/try/src/etc/snapshot.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ def scrub(b):
4141
download_unpack_base = os.path.join(download_dir_base, "unpack")
4242

4343
snapshot_files = {
44+
"bitrig": ["bin/rustc"],
45+
"dragonfly": ["bin/rustc"],
46+
"freebsd": ["bin/rustc"],
4447
"linux": ["bin/rustc"],
4548
"macos": ["bin/rustc"],
46-
"winnt": ["bin/rustc.exe"],
47-
"freebsd": ["bin/rustc"],
48-
"dragonfly": ["bin/rustc"],
49-
"bitrig": ["bin/rustc"],
49+
"netbsd": ["bin/rustc"],
5050
"openbsd": ["bin/rustc"],
51+
"winnt": ["bin/rustc.exe"],
5152
}
5253

5354
winnt_runtime_deps_32 = ["libgcc_s_dw2-1.dll", "libstdc++-6.dll"]
@@ -103,6 +104,8 @@ def get_kernel(triple):
103104
return "dragonfly"
104105
if os_name == "bitrig":
105106
return "bitrig"
107+
if os_name == "netbsd":
108+
return "netbsd"
106109
if os_name == "openbsd":
107110
return "openbsd"
108111
return "linux"

0 commit comments

Comments
 (0)