Skip to content

Rollup #19931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 67 commits into from
Closed

Rollup #19931

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
31b240d
Add comments with type annotations.
steveklabnik Dec 11, 2014
e92e8ac
Use rust-installer for installation
brson Nov 21, 2014
577f742
serialize: Avoid stray nul characters when auto-serializing char.
lifthrasiir Dec 12, 2014
19eb4bf
Add coercions from *mut to *const and from &mut to *const.
nrc Dec 12, 2014
9a47d65
rustc: Don't panic on corrupt metadata
alexcrichton Dec 13, 2014
f053f29
Fix mispelling in char.rs error message
mchaput Dec 14, 2014
ac7dc03
libsyntax: Make deriving also respect where bounds.
luqmana Dec 14, 2014
ab1bdde
libsyntax: Output where clauses in pretty printer for structs.
luqmana Dec 14, 2014
c2b0d7d
Modify `regex::Captures::{at,name}` to return `Option`
emk Dec 13, 2014
5966815
InvariantLifetime is Copy-able
shepmaster Dec 14, 2014
5c29df6
Fix indentation in a code example in the ownership guide.
jbranchaud Dec 14, 2014
a333e01
Fix typo: intuitive -> unintuitive
nicholasbishop Dec 14, 2014
1fbca88
std: Fully stabilize Option<T>
alexcrichton Dec 14, 2014
0a968ef
Add test for #19129
Dec 15, 2014
26ce387
Minor changes to Rust Language FAQ
iKevinY Dec 15, 2014
0d38cae
std: Bind port early to make a test more reliable
alexcrichton Dec 15, 2014
f63784f
impl `Copy` for `NoSend`/`NoSync`
Dec 15, 2014
c270390
Fix Markdown syntax in docs for OsRng
sourcefrog Dec 15, 2014
8fcc832
Standardize some usages of "which" in docstrings
drewm1980 Dec 15, 2014
4df66cd
Resolve lifetimes in associated types
sanxiyn Dec 15, 2014
2e74291
remove explicit if_let and tuple_indexing feature enables as they now…
Dec 15, 2014
c9ea7c9
serialize: Change some FnOnce bounds to FnMut
alexcrichton Dec 15, 2014
72608eb
Fixed a small spelling mistake
YafahEdelman Dec 15, 2014
a9dbb79
Add a doctest for the string Add function.
jbranchaud Dec 15, 2014
765806e
Use wrapper structs for `BTreeMap`'s iterators.
csouth3 Dec 12, 2014
a81c3ab
Use wrapper structs for `BTreeSet`'s iterators.
csouth3 Dec 13, 2014
85fe141
Use wrapper structs for `HashMap`'s iterators.
csouth3 Dec 12, 2014
341cf40
Use wrapper structs for `HashSet`'s iterators.
csouth3 Dec 13, 2014
13e7f9c
Handle higher-rank lifetimes when generating type IDs
bkoropoff Dec 13, 2014
3925b4d
Add regression test for #19791
bkoropoff Dec 13, 2014
0a1798d
Fix pretty printing of HRTB syntax
bkoropoff Dec 14, 2014
23bae85
std: Second-pass stabilization of `mem`
alexcrichton Dec 16, 2014
9021f61
std: Second pass stabilization of `default`
alexcrichton Dec 16, 2014
3a073e3
Tuple test no longer needed. Is already in run-pass tests
mdinger Dec 16, 2014
b7ba69d
Fixed iOS build after oibit
vhbit Dec 11, 2014
8f4e9c2
Fix `make TAGS.emacs`.
pnkfelix Dec 16, 2014
df5404c
std: Change escape_unicode to use new escapes
alexcrichton Dec 15, 2014
b98391e
rollup merge of #19729: vhbit/ios-oibit-fix
brson Dec 16, 2014
0aedfee
rollup merge of #19743: steveklabnik/gh16143
brson Dec 16, 2014
0c99f2e
rollup merge of #19753: brson/rust-installer
brson Dec 16, 2014
da43a12
rollup merge of #19764: lifthrasiir/that-stray-nul
brson Dec 16, 2014
3643cb3
rollup merge of #19766: nick29581/coerce-raw
brson Dec 16, 2014
f3f3fd9
rollup merge of #19770: csouth3/iterator-wrapperstructs
brson Dec 16, 2014
3bc3ae3
rollup merge of #19799: alexcrichton/stop-panicking
brson Dec 16, 2014
b2ff8bb
rollup merge of #19818: emk/regex_at_name_opt
brson Dec 16, 2014
813d828
rollup merge of #19821: bkoropoff/issue-19791
brson Dec 16, 2014
2ad1e0f
rollup merge of #19830: mchaput/patch-1
brson Dec 16, 2014
f756c97
rollup merge of #19831: luqmana/deriving-where
brson Dec 16, 2014
b5f8287
rollup merge of #19838: shepmaster/invariant-lifetime-copy
brson Dec 16, 2014
14de70f
rollup merge of #19845: jbranchaud/fix-indentation-in-ownership-guide
brson Dec 16, 2014
d899e18
rollup merge of #19846: nicholasbishop/bishops_magical_intuition
brson Dec 16, 2014
7b92a2d
rollup merge of #19849: alexcrichton/second-pass-option
brson Dec 16, 2014
690d2df
rollup merge of #19856: iKevinY/faq-fixes
brson Dec 16, 2014
0193a56
rollup merge of #19857: japaric/test-19129
brson Dec 16, 2014
1ce4c98
rollup merge of #19859: alexcrichton/flaky-test
brson Dec 16, 2014
d960146
rollup merge of #19860: japaric/copy-markers
brson Dec 16, 2014
8ef4120
rollup merge of #19868: sourcefrog/master
brson Dec 16, 2014
5eabd91
rollup merge of #19873: drewm1980/master
brson Dec 16, 2014
8a5bc91
rollup merge of #19880: sanxiyn/assoc-resolve-lifetime
brson Dec 16, 2014
64db64c
rollup merge of #19881: larroy/master
brson Dec 16, 2014
8eeeb7d
rollup merge of #19885: alexcrichton/char-escape
brson Dec 16, 2014
b0a3bf6
rollup merge of #19887: alexcrichton/serialize-fn-mut
brson Dec 16, 2014
91c397a
rollup merge of #19893: JacobEdelman/patch-1
brson Dec 16, 2014
8aa9876
rollup merge of #19895: jbranchaud/add-string-add-doctest
brson Dec 16, 2014
1572479
rollup merge of #19902: alexcrichton/second-pass-mem
brson Dec 16, 2014
984eb13
rollup merge of #19911: mdinger/tuple_tests2
brson Dec 16, 2014
6ed473d
rollup merge of #19923: pnkfelix/fix-make-tags.emacs
brson Dec 16, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
[submodule "src/jemalloc"]
path = src/jemalloc
url = https://github.com/rust-lang/jemalloc.git
[submodule "src/rust-installer"]
path = src/rust-installer
url = https://github.com/rust-lang/rust-installer
2 changes: 1 addition & 1 deletion mk/ctags.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/llvm,, \
$(patsubst ${CFG_SRC_DIR}src/rt/msvc,, \
$(patsubst ${CFG_SRC_DIR}src/rt/vg,, \
$(wildcard ${CFG_SRC_DIR}src/*) $(wildcard ${CFG_SRC_DIR}src/rt/*) \
)))))))))
))))))))
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=-javascript --recurse ${CTAGS_LOCATIONS}
# We could use `--languages=Rust`, but there is value in producing tags for the
# C++ parts of the code base too (at the time of writing, those are .h and .cpp
Expand Down
22 changes: 15 additions & 7 deletions mk/dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ PKG_FILES := \
rt \
rustllvm \
snapshots.txt \
rust-installer \
test) \
$(PKG_GITMODULES) \
$(filter-out config.stamp, \
Expand Down Expand Up @@ -209,33 +210,40 @@ distcheck-osx: dist-osx
# Unix binary installer tarballs
######################################################################

NON_INSTALLED_PREFIXES=COPYRIGHT,LICENSE-APACHE,LICENSE-MIT,README.md,doc

define DEF_INSTALLER

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

dist-install-dir-$(1): PREPARE_HOST=$(1)
dist-install-dir-$(1): PREPARE_TARGETS=$(2)
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)-image
dist-install-dir-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
dist-install-dir-$(1): PREPARE_CLEAN=true
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
> tmp/dist/manifest-$(1).in
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
# Add remaining non-installed files
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)

dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
@$(call E, build: $$@)
$$(Q)tar -czf dist/$$(PKG_NAME)-$(1).tar.gz -C tmp/dist $$(PKG_NAME)-$(1)
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
--product-name=Rust \
--verify-bin=rustc \
--rel-manifest-dir=rustlib \
--success-message=Rust-is-ready-to-roll. \
--image-dir=tmp/dist/$$(PKG_NAME)-$(1)-image \
--work-dir=tmp/dist \
--output-dir=dist \
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
--package-name=$$(PKG_NAME)-$(1)
$$(Q)rm -R tmp/dist/$$(PKG_NAME)-$(1)-image

endef

Expand Down
4 changes: 2 additions & 2 deletions mk/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif
# Remove tmp files because it's a decent amount of disk space
$(Q)rm -R tmp/dist

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

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

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

.PHONY: install prepare_install uninstall prepare_uninstall

Expand Down
4 changes: 2 additions & 2 deletions src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {

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

match re.captures(full_version_line) {
Some(captures) => {
Some(captures.at(1).to_string())
Some(captures.at(1).unwrap_or("").to_string())
}
None => {
println!("Could not extract LLDB version from line '{}'",
Expand Down
8 changes: 4 additions & 4 deletions src/compiletest/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ fn parse_expected(last_nonfollow_error: Option<uint>,
line: &str,
re: &Regex) -> Option<(WhichLine, ExpectedError)> {
re.captures(line).and_then(|caps| {
let adjusts = caps.name("adjusts").len();
let kind = caps.name("kind").to_ascii_lower();
let msg = caps.name("msg").trim().to_string();
let follow = caps.name("follow").len() > 0;
let adjusts = caps.name("adjusts").unwrap_or("").len();
let kind = caps.name("kind").unwrap_or("").to_ascii_lower();
let msg = caps.name("msg").unwrap_or("").trim().to_string();
let follow = caps.name("follow").unwrap_or("").len() > 0;

let (which, line) = if follow {
assert!(adjusts == 0, "use either //~| or //~^, not both.");
Expand Down
26 changes: 14 additions & 12 deletions src/doc/complement-lang-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Some examples that demonstrate different aspects of the language:
[HashMap]: https://github.com/rust-lang/rust/blob/master/src/libcollections/hashmap.rs
[json]: https://github.com/rust-lang/rust/blob/master/src/libserialize/json.rs

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

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

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

## Does it run on Windows?

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].
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].

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

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

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.
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.

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:

Expand Down Expand Up @@ -145,23 +145,25 @@ For simplicity, we do not plan to do so. Implementing automatic semicolon insert

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

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

```sh
rustc hello.rs
export RUST_LOG=hello
./hello
```

**Long answer** RUST_LOG takes a 'logging spec' that consists of a
**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
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`
For a full description see [the logging crate][1].
debugging linking in the compiler, you might set the following:

RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rollup vommited on this line. I think it thinks it's Rust code. Need a text marker or something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source PR has been fixed. Thanks @csouth3!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad! I didn't think the code block would be parsed as Rust code when formatted like that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, we all mess up. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so that I can prevent issues like this in the future, should I be running make check after altering documentation rather than just using make docs? I was testing changes using make docs which I guess is the reason the problem snuck through in the first place.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make check-docs will do it! :)
Edit: The above command tests all code examples in documentation, which the offending line was considered to be. Running it should turn up any errors of this nature.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protips from @steveklabnik: you can run rustdoc on the area of interest, too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, I must have missed that when reading through the Makefile. Thanks!


For a full description, see [the logging crate][1].

## How fast is Rust?

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

[1]:log/index.html
2 changes: 1 addition & 1 deletion src/doc/guide-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ early_return!(input_2, [T::SpecialB]);
As the above example demonstrates, `$(...)*` is also valid on the right-hand
side of a macro definition. The behavior of `*` in transcription,
especially in cases where multiple `*`s are nested, and multiple different
names are involved, can seem somewhat magical and intuitive at first. The
names are involved, can seem somewhat magical and unintuitive at first. The
system that interprets them is called "Macro By Example". The two rules to
keep in mind are (1) the behavior of `$(...)*` is to walk through one "layer"
of repetitions for all of the `$name`s it contains in lockstep, and (2) each
Expand Down
2 changes: 1 addition & 1 deletion src/doc/guide-ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ fn main() {
{ // |
let y = &5i; // ---+ y goes into scope
let f = Foo { x: y }; // ---+ f goes into scope
x = &f.x; // | | error here
x = &f.x; // | | error here
} // ---+ f & y go out of scope
// |
println!("{}", x); // |
Expand Down
Loading