Skip to content

Commit 2202ccb

Browse files
committed
---
yaml --- r: 224319 b: refs/heads/beta c: 9ca511c h: refs/heads/master i: 224317: 249ba78 224315: 099983c 224311: 0116e0a 224303: f445f97 224287: 78818ba 224255: a084676 v: v3
1 parent fa3073c commit 2202ccb

File tree

32 files changed

+604
-395
lines changed

32 files changed

+604
-395
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: b3aa1a6d4ac88f68e036a05fdf19be63b522b65d
26+
refs/heads/beta: 9ca511cf63c3611ffae9218945724c1b32025688
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/configure

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ opt_core() {
283283
fi
284284
done
285285
else
286-
if [ ! -z "$META" ]
286+
if [ -n "$META" ]
287287
then
288288
OP="$OP=<$META>"
289289
fi
@@ -317,7 +317,7 @@ envopt() {
317317
fi
318318

319319
# If script or environment provided a value, save it.
320-
if [ ! -z "$VV" ]
320+
if [ -n "$VV" ]
321321
then
322322
putvar $V
323323
fi
@@ -767,7 +767,7 @@ probe CFG_LLDB lldb
767767
# On MacOS X, invoking `javac` pops up a dialog if the JDK is not
768768
# installed. Since `javac` is only used if `antlr4` is available,
769769
# probe for it only in this case.
770-
if [ ! -z "$CFG_ANTLR4" ]
770+
if [ -n "$CFG_ANTLR4" ]
771771
then
772772
probe CFG_JAVAC javac
773773
fi
@@ -786,14 +786,14 @@ then
786786
fi
787787
fi
788788

789-
if [ ! -z "$CFG_GDB" ]
789+
if [ -n "$CFG_GDB" ]
790790
then
791791
# Store GDB's version
792792
CFG_GDB_VERSION=$($CFG_GDB --version 2>/dev/null | head -1)
793793
putvar CFG_GDB_VERSION
794794
fi
795795

796-
if [ ! -z "$CFG_LLDB" ]
796+
if [ -n "$CFG_LLDB" ]
797797
then
798798
# Store LLDB's version
799799
CFG_LLDB_VERSION=$($CFG_LLDB --version 2>/dev/null | head -1)
@@ -819,7 +819,7 @@ step_msg "looking for target specific programs"
819819

820820
probe CFG_ADB adb
821821

822-
if [ ! -z "$CFG_PANDOC" ]
822+
if [ -n "$CFG_PANDOC" ]
823823
then
824824
# Extract "MAJOR MINOR" from Pandoc's version number
825825
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc' |
@@ -845,7 +845,7 @@ then
845845
BIN_SUF=.exe
846846
fi
847847

848-
if [ ! -z "$CFG_ENABLE_LOCAL_RUST" ]
848+
if [ -n "$CFG_ENABLE_LOCAL_RUST" ]
849849
then
850850
system_rustc=$(which rustc)
851851
if [ -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
@@ -930,18 +930,18 @@ fi
930930

931931
# Okay, at this point, we have made up our minds about whether we are
932932
# going to force CFG_ENABLE_CLANG or not; save the setting if so.
933-
if [ ! -z "$CFG_ENABLE_CLANG" ]
933+
if [ -n "$CFG_ENABLE_CLANG" ]
934934
then
935935
putvar CFG_ENABLE_CLANG
936936
fi
937937

938938
# Same with jemalloc. save the setting here.
939-
if [ ! -z "$CFG_DISABLE_JEMALLOC" ]
939+
if [ -n "$CFG_DISABLE_JEMALLOC" ]
940940
then
941941
putvar CFG_DISABLE_JEMALLOC
942942
fi
943943

944-
if [ ! -z "$CFG_LLVM_ROOT" -a -z "$CFG_DISABLE_LLVM_VERSION_CHECK" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
944+
if [ -n "$CFG_LLVM_ROOT" -a -z "$CFG_DISABLE_LLVM_VERSION_CHECK" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
945945
then
946946
step_msg "using custom LLVM at $CFG_LLVM_ROOT"
947947

@@ -970,7 +970,7 @@ fi
970970
# CFG_ENABLE_CLANG is set, that indicates that we are opting into
971971
# running such safeguards.
972972

973-
if [ ! -z "$CC" ]
973+
if [ -n "$CC" ]
974974
then
975975
msg "skipping compiler inference steps; using provided CC=$CC"
976976
CFG_CC="$CC"
@@ -983,7 +983,7 @@ then
983983
putvar CFG_USING_CLANG
984984
fi
985985
else
986-
if [ ! -z "$CFG_ENABLE_CLANG" ]
986+
if [ -n "$CFG_ENABLE_CLANG" ]
987987
then
988988
if [ -z "$CFG_CLANG" ]
989989
then
@@ -997,7 +997,7 @@ else
997997
fi
998998
fi
999999

1000-
if [ ! -z "$CFG_ENABLE_CLANG" ]
1000+
if [ -n "$CFG_ENABLE_CLANG" ]
10011001
then
10021002
case "$CC" in
10031003
(''|*clang)
@@ -1013,7 +1013,7 @@ then
10131013
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
10141014
fi
10151015

1016-
if [ ! -z "$CFG_OSX_CLANG_VERSION" ]
1016+
if [ -n "$CFG_OSX_CLANG_VERSION" ]
10171017
then
10181018
case $CFG_OSX_CLANG_VERSION in
10191019
(7.0*)
@@ -1042,7 +1042,7 @@ then
10421042
esac
10431043
fi
10441044

1045-
if [ ! -z "$CFG_ENABLE_CCACHE" ]
1045+
if [ -n "$CFG_ENABLE_CCACHE" ]
10461046
then
10471047
if [ -z "$CFG_CCACHE" ]
10481048
then
@@ -1177,8 +1177,13 @@ do
11771177
# INCLUDE and LIB variables for MSVC so we can set those in the
11781178
# build system as well.
11791179
install=$(reg QUERY \
1180-
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
1180+
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0' \
11811181
-v InstallDir)
1182+
if [ -z "$install" ]; then
1183+
install=$(reg QUERY \
1184+
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
1185+
-v InstallDir)
1186+
fi
11821187
need_ok "couldn't find visual studio install root"
11831188
CFG_MSVC_ROOT=$(echo "$install" | grep InstallDir | sed 's/.*REG_SZ[ ]*//')
11841189
CFG_MSVC_ROOT=$(dirname "$CFG_MSVC_ROOT")
@@ -1199,7 +1204,7 @@ do
11991204
;;
12001205
esac
12011206
bindir="${CFG_MSVC_ROOT}/VC/bin"
1202-
if [ ! -z "$msvc_part" ]; then
1207+
if [ -n "$msvc_part" ]; then
12031208
bindir="$bindir/$msvc_part"
12041209
fi
12051210
eval CFG_MSVC_BINDIR_$bits="\"$bindir\""
@@ -1229,7 +1234,7 @@ do
12291234
esac
12301235
done
12311236

1232-
if [ ! -z "$CFG_PERF" ]
1237+
if [ -n "$CFG_PERF" ]
12331238
then
12341239
HAVE_PERF_LOGFD=`$CFG_PERF stat --log-fd 2>&1 | grep 'unknown option'`
12351240
if [ -z "$HAVE_PERF_LOGFD" ];
@@ -1339,11 +1344,11 @@ then
13391344
"${CFG_GIT}" submodule init
13401345

13411346
# Disable submodules that we're not using
1342-
if [ ! -z "${CFG_LLVM_ROOT}" ]; then
1347+
if [ -n "${CFG_LLVM_ROOT}" ]; then
13431348
msg "git: submodule deinit src/llvm"
13441349
"${CFG_GIT}" submodule deinit src/llvm
13451350
fi
1346-
if [ ! -z "${CFG_JEMALLOC_ROOT}" ]; then
1351+
if [ -n "${CFG_JEMALLOC_ROOT}" ]; then
13471352
msg "git: submodule deinit src/jemalloc"
13481353
"${CFG_GIT}" submodule deinit src/jemalloc
13491354
fi
@@ -1390,7 +1395,7 @@ do
13901395
if [ -z $CFG_LLVM_ROOT ]
13911396
then
13921397
LLVM_BUILD_DIR=${CFG_BUILD_DIR}$t/llvm
1393-
if [ ! -z "$CFG_DISABLE_OPTIMIZE_LLVM" ]
1398+
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]
13941399
then
13951400
LLVM_DBG_OPTS="--enable-debug-symbols --disable-optimized"
13961401
# Just use LLVM straight from its build directory to
@@ -1446,7 +1451,7 @@ do
14461451
msg "configuring LLVM for $t with cmake"
14471452

14481453
CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF"
1449-
if [ ! -z "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then
1454+
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then
14501455
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug"
14511456
else
14521457
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release"
@@ -1460,12 +1465,22 @@ do
14601465

14611466
msg "configuring LLVM with:"
14621467
msg "$CMAKE_ARGS"
1468+
case "$CFG_MSVC_ROOT" in
1469+
*14.0*)
1470+
generator="Visual Studio 14 2015"
1471+
;;
1472+
*12.0*)
1473+
generator="Visual Studio 12 2013"
1474+
;;
1475+
*)
1476+
err "can't determine generator for LLVM cmake"
1477+
;;
1478+
esac
14631479
case "$t" in
14641480
x86_64-*)
1465-
generator="Visual Studio 12 2013 Win64"
1481+
generator="$generator Win64"
14661482
;;
14671483
i686-*)
1468-
generator="Visual Studio 12 2013"
14691484
;;
14701485
*)
14711486
err "can only build LLVM for x86 platforms"
@@ -1538,7 +1553,7 @@ do
15381553

