Skip to content

Commit e2bba6a

Browse files
committed
---
yaml --- r: 31014 b: refs/heads/incoming c: c83218d h: refs/heads/master v: v3
1 parent b80e251 commit e2bba6a

Some content is hidden

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

50 files changed

+216
-150
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 26ed387d7faec2e86289855098f08c56986e2568
9+
refs/heads/incoming: c83218de12748a678e873813a6b8381f46fae590
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/configure

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ opt manage-submodules 1 "let the build manage the git submodules"
295295
opt mingw-cross 0 "cross-compile for win32 using mingw"
296296
opt clang 0 "prefer clang to gcc for building the runtime"
297297
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
298-
opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)"
298+
opt pax-marks 0 "apply PaX markings to rustc binaries (required for GRSecurity/PaX-patched kernels)"
299299
valopt prefix "/usr/local" "set installation prefix"
300300
valopt local-rust-root "/usr/local" "set prefix for local rust binary"
301301
valopt llvm-root "" "set LLVM root"
@@ -344,11 +344,8 @@ probe CFG_PDFLATEX pdflatex
344344
probe CFG_XETEX xetex
345345
probe CFG_LUATEX luatex
346346
probe CFG_NODE nodejs node
347-
if [ "$CFG_OSTYPE" = "unknown-linux-gnu" ]
348-
then
349-
probe CFG_PAXCTL paxctl /sbin/paxctl
350-
probe CFG_ZCAT zcat
351-
fi
347+
probe CFG_PAXCTL paxctl /sbin/paxctl
348+
probe CFG_ZCAT zcat
352349

353350
if [ ! -z "$CFG_PANDOC" ]
354351
then
@@ -362,18 +359,19 @@ fi
362359

363360
if [ "$CFG_OSTYPE" = "unknown-linux-gnu" ]
364361
then
365-
if [ ! -z "$CFG_ENABLE_PAX_FLAGS" -a -z "$CFG_PAXCTL" ]
362+
if [ ! -z "$CFG_ENABLE_PAX_MARKS" -a -z "$CFG_PAXCTL" ]
366363
then
367364
err "enabled PaX markings but no paxctl binary found"
368365
fi
369366

370-
if [ -z "$CFG_DISABLE_PAX_FLAGS" ]
367+
if [ -z "$CFG_DISABLE_PAX_MARKS" ]
371368
then
372369
# GRSecurity/PaX detection. This can be very flaky.
373370
GRSEC_DETECTED=
374371

375372
# /dev/grsec only exists if CONFIG_GRKERNSEC_NO_RBAC is not set.
376-
# /proc/sys/kernel/grsecurity is not available if ÇONFIG_GRKERNSEC_SYSCTL is not set.
373+
# /proc is normally only available to root and users in the CONFIG_GRKERNSEC_PROC_GID group,
374+
# and /proc/sys/kernel/grsecurity is not available if ÇONFIG_GRKERNSEC_SYSCTL is not set.
377375
if [ -e /dev/grsec -o -d /proc/sys/kernel/grsecurity ]
378376
then
379377
GRSEC_DETECTED=1
@@ -395,9 +393,9 @@ then
395393
step_msg "GRSecurity: yes"
396394
if [ ! -z "$CFG_PAXCTL" ]
397395
then
398-
CFG_ENABLE_PAX_FLAGS=1
396+
CFG_ENABLE_PAX_MARKS=1
399397
else
400-
warn "GRSecurity kernel detected but no paxctl binary found: not setting CFG_ENABLE_PAX_FLAGS"
398+
warn "GRSecurity kernel detected but no paxctl binary found: not setting CFG_ENABLE_PAX_MARKS"
401399
fi
402400
else
403401
step_msg "GRSecurity: no"
@@ -750,9 +748,9 @@ putvar CFG_C_COMPILER
750748
putvar CFG_LIBDIR
751749
putvar CFG_DISABLE_MANAGE_SUBMODULES
752750

753-
if [ ! -z "$CFG_ENABLE_PAX_FLAGS" ]
751+
if [ ! -z "$CFG_ENABLE_PAX_MARKS" ]
754752
then
755-
putvar CFG_ENABLE_PAX_FLAGS
753+
putvar CFG_ENABLE_PAX_MARKS
756754
putvar CFG_PAXCTL
757755
fi
758756

branches/incoming/mk/stage0.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ ifdef CFG_ENABLE_LOCAL_RUST
1212
$(Q)$(S)src/etc/local_stage0.sh $(CFG_HOST_TRIPLE) $(CFG_LOCAL_RUST_ROOT)
1313
else
1414
$(Q)$(S)src/etc/get-snapshot.py $(CFG_HOST_TRIPLE) $(SNAPSHOT_FILE)
15-
ifdef CFG_ENABLE_PAX_FLAGS
16-
@$(call E, apply PaX flags: $@)
15+
ifdef CFG_ENABLE_PAX_MARKS
16+
@$(call E, apply PaX markings: $@)
1717
@"$(CFG_PAXCTL)" -cm "$@"
1818
endif
1919
endif

