Skip to content

Commit 22a9f25

Browse files
committed
auto merge of #19958 : alexcrichton/rust/rollup, r=alexcrichton
2 parents 66c297d + 5c98952 commit 22a9f25

File tree

115 files changed

+2330
-1466
lines changed

Some content is hidden

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

115 files changed

+2330
-1466
lines changed

Diff for: .gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
[submodule "src/jemalloc"]
1212
path = src/jemalloc
1313
url = https://github.com/rust-lang/jemalloc.git
14+
[submodule "src/rust-installer"]
15+
path = src/rust-installer
16+
url = https://github.com/rust-lang/rust-installer

Diff for: mk/ctags.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/llvm,, \
2727
$(patsubst ${CFG_SRC_DIR}src/rt/msvc,, \
2828
$(patsubst ${CFG_SRC_DIR}src/rt/vg,, \
2929
$(wildcard ${CFG_SRC_DIR}src/*) $(wildcard ${CFG_SRC_DIR}src/rt/*) \
30-
)))))))))
30+
))))))))
3131
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=-javascript --recurse ${CTAGS_LOCATIONS}
3232
# We could use `--languages=Rust`, but there is value in producing tags for the
3333
# C++ parts of the code base too (at the time of writing, those are .h and .cpp

Diff for: mk/dist.mk

+15-7
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ PKG_FILES := \
5858
rt \
5959
rustllvm \
6060
snapshots.txt \
61+
rust-installer \
6162
test) \
6263
$(PKG_GITMODULES) \
6364
$(filter-out config.stamp, \
@@ -209,33 +210,40 @@ distcheck-osx: dist-osx
209210
# Unix binary installer tarballs
210211
######################################################################
211212

213+
NON_INSTALLED_PREFIXES=COPYRIGHT,LICENSE-APACHE,LICENSE-MIT,README.md,doc
214+
212215
define DEF_INSTALLER
213216

214217
$$(eval $$(call DEF_PREPARE,dir-$(1)))
215218

216219
dist-install-dir-$(1): PREPARE_HOST=$(1)
217220
dist-install-dir-$(1): PREPARE_TARGETS=$(2)
218-
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
221+
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)-image
219222
dist-install-dir-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
220223
dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
221224
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
222225
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
223226
dist-install-dir-$(1): PREPARE_CLEAN=true
224227
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
225-
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
226-
> tmp/dist/manifest-$(1).in
227-
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
228-
# Add remaining non-installed files
229228
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
230229
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
231230
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
232231
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
233232
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
234-
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
235233

236234
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
237235
@$(call E, build: $$@)
238-
$$(Q)tar -czf dist/$$(PKG_NAME)-$(1).tar.gz -C tmp/dist $$(PKG_NAME)-$(1)
236+
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
237+
--product-name=Rust \
238+
--verify-bin=rustc \
239+
--rel-manifest-dir=rustlib \
240+
--success-message=Rust-is-ready-to-roll. \
241+
--image-dir=tmp/dist/$$(PKG_NAME)-$(1)-image \
242+
--work-dir=tmp/dist \
243+
--output-dir=dist \
244+
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
245+
--package-name=$$(PKG_NAME)-$(1)
246+
$$(Q)rm -R tmp/dist/$$(PKG_NAME)-$(1)-image
239247

240248
endef
241249

Diff for: mk/install.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ endif
2525
# Remove tmp files because it's a decent amount of disk space
2626
$(Q)rm -R tmp/dist
2727

28-
prepare_install: dist-install-dir-$(CFG_BUILD) | tmp/empty_dir
28+
prepare_install: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
2929

3030
uninstall:
3131
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
@@ -38,7 +38,7 @@ endif
3838
# Remove tmp files because it's a decent amount of disk space
3939
$(Q)rm -R tmp/dist
4040

41-
prepare_uninstall: dist-install-dir-$(CFG_BUILD) | tmp/empty_dir
41+
prepare_uninstall: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
4242

4343
.PHONY: install prepare_install uninstall prepare_uninstall
4444

Diff for: src/compiletest/compiletest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
394394

395395
match re.captures(full_version_line) {
396396
Some(captures) => {
397-
Some(captures.at(2).to_string())
397+
Some(captures.at(2).unwrap_or("").to_string())
398398
}
399399
None => {
400400
println!("Could not extract GDB version from line '{}'",
@@ -428,7 +428,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
428428

429429
match re.captures(full_version_line) {
430430
Some(captures) => {
431-
Some(captures.at(1).to_string())
431+
Some(captures.at(1).unwrap_or("").to_string())
432432
}
433433
None => {
434434
println!("Could not extract LLDB version from line '{}'",

Diff for: src/compiletest/errors.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ fn parse_expected(last_nonfollow_error: Option<uint>,
6666
line: &str,
6767
re: &Regex) -> Option<(WhichLine, ExpectedError)> {
6868
re.captures(line).and_then(|caps| {
69-
let adjusts = caps.name("adjusts").len();
70-
let kind = caps.name("kind").to_ascii_lower();
71-
let msg = caps.name("msg").trim().to_string();
72-
let follow = caps.name("follow").len() > 0;
69+
let adjusts = caps.name("adjusts").unwrap_or("").len();
70+
let kind = caps.name("kind").unwrap_or("").to_ascii_lower();
71+
let msg = caps.name("msg").unwrap_or("").trim().to_string();
72+
let follow = caps.name("follow").unwrap_or("").len() > 0;
7373

7474
let (which, line) = if follow {
7575
assert!(adjusts == 0, "use either //~| or //~^, not both.");

Diff for: src/doc/complement-lang-faq.md

+16-12
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Some examples that demonstrate different aspects of the language:
2424
[HashMap]: https://github.com/rust-lang/rust/blob/master/src/libcollections/hashmap.rs
2525
[json]: https://github.com/rust-lang/rust/blob/master/src/libserialize/json.rs
2626

27-
You may also be interested in browsing [GitHub's Rust][github-rust] page.
27+
You may also be interested in browsing [trending Rust repositories][github-rust] on GitHub.
2828

2929
[github-rust]: https://github.com/trending?l=rust
3030

@@ -42,7 +42,7 @@ Let the fact that this is an easily countable number be a warning.
4242

4343
## Does it run on Windows?
4444

45-
Yes. All development happens in lock-step on all 3 target platforms. Using MinGW, not Cygwin. Note that the windows implementation currently has some limitations: in particular 64-bit build is [not fully supported yet][win64], and all executables created by rustc [depend on libgcc DLL at runtime][libgcc].
45+
Yes. All development happens in lockstep on all 3 target platforms (using MinGW, not Cygwin). Note that the Windows implementation currently has some limitations; in particular, the 64-bit build is [not fully supported yet][win64], and all executables created by rustc [depend on libgcc DLL at runtime][libgcc].
4646

4747
[win64]: https://github.com/rust-lang/rust/issues/1237
4848
[libgcc]: https://github.com/rust-lang/rust/issues/11782
@@ -104,7 +104,7 @@ Similar to the reasoning about default-sync: it wires fewer assumptions into the
104104

105105
## Why are strings UTF-8 by default? Why not UCS2 or UCS4?
106106

107-
The `str` type is UTF-8 because we observe more text in the wild in this encoding -- particularly in network transmissions, which are endian-agnostic -- and we think it's best that the default treatment of I/O not involve having to recode codepoints in each direction.
107+
The `str` type is UTF-8 because we observe more text in the wild in this encoding particularly in network transmissions, which are endian-agnostic and we think it's best that the default treatment of I/O not involve having to recode codepoints in each direction.
108108

109109
This does mean that indexed access to a Unicode codepoint inside a `str` value is an O(n) operation. On the one hand, this is clearly undesirable; on the other hand, this problem is full of trade-offs and we'd like to point a few important qualifications:
110110

@@ -145,23 +145,27 @@ For simplicity, we do not plan to do so. Implementing automatic semicolon insert
145145

146146
## How do I get my program to display the output of logging macros?
147147

148-
**Short answer** set the RUST_LOG environment variable to the name of your source file, sans extension.
148+
**Short Answer**: Set the `RUST_LOG` environment variable to the name of your source file, sans extension.
149149

150150
```sh
151151
rustc hello.rs
152152
export RUST_LOG=hello
153153
./hello
154154
```
155155

156-
**Long answer** RUST_LOG takes a 'logging spec' that consists of a
156+
**Long Answer**: `RUST_LOG` takes a 'logging spec' that consists of a
157157
comma-separated list of paths, where a path consists of the crate name and
158-
sequence of module names, each separated by double-colons. For standalone .rs
159-
files the crate is implicitly named after the source file, so in the above
160-
example we were setting RUST_LOG to the name of the hello crate. Multiple paths
158+
sequence of module names, each separated by double-colons. For standalone `.rs`
159+
files, the crate is implicitly named after the source file, so in the above
160+
example we were setting `RUST_LOG` to the name of the hello crate. Multiple paths
161161
can be combined to control the exact logging you want to see. For example, when
162-
debugging linking in the compiler you might set
163-
`RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath`
164-
For a full description see [the logging crate][1].
162+
debugging linking in the compiler, you might set the following:
163+
164+
```sh
165+
RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath
166+
```
167+
168+
For a full description, see [the logging crate][1].
165169

166170
## How fast is Rust?
167171

@@ -172,6 +176,6 @@ performance.
172176
That said, it is an explicit goal of Rust to be as fast as C++ for most things.
173177
Language decisions are made with performance in mind, and we want Rust to be as
174178
fast as possible. Given that Rust is built on top of LLVM, any performance
175-
improvements in it also help us be faster.
179+
improvements in it also help Rust become faster.
176180

177181
[1]:log/index.html

Diff for: src/doc/guide-macros.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ early_return!(input_2, [T::SpecialB]);
195195
As the above example demonstrates, `$(...)*` is also valid on the right-hand
196196
side of a macro definition. The behavior of `*` in transcription,
197197
especially in cases where multiple `*`s are nested, and multiple different
198-
names are involved, can seem somewhat magical and intuitive at first. The
198+
names are involved, can seem somewhat magical and unintuitive at first. The
199199
system that interprets them is called "Macro By Example". The two rules to
200200
keep in mind are (1) the behavior of `$(...)*` is to walk through one "layer"
201201
of repetitions for all of the `$name`s it contains in lockstep, and (2) each

Diff for: src/doc/guide-ownership.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ fn main() {
341341
{ // |
342342
let y = &5i; // ---+ y goes into scope
343343
let f = Foo { x: y }; // ---+ f goes into scope
344-
x = &f.x; // | | error here
344+
x = &f.x; // | | error here
345345
} // ---+ f & y go out of scope
346346
// |
347347
println!("{}", x); // |
@@ -416,7 +416,7 @@ note: `car` moved here because it has type `Car`, which is non-copyable
416416
```
417417

418418
We need our `Car` to be pointed to by multiple `Wheel`s. We can't do that with
419-
`Box<T>`, because it has a single owner. We can do t with `Rc<T>` instead:
419+
`Box<T>`, because it has a single owner. We can do it with `Rc<T>` instead:
420420

421421
```rust
422422
use std::rc::Rc;

Diff for: src/doc/guide-testing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ Let's finally check out that third section: documentation tests.
357357

358358
Nothing is better than documentation with examples. Nothing is worse than
359359
examples that don't actually work, because the code has changed since the
360-
documentation has been written. To this end, Rust supports automaticaly
360+
documentation has been written. To this end, Rust supports automatically
361361
running examples in your documentation. Here's a fleshed-out `src/lib.rs`
362362
with examples:
363363

0 commit comments

Comments
 (0)