15391554
(*)
15401555
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
1541-
if [ ! -z "$CFG_ENABLE_CCACHE" ]
1556+
if [ -n "$CFG_ENABLE_CCACHE" ]
15421557
then
15431558
if [ -z "$CFG_CCACHE" ]
15441559
then
@@ -1672,20 +1687,20 @@ putvar CFG_MANDIR
16721687

16731688
# Avoid spurious warnings from clang by feeding it original source on
16741689
# ccache-miss rather than preprocessed input.
1675-
if [ ! -z "$CFG_ENABLE_CCACHE" ] && [ ! -z "$CFG_USING_CLANG" ]
1690+
if [ -n "$CFG_ENABLE_CCACHE" ] && [ -n "$CFG_USING_CLANG" ]
16761691
then
16771692
CFG_CCACHE_CPP2=1
16781693
putvar CFG_CCACHE_CPP2
16791694
fi
16801695

1681-
if [ ! -z "$CFG_ENABLE_CCACHE" ]
1696+
if [ -n "$CFG_ENABLE_CCACHE" ]
16821697
then
16831698
CFG_CCACHE_BASEDIR=${CFG_SRC_DIR}
16841699
putvar CFG_CCACHE_BASEDIR
16851700
fi
16861701

16871702

1688-
if [ ! -z $BAD_PANDOC ]
1703+
if [ -n $BAD_PANDOC ]
16891704
then
16901705
CFG_PANDOC=
16911706
putvar CFG_PANDOC

branches/beta/src/doc/reference.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,9 @@ always been designed to be compiled. For these reasons, this section assumes a
591591
compiler.
592592

593593
Rust's semantics obey a *phase distinction* between compile-time and
594-
run-time.[^phase-distinction] Those semantic rules that have a *static
595-
interpretation* govern the success or failure of compilation. Those semantics
594+
run-time.[^phase-distinction] Semantic rules that have a *static
595+
interpretation* govern the success or failure of compilation, while
596+
semantic rules
596597
that have a *dynamic interpretation* govern the behavior of the program at
597598
run-time.
598599

branches/beta/src/doc/trpl/choosing-your-guarantees.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The main guarantee provided here is that the data will not be destroyed until al
8181
are out of scope.
8282

8383
This should be used when we wish to dynamically allocate and share some data (read-only) between
84-
various portions of yur program, where it is not certain which portion will finish using the pointer
84+
various portions of your program, where it is not certain which portion will finish using the pointer
8585
last. It's a viable alternative to `&T` when `&T` is either impossible to statically check for
8686
correctness, or creates extremely unergonomic code where the programmer does not wish to spend the
8787
development cost of working with.

branches/beta/src/doc/trpl/traits.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -347,40 +347,50 @@ easiest just to show an example:
347347

348348
```rust
349349
trait Foo {
350-
fn bar(&self);
350+
fn is_valid(&self) -> bool;
351351

352-
fn baz(&self) { println!("We called baz."); }
352+
fn is_invalid(&self) -> bool { !self.is_valid() }
353353
}
354354
```
355355

356-
Implementors of the `Foo` trait need to implement `bar()`, but they don’t
357-
need to implement `baz()`. They’ll get this default behavior. They can
356+
Implementors of the `Foo` trait need to implement `is_valid()`, but they don’t
357+
need to implement `is_invalid()`. They’ll get this default behavior. They can
358358
override the default if they so choose:
359359

360360
```rust
361361
# trait Foo {
362-
# fn bar(&self);
363-
# fn baz(&self) { println!("We called baz."); }
362+
# fn is_valid(&self) -> bool;
363+
#
364+
# fn is_invalid(&self) -> bool { !self.is_valid() }
364365
# }
365366
struct UseDefault;
366367

367368
impl Foo for UseDefault {
368-
fn bar(&self) { println!("We called bar."); }
369+
fn is_valid(&self) -> bool {
370+
println!("Called UseDefault.is_valid.");
371+
true
372+
}
369373
}
370374

371375
struct OverrideDefault;
372376

373377
impl Foo for OverrideDefault {
374-
fn bar(&self) { println!("We called bar."); }
378+
fn is_valid(&self) -> bool {
379+
println!("Called OverrideDefault.is_valid.");
380+
true
381+
}
375382

376-
fn baz(&self) { println!("Override baz!"); }
383+
fn is_invalid(&self) -> bool {
384+
println!("Called OverrideDefault.is_invalid!");
385+
true // this implementation is a self-contradiction!
386+
}
377387
}
378388

379389
let default = UseDefault;
380-
default.baz(); // prints "We called baz."
390+
assert!(!default.is_invalid()); // prints "Called UseDefault.is_valid."
381391

382392
let over = OverrideDefault;
383-
over.baz(); // prints "Override baz!"
393+
assert!(over.is_invalid()); // prints "Called OverrideDefault.is_invalid!"
384394
```
385395

386396
# Inheritance

0 commit comments

Comments
 (0)