Skip to content

Commit 349d66a

Browse files
committed
auto merge of #13532 : alexcrichton/rust/rollup, r=alexcrichton
2 parents 74bd233 + c18c928 commit 349d66a

Some content is hidden

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

45 files changed

+567
-434
lines changed

man/rustc.1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ rustdoc
182182
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
183183

184184
.SH "AUTHOR"
185-
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
186-
<\fI[email protected]\fR> is the project leader.
185+
See \fBAUTHORS.txt\fR in the Rust source distribution.
187186

188187
.SH "COPYRIGHT"
189188
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR

man/rustdoc.1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ rustc
9090
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
9191

9292
.SH "AUTHOR"
93-
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
94-
<\fI[email protected]\fR> is the project leader.
93+
See \fBAUTHORS.txt\fR in the Rust source distribution.
9594

9695
.SH "COPYRIGHT"
9796
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR

mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ PKG_EXE = dist/$(PKG_NAME)-install.exe
118118
%.ico: $(S)src/etc/pkg/%.ico
119119
cp $< $@
120120

121-
$(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \
121+
$(PKG_EXE): rust.iss modpath.iss upgrade.iss LICENSE.txt rust-logo.ico \
122122
$(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
123123
dist-prepare-win
124124
$(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin

mk/prepare.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@
2020
# PREPARE_TARGETS - the target triples, space separated
2121
# PREPARE_DEST_DIR - the directory to put the image
2222

23-
24-
# On windows we install from stage3, but on unix only stage2
25-
ifdef CFG_WINDOWSY_$(CFG_BUILD)
26-
PREPARE_STAGE=3
27-
else
2823
PREPARE_STAGE=2
29-
endif
3024

3125
DEFAULT_PREPARE_DIR_CMD = umask 022 && mkdir -p
3226
DEFAULT_PREPARE_BIN_CMD = install -m755

src/doc/complement-lang-faq.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Some examples that demonstrate different aspects of the language:
2727

2828
You may also be interested in browsing [GitHub's Rust][github-rust] page.
2929

30-
[github-rust]: https://github.com/languages/Rust
30+
[github-rust]: https://github.com/trending?l=rust
3131

3232
## Does it run on Windows?
3333

@@ -141,8 +141,14 @@ export RUST_LOG=hello
141141
./hello
142142
```
143143

144-
**Long answer** RUST_LOG takes a 'logging spec' that consists of a comma-separated list of paths, where a path consists of the crate name and sequence of module names, each separated by double-colons. For standalone .rs files the crate is implicitly named after the source file, so in the above example we were setting RUST_LOG to the name of the hello crate. Multiple paths can be combined to control the exact logging you want to see. For example, when debugging linking in the compiler you might set `RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath`
145-
146-
If you aren't sure which paths you need, try setting RUST_LOG to `::help` and running your program. This will print a list of paths available for logging. For a full description see [the language reference][1].
144+
**Long answer** RUST_LOG takes a 'logging spec' that consists of a
145+
comma-separated list of paths, where a path consists of the crate name and
146+
sequence of module names, each separated by double-colons. For standalone .rs
147+
files the crate is implicitly named after the source file, so in the above
148+
example we were setting RUST_LOG to the name of the hello crate. Multiple paths
149+
can be combined to control the exact logging you want to see. For example, when
150+
debugging linking in the compiler you might set
151+
`RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath`
152+
For a full description see [the language reference][1].
147153

148154
[1]:http://doc.rust-lang.org/doc/master/rust.html#logging-system

src/doc/rust.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,10 +4056,6 @@ crate name the crate is given a default name that matches the source file,
40564056
with the extension removed. In that case, to turn on logging for a program
40574057
compiled from, e.g. `helloworld.rs`, `RUST_LOG` should be set to `helloworld`.
40584058

4059-
As a convenience, the logging spec can also be set to a special pseudo-crate,
4060-
`::help`. In this case, when the application starts, the runtime will
4061-
simply output a list of loaded modules containing log expressions, then exit.
4062-
40634059
#### Logging Expressions
40644060

40654061
Rust provides several macros to log information. Here's a simple Rust program

src/etc/pkg/modpath.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ begin
164164
end;
165165
166166
167-
procedure CurStepChanged(CurStep: TSetupStep);
167+
procedure ModPathCurStepChanged(CurStep: TSetupStep);
168168
var
169169
taskname: String;
170170
begin

src/etc/pkg/rust.iss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,15 @@ begin
4949
setArrayLength(Result, 1)
5050
Result[0] := ExpandConstant('{app}\bin');
5151
end;
52-
#include "modpath.iss"
52+
53+
#include "modpath.iss"
54+
#include "upgrade.iss"
55+
56+
// Both modpath.iss and upgrade.iss want to overload CurStepChanged.
57+
// This version does the overload then delegates to each.
58+
59+
procedure CurStepChanged(CurStep: TSetupStep);
60+
begin
61+
UpgradeCurStepChanged(CurStep);
62+
ModPathCurStepChanged(CurStep);
63+
end;

src/etc/pkg/upgrade.iss

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// The following code taken from https://stackoverflow.com/questions/2000296/innosetup-how-to-automatically-uninstall-previous-installed-version
2+
// It performs upgrades by running the uninstaller before the install
3+
4+
/////////////////////////////////////////////////////////////////////
5+
function GetUninstallString(): String;
6+
var
7+
sUnInstPath: String;
8+
sUnInstallString: String;
9+
begin
10+
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\Rust_is1');
11+
sUnInstallString := '';
12+
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
13+
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
14+
Result := sUnInstallString;
15+
end;
16+
17+
18+
/////////////////////////////////////////////////////////////////////
19+
function IsUpgrade(): Boolean;
20+
begin
21+
Result := (GetUninstallString() <> '');
22+
end;
23+
24+
25+
/////////////////////////////////////////////////////////////////////
26+
function UnInstallOldVersion(): Integer;
27+
var
28+
sUnInstallString: String;
29+
iResultCode: Integer;
30+
begin
31+
// Return Values:
32+
// 1 - uninstall string is empty
33+
// 2 - error executing the UnInstallString
34+
// 3 - successfully executed the UnInstallString
35+
36+
// default return value
37+
Result := 0;
38+
39+
// get the uninstall string of the old app
40+
sUnInstallString := GetUninstallString();
41+
if sUnInstallString <> '' then begin
42+
sUnInstallString := RemoveQuotes(sUnInstallString);
43+
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
44+
Result := 3
45+
else
46+
Result := 2;
47+
end else
48+
Result := 1;
49+
end;
50+
51+
/////////////////////////////////////////////////////////////////////
52+
procedure UpgradeCurStepChanged(CurStep: TSetupStep);
53+
begin
54+
if (CurStep=ssInstall) then
55+
begin
56+
if (IsUpgrade()) then
57+
begin
58+
UnInstallOldVersion();
59+
end;
60+
end;
61+
end;

src/libcollections/hashmap.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,43 +1424,28 @@ impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Eq for HashSet<T, H> {
14241424
}
14251425

14261426
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Container for HashSet<T, H> {
1427-
/// Return the number of elements in the set
14281427
fn len(&self) -> uint { self.map.len() }
14291428
}
14301429

14311430
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Mutable for HashSet<T, H> {
1432-
/// Clear the set, removing all values.
14331431
fn clear(&mut self) { self.map.clear() }
14341432
}
14351433

14361434
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Set<T> for HashSet<T, H> {
1437-
/// Return true if the set contains a value
14381435
fn contains(&self, value: &T) -> bool { self.map.search(value).is_some() }
14391436

1440-
/// Return true if the set has no elements in common with `other`.
1441-
/// This is equivalent to checking for an empty intersection.
14421437
fn is_disjoint(&self, other: &HashSet<T, H>) -> bool {
14431438
self.iter().all(|v| !other.contains(v))
14441439
}
14451440

1446-
/// Return true if the set is a subset of another
14471441
fn is_subset(&self, other: &HashSet<T, H>) -> bool {
14481442
self.iter().all(|v| other.contains(v))
14491443
}
1450-
1451-
/// Return true if the set is a superset of another
1452-
fn is_superset(&self, other: &HashSet<T, H>) -> bool {
1453-
other.is_subset(self)
1454-
}
14551444
}
14561445

14571446
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> MutableSet<T> for HashSet<T, H> {
1458-
/// Add a value to the set. Return true if the value was not already
1459-
/// present in the set.
14601447
fn insert(&mut self, value: T) -> bool { self.map.insert(value, ()) }
14611448

1462-
/// Remove a value from the set. Return true if the value was
1463-
/// present in the set.
14641449
fn remove(&mut self, value: &T) -> bool { self.map.remove(value) }
14651450
}
14661451

src/libcollections/treemap.rs

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -64,32 +64,20 @@ fn lt<K: Ord + TotalOrd, V: Ord>(a: &TreeMap<K, V>,
6464
impl<K: Ord + TotalOrd, V: Ord> Ord for TreeMap<K, V> {
6565
#[inline]
6666
fn lt(&self, other: &TreeMap<K, V>) -> bool { lt(self, other) }
67-
#[inline]
68-
fn le(&self, other: &TreeMap<K, V>) -> bool { !lt(other, self) }
69-
#[inline]
70-
fn ge(&self, other: &TreeMap<K, V>) -> bool { !lt(self, other) }
71-
#[inline]
72-
fn gt(&self, other: &TreeMap<K, V>) -> bool { lt(other, self) }
7367
}
7468

7569
impl<K: TotalOrd, V> Container for TreeMap<K, V> {
76-
/// Return the number of elements in the map
7770
fn len(&self) -> uint { self.length }
78-
79-
/// Return true if the map contains no elements
80-
fn is_empty(&self) -> bool { self.root.is_none() }
8171
}
8272

8373
impl<K: TotalOrd, V> Mutable for TreeMap<K, V> {
84-
/// Clear the map, removing all key-value pairs.
8574
fn clear(&mut self) {
8675
self.root = None;
8776
self.length = 0
8877
}
8978
}
9079

9180
impl<K: TotalOrd, V> Map<K, V> for TreeMap<K, V> {
92-
/// Return a reference to the value corresponding to the key
9381
fn find<'a>(&'a self, key: &K) -> Option<&'a V> {
9482
let mut current: &'a Option<~TreeNode<K, V>> = &self.root;
9583
loop {
@@ -108,22 +96,17 @@ impl<K: TotalOrd, V> Map<K, V> for TreeMap<K, V> {
10896
}
10997

11098
impl<K: TotalOrd, V> MutableMap<K, V> for TreeMap<K, V> {
111-
/// Return a mutable reference to the value corresponding to the key
11299
#[inline]
113100
fn find_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V> {
114101
find_mut(&mut self.root, key)
115102
}
116103

117-
/// Insert a key-value pair from the map. If the key already had a value
118-
/// present in the map, that value is returned. Otherwise None is returned.
119104
fn swap(&mut self, key: K, value: V) -> Option<V> {
120105
let ret = insert(&mut self.root, key, value);
121106
if ret.is_none() { self.length += 1 }
122107
ret
123108
}
124109

125-
/// Removes a key from the map, returning the value at the key if the key
126-
/// was previously in the map.
127110
fn pop(&mut self, key: &K) -> Option<V> {
128111
let ret = remove(&mut self.root, key);
129112
if ret.is_some() { self.length -= 1 }
@@ -531,15 +514,13 @@ impl<K, V> Iterator<(K, V)> for MoveEntries<K,V> {
531514
}
532515

533516
impl<'a, T> Iterator<&'a T> for SetItems<'a, T> {
534-
/// Advance the iterator to the next node (in order). If there are no more nodes, return `None`.
535517
#[inline]
536518
fn next(&mut self) -> Option<&'a T> {
537519
self.iter.next().map(|(value, _)| value)
538520
}
539521
}
540522

541523
impl<'a, T> Iterator<&'a T> for RevSetItems<'a, T> {
542-
/// Advance the iterator to the next node (in order). If there are no more nodes, return `None`.
543524
#[inline]
544525
fn next(&mut self) -> Option<&'a T> {
545526
self.iter.next().map(|(value, _)| value)
@@ -557,90 +538,62 @@ pub struct TreeSet<T> {
557538
impl<T: Eq + TotalOrd> Eq for TreeSet<T> {
558539
#[inline]
559540
fn eq(&self, other: &TreeSet<T>) -> bool { self.map == other.map }
560-
#[inline]
561-
fn ne(&self, other: &TreeSet<T>) -> bool { self.map != other.map }
562541
}
563542

564543
impl<T: Ord + TotalOrd> Ord for TreeSet<T> {
565544
#[inline]
566545
fn lt(&self, other: &TreeSet<T>) -> bool { self.map < other.map }
567-
#[inline]
568-
fn le(&self, other: &TreeSet<T>) -> bool { self.map <= other.map }
569-
#[inline]
570-
fn ge(&self, other: &TreeSet<T>) -> bool { self.map >= other.map }
571-
#[inline]
572-
fn gt(&self, other: &TreeSet<T>) -> bool { self.map > other.map }
573546
}
574547

575548
impl<T: TotalOrd> Container for TreeSet<T> {
576-
/// Return the number of elements in the set
577549
#[inline]
578550
fn len(&self) -> uint { self.map.len() }
579-
580-
/// Return true if the set contains no elements
581-
#[inline]
582-
fn is_empty(&self) -> bool { self.map.is_empty() }
583551
}
584552

585553
impl<T: TotalOrd> Mutable for TreeSet<T> {
586-
/// Clear the set, removing all values.
587554
#[inline]
588555
fn clear(&mut self) { self.map.clear() }
589556
}
590557

591558
impl<T: TotalOrd> Set<T> for TreeSet<T> {
592-
/// Return true if the set contains a value
593559
#[inline]
594560
fn contains(&self, value: &T) -> bool {
595561
self.map.contains_key(value)
596562
}
597563

598-
/// Return true if the set has no elements in common with `other`.
599-
/// This is equivalent to checking for an empty intersection.
600564
fn is_disjoint(&self, other: &TreeSet<T>) -> bool {
601565
self.intersection(other).next().is_none()
602566
}
603567

604-
/// Return true if the set is a subset of another
605-
#[inline]
606568
fn is_subset(&self, other: &TreeSet<T>) -> bool {
607-
other.is_superset(self)
608-
}
609-
610-
/// Return true if the set is a superset of another
611-
fn is_superset(&self, other: &TreeSet<T>) -> bool {
612569
let mut x = self.iter();
613570
let mut y = other.iter();
614571
let mut a = x.next();
615572
let mut b = y.next();
616-
while b.is_some() {
617-
if a.is_none() {
618-
return false
573+
while a.is_some() {
574+
if b.is_none() {
575+
return false;
619576
}
620577

621578
let a1 = a.unwrap();
622579
let b1 = b.unwrap();
623580

624-
match a1.cmp(b1) {
625-
Less => (),
626-
Greater => return false,
627-
Equal => b = y.next(),
581+
match b1.cmp(a1) {
582+
Less => (),
583+
Greater => return false,
584+
Equal => a = x.next(),
628585
}
629586

630-
a = x.next();
587+
b = y.next();
631588
}
632589
true
633590
}
634591
}
635592

636593
impl<T: TotalOrd> MutableSet<T> for TreeSet<T> {
637-
/// Add a value to the set. Return true if the value was not already
638-
/// present in the set.
639594
#[inline]
640595
fn insert(&mut self, value: T) -> bool { self.map.insert(value, ()) }
641596

642-
/// Remove a value from the set. Return true if the value was
643-
/// present in the set.
644597
#[inline]
645598
fn remove(&mut self, value: &T) -> bool { self.map.remove(value) }
646599
}

0 commit comments

Comments
 (0)