branches/incoming/mk/target.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X): \
2929
$$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
3030
@$$(call E, compile_and_link: $$@)
3131
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$<
32-
ifdef CFG_ENABLE_PAX_FLAGS
33-
@$$(call E, apply PaX flags: $$@)
32+
ifdef CFG_ENABLE_PAX_MARKS
33+
@$$(call E, apply PaX markings: $$@)
3434
@"$(CFG_PAXCTL)" -cm "$$@"
3535
endif
3636

branches/incoming/src/cargo/cargo.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,8 @@ Commands:
18891889
set-method Change the method for a source.");
18901890
}
18911891

1892-
fn main(argv: ~[~str]) {
1892+
fn main() {
1893+
let argv = os::args();
18931894
let o = build_cargo_options(argv);
18941895

18951896
if vec::len(o.free) < 2u {

branches/incoming/src/compiletest/compiletest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use common::mode_pretty;
1212
use common::mode;
1313
use util::logv;
1414

15-
fn main(++args: ~[~str]) {
15+
fn main() {
16+
let args = os::args();
1617
let config = parse_config(args);
1718
log_config(config);
1819
run_tests(config);

branches/incoming/src/etc/combine-tests.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def scrub(b):
1919
run_pass = os.path.join(src_dir, "src", "test", "run-pass")
2020
run_pass = os.path.abspath(run_pass)
2121
stage2_tests = []
22-
take_args = {}
2322

2423
for t in os.listdir(run_pass):
2524
if t.endswith(".rs") and not (
@@ -30,8 +29,6 @@ def scrub(b):
3029
"xfail-fast" in s or
3130
"xfail-win32" in s):
3231
stage2_tests.append(t)
33-
if "fn main(args:" in s or "fn main(++args:" in s:
34-
take_args[t] = True
3532
f.close()
3633

3734
stage2_tests.sort()
@@ -64,9 +61,6 @@ def scrub(b):
6461
p = os.path.join("test", "run-pass", t)
6562
p = p.replace("\\", "\\\\")
6663
d.write(" out.write_str(~\"run-pass [stage2]: %s\\n\");\n" % p)
67-
if t in take_args:
68-
d.write(" t_%d::main(~[~\"arg0\"]);\n" % i)
69-
else:
70-
d.write(" t_%d::main();\n" % i)
64+
d.write(" t_%d::main();\n" % i)
7165
i += 1
7266
d.write("}\n")

branches/incoming/src/fuzzer/fuzzer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,8 @@ fn check_variants(files: &[Path], cx: context) {
599599
}
600600
}
601601

602-
fn main(args: ~[~str]) {
602+
fn main() {
603+
let args = os::args();
603604
if vec::len(args) != 2u {
604605
error!("usage: %s <testdir>", args[0]);
605606
return;

branches/incoming/src/libcore/option.rs

Lines changed: 105 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
11
/*!
2-
* Operations on the ubiquitous `option` type.
3-
*
4-
* Type `option` represents an optional value.
5-
*
6-
* Every `Option<T>` value can either be `Some(T)` or `none`. Where in other
7-
* languages you might use a nullable type, in Rust you would use an option
8-
* type.
9-
*/
2+
3+
Operations on the ubiquitous `Option` type.
4+
5+
Type `Option` represents an optional value.
6+
7+
Every `Option<T>` value can either be `Some(T)` or `None`. Where in other
8+
languages you might use a nullable type, in Rust you would use an option
9+
type.
10+
11+
Options are most commonly used with pattern matching to query the presence
12+
of a value and take action, always accounting for the `None` case.
13+
14+
# Example
15+
16+
~~~
17+
let msg = Some(~"howdy");
18+
19+
// Take a reference to the contained string
20+
match msg {
21+
Some(ref m) => io::println(m),
22+
None => ()
23+
}
24+
25+
// Remove the contained string, destroying the Option
26+
let unwrapped_msg = match move msg {
27+
Some(move m) => m,
28+
None => ~"default message"
29+
};
30+
~~~
31+
32+
*/
1033

1134
// NB: transitionary, de-mode-ing.
1235
#[warn(deprecated_mode)];
@@ -22,12 +45,19 @@ pub enum Option<T> {
2245

2346
pub pure fn get<T: Copy>(opt: &Option<T>) -> T {
2447
/*!
25-
* Gets the value out of an option
26-
*
27-
* # Failure
28-
*
29-
* Fails if the value equals `none`
30-
*/
48+
Gets the value out of an option
49+
50+
# Failure
51+
52+
Fails if the value equals `None`
53+
54+
# Safety note
55+
56+
In general, because this function may fail, its use is discouraged
57+
(calling `get` on `None` is akin to dereferencing a null pointer).
58+
Instead, prefer to use pattern matching and handle the `None`
59+
case explicitly.
60+
*/
3161

3262
match *opt {
3363
Some(copy x) => return x,
@@ -37,11 +67,18 @@ pub pure fn get<T: Copy>(opt: &Option<T>) -> T {
3767

3868
pub pure fn get_ref<T>(opt: &r/Option<T>) -> &r/T {
3969
/*!
40-
* Gets an immutable reference to the value inside an option.
41-
*
42-
* # Failure
43-
*
44-
* Fails if the value equals `none`
70+
Gets an immutable reference to the value inside an option.
71+
72+
# Failure
73+
74+
Fails if the value equals `None`
75+
76+
# Safety note
77+
78+
In general, because this function may fail, its use is discouraged
79+
(calling `get` on `None` is akin to dereferencing a null pointer).
80+
Instead, prefer to use pattern matching and handle the `None`
81+
case explicitly.
4582
*/
4683
match *opt {
4784
Some(ref x) => x,
@@ -154,20 +191,37 @@ pub pure fn iter<T>(opt: &Option<T>, f: fn(x: &T)) {
154191
#[inline(always)]
155192
pub pure fn unwrap<T>(opt: Option<T>) -> T {
156193
/*!
157-
* Moves a value out of an option type and returns it.
158-
*
159-
* Useful primarily for getting strings, vectors and unique pointers out
160-
* of option types without copying them.
194+
Moves a value out of an option type and returns it.
195+
196+
Useful primarily for getting strings, vectors and unique pointers out
197+
of option types without copying them.
198+
199+
# Failure
200+
201+
Fails if the value equals `None`.
202+
203+
# Safety note
204+
205+
In general, because this function may fail, its use is discouraged.
206+
Instead, prefer to use pattern matching and handle the `None`
207+
case explicitly.
161208
*/
162209
match move opt {
163210
Some(move x) => move x,
164211
None => fail ~"option::unwrap none"
165212
}
166213
}
167214

168-
/// The ubiquitous option dance.
169215
#[inline(always)]
170216
pub fn swap_unwrap<T>(opt: &mut Option<T>) -> T {
217+
/*!
218+
The option dance. Moves a value out of an option type and returns it,
219+
replacing the original with `None`.
220+
221+
# Failure
222+
223+
Fails if the value equals `None`.
224+
*/
171225
if opt.is_none() { fail ~"option::swap_unwrap none" }
172226
unwrap(util::replace(opt, None))
173227
}
@@ -201,18 +255,38 @@ impl<T> &Option<T> {
201255
pure fn iter(f: fn(x: &T)) { iter(self, f) }
202256
/// Maps a `some` value from one type to another by reference
203257
pure fn map<U>(f: fn(x: &T) -> U) -> Option<U> { map(self, f) }
204-
/// Gets an immutable reference to the value inside a `some`.
258+
/**
259+
Gets an immutable reference to the value inside an option.
260+
261+
# Failure
262+
263+
Fails if the value equals `None`
264+
265+
# Safety note
266+
267+
In general, because this function may fail, its use is discouraged
268+
(calling `get` on `None` is akin to dereferencing a null pointer).
269+
Instead, prefer to use pattern matching and handle the `None`
270+
case explicitly.
271+
*/
205272
pure fn get_ref() -> &self/T { get_ref(self) }
206273
}
207274

208275
impl<T: Copy> Option<T> {
209276
/**
210-
* Gets the value out of an option
211-
*
212-
* # Failure
213-
*
214-
* Fails if the value equals `none`
215-
*/
277+
Gets the value out of an option
278+
279+
# Failure
280+
281+
Fails if the value equals `None`
282+
283+
# Safety note
284+
285+
In general, because this function may fail, its use is discouraged
286+
(calling `get` on `None` is akin to dereferencing a null pointer).
287+
Instead, prefer to use pattern matching and handle the `None`
288+
case explicitly.
289+
*/
216290
pure fn get() -> T { get(&self) }
217291
pure fn get_default(def: T) -> T { get_default(&self, def) }
218292
/**

branches/incoming/src/rustc/driver/rustc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ fn monitor(+f: fn~(diagnostic::emitter)) {
277277
}
278278
}
279279

280-
fn main(args: ~[~str]) {
280+
fn main() {
281+
let args = os::args();
281282
do monitor |demitter| {
282283
run_compiler(args, demitter);
283284
}

0 commit comments

Comments
 (0)