Commit Graph

50191 Commits

Author SHA1 Message Date
Steve Klabnik
6571ae28a8 Rollup merge of #31514 - cgar:spelling, r=alexcrichton 2016-02-09 16:58:59 -05:00
Steve Klabnik
e3bf4a7427 Rollup merge of #31513 - scottrobertwhittaker:fix-typo, r=alexcrichton
"particularly" was misspelled.

r? @steveklabnik
2016-02-09 16:58:58 -05:00
Steve Klabnik
f53a5bbe42 Rollup merge of #31473 - raindev:error-handling-case-study, r=steveklabnik
Remove unnecessary cloning and conversions. Expand tab characters left in code examples.
2016-02-09 16:58:58 -05:00
Carlos E. Garcia
02aa0aff2f Minor spelling fixes 2016-02-09 11:52:39 -05:00
Scott Whittaker
5c3a194034 mod.rs: fix typo
"particularly" was misspelled.
2016-02-09 11:47:42 -05:00
bors
fc1c1183f3 Auto merge of #31510 - dikaiosune:master, r=bluss
Since a lexicographic ordering of a struct could vary based on which struct members are compared first, I ended up doing some testing to ensure that the behavior when deriving these traits was what I expected (ordered based on the top to bottom order of declaration of the members). I wanted to add this little bit of documentation to potentially save someone else the same effort. That is, assuming that my testing correctly reflects the intended behavior of the compiler.

r? @steveklabnik
2016-02-09 15:14:25 +00:00
Adam Perry
e22770beeb Clarifying behavior of #[derive(Ord, PartialOrd)] in doc comments.
Removing redundant statement about lexicographic ordering.
2016-02-09 08:01:28 -07:00
bors
6630a08195 Auto merge of #31493 - mechaxl:master, r=steveklabnik
This pull request fixes a minor typo in the prelude documentation.

r? @steveklabnik
2016-02-09 10:50:04 +00:00
bors
8b95b0a6f9 Auto merge of #31282 - pczarn:mir-trans-builder, r=nagisa
Closes #31003
2016-02-09 08:50:03 +00:00
bors
0d410b8d2a Auto merge of #31492 - alexcrichton:remove-allow-trivial-casts, r=nrc
These were added a long time ago but we long since switched the lint back to
allow-by-default, so these annotations shouldn't be necessary.
2016-02-09 06:49:41 +00:00
bors
43437dda68 Auto merge of #31489 - ben0x539:lock-to-guard, r=alexcrichton
The comment in the next line was already talking about `_guard`, and the scope guard a couple lines further down is also called `guard`, so I assume that was just a typo.

r? @steveklabnik
2016-02-09 04:27:42 +00:00
bors
1cff753f46 Auto merge of #31500 - steveklabnik:fix_cow, r=alexcrichton
When I last did a pass through the string documentation, I focused on
consistency across similar functions. Unfortunately, I missed some
details. This example was _too_ consistent: it wasn't actually accurate!

This commit fixes the docs do both be more accurate and to explain why
the return type is a Cow<'a, str>.

First reported here:
https://www.reddit.com/r/rust/comments/44q9ms/stringfrom_utf8_lossy_doesnt_return_a_string/
2016-02-09 02:27:58 +00:00
bors
75271d8f1a Auto merge of #31278 - alexcrichton:print-cfg, r=brson
This commit is an implementation of the new compiler flags required by [RFC
1361][rfc]. This specifically adds a new `cfg` option to the `--print` flag to
the compiler. This new directive will print the defined `#[cfg]` directives by
the compiler for the target in question.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1361-cargo-cfg-dependencies
2016-02-09 00:19:45 +00:00
Alex Crichton
a1ffe6b6bb rustc: Implement a new --print cfg flag
This commit is an implementation of the new compiler flags required by [RFC
1361][rfc]. This specifically adds a new `cfg` option to the `--print` flag to
the compiler. This new directive will print the defined `#[cfg]` directives by
the compiler for the target in question.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1361-cargo-cfg-dependencies.md
2016-02-08 14:28:46 -08:00
bors
f8fa6140fa Auto merge of #31397 - bradfirj:arc-docfix, r=steveklabnik
The documentation for the `make_mut` function on `Arc<T>` contains a somewhat impenetrable double-negative that I was only able to fully grasp by looking at the implementation. Here's a quick rewrite that reads a lot better.

The sentence "doesn't have one strong reference and no weak references." is a
hard to understand, and it can be much more easily explained. In particular, such a double-negative
could give English as a Second Language users even more trouble than native speakers.

r? @steveklabnik
2016-02-08 22:19:41 +00:00
Steve Klabnik
5089b43b45 Fix up docs for String::from_utf8_lossy()
When I last did a pass through the string documentation, I focused on
consistency across similar functions. Unfortunately, I missed some
details. This example was _too_ consistent: it wasn't actually accurate!

This commit fixes the docs do both be more accurate and to explain why
the return type is a Cow<'a, str>.

First reported here:
https://www.reddit.com/r/rust/comments/44q9ms/stringfrom_utf8_lossy_doesnt_return_a_string/
2016-02-08 17:10:55 -05:00
Piotr Czarnecki
38fa06bc95 Cleanup based on review by @nagisa
* We don't have SEH-based unwinding yet.
  For this reason we don't need operand bundles in MIR trans.
* Refactored some uses of fcx.
* Refactored some calls to `with_block`.
2016-02-08 23:08:47 +01:00
bors
efdde2479b Auto merge of #31324 - nagisa:mir-transforms, r=nikomatsakis
Having a `MirPass` provides literally no benefits over `MutVisitor`. Moreover using `MirPass` for
`EraseRegions` basically makes the programmer to fix breakage from changing repr twice – in the
visitor and eraseregions. Since `MutVisitor` implements all the “walking” inside the trait, that can
be reused for `EraseRegions` too, basically resulting in less code duplication.
2016-02-08 19:04:25 +00:00
Kenneth Koski
f3014d1301 Fixing typo in prelude documentation 2016-02-08 12:07:55 -06:00
Alex Crichton
696a1da861 Remove old #[allow(trivial_casts)] annotations
These were added a long time ago but we long since switched the lint back to
allow-by-default, so these annotations shouldn't be necessary.
2016-02-08 09:35:09 -08:00
bors
26105b1a37 Auto merge of #31462 - thepowersgang:fix_29946, r=dotdash
Generates drop calls at the end of the Fn/FnMut -> FnOnce closure shim

Fix #29946
2016-02-08 17:05:21 +00:00
bors
04f12ef4f7 Auto merge of #31442 - pnkfelix:issue-30438-sidestep-dummy-node-during-expand-givens-dfs, r=nikomatsakis
Split dummy-idx node to fix expand_givens DFS

(Much more detail in commit comments.)

Fix #30438.
2016-02-08 14:56:24 +00:00
Benjamin Herr
cab8c2af8e std: _lock -> _guard in Mutex example
The comment in the next line was already talking about `_guard`, and the
scope guard a couple lines further down is also called `guard`, so I
assume that was just a typo.
2016-02-08 14:48:12 +01:00
Felix S. Klock II
77c8850e6f regression tests for issue #30438.
Fix #30438.
2016-02-08 13:49:06 +01:00
Felix S. Klock II
8801bdb6b0 Split dummy in region inference graph into distinct source and sink nodes.
Why do this: The RegionGraph representation previously conflated all
of the non-variable regions (i.e. the concrete regions such as
lifetime parameters to the current function) into a single dummy node.

A single dummy node leads DFS on a graph `'a -> '_#1 -> '_#0 -> 'b` to
claim that `'_#1` is reachable from `'_#0` (due to `'a` and `'b` being
conflated in the graph representation), which is incorrect (and can
lead to soundness bugs later on in compilation, see #30438).

Splitting the dummy node ensures that DFS will never introduce new
ancestor relationships between nodes for variable regions in the
graph.
2016-02-08 13:44:03 +01:00
Piotr Czarnecki
a9ab8096ba Refactor storage of LandingPads 2016-02-08 11:53:06 +01:00
Piotr Czarnecki
06266eb3bd Refactor the MIR translator to use LLVM Builder directly 2016-02-08 11:41:24 +01:00
Piotr Czarnecki
8b776834a4 Implement OwnedBuilder and BlockAndBuilder 2016-02-08 11:12:31 +01:00
bors
e06f6928cb Auto merge of #31468 - pitdicker:fs_tests_cleanup, r=alexcrichton
See #29412
2016-02-08 07:38:11 +00:00
bors
7fce5037a9 Auto merge of #31470 - alexcrichton:lets-find-jemalloc, r=brson
Both of these targets have jemalloc disabled unconditionally right now, so using
`maybe_jemalloc` here isn't right. This fixes the case where a Linux compiler
(which is itself configured to use jemalloc) attempts to cross-compile to MinGW,
causing it to try to find an `alloc_jemalloc` crate (and failing).
2016-02-07 23:31:46 +00:00
Andrew Barchuk
422cf2d34a Clean up Error Handling case study examples
Remove unnecessary cloning and conversions. Expand tabs left in examples.
2016-02-07 23:08:46 +02:00
bors
73132caa0b Auto merge of #31469 - nagisa:mir-else-dest-fix, r=arielb1
r? @arielb1
2016-02-07 20:27:51 +00:00
Paul Dicker
d1bfe9bccf Ignore if we can't create a symlink in this test 2016-02-07 21:10:29 +01:00
Alex Crichton
79a6373573 rustc: Tweak exe allocator for MinGW/rumprun
Both of these targets have jemalloc disabled unconditionally right now, so using
`maybe_jemalloc` here isn't right. This fixes the case where a Linux compiler
(which is itself configured to use jemalloc) attempts to cross-compile to MinGW,
causing it to try to find an `alloc_jemalloc` crate (and failing).
2016-02-07 12:05:03 -08:00
Simonas Kazlauskas
ae151d3945 [MIR] Fix the destination of implicit else branch 2016-02-07 21:47:23 +02:00
Paul Dicker
d47036cbd1 Don't let remove_dir_all recursively remove a symlink
See #29412
2016-02-07 19:31:14 +01:00
John Hodge
f08626bc9b Emit destructor invocation in FnOnce shim for Fn/FnMut
- Fixes #29946
2016-02-07 21:33:30 +08:00
bors
f50fb159e9 Auto merge of #31433 - nagisa:fix-man-ur, r=brson
seems to not work on OS X (or requires label, which would make link repeat twice on non-OS X)

Fixes https://github.com/rust-lang/rust/issues/31432
2016-02-07 10:33:36 +00:00
bors
e548d6c08f Auto merge of #31450 - bluss:no-null-markers, r=Gankro
Document that Unique<T> and Shared<T> are non-null
2016-02-07 07:57:06 +00:00
bors
1678072ce8 Auto merge of #31445 - saurvs:master, r=brson
Similar to https://github.com/rust-lang/rust/issues/31432. Links do not show in OS X for the ```rustdoc``` man page.
2016-02-07 03:50:39 +00:00
bors
3623797ebb Auto merge of #31440 - reem:rwlock-map-fix, r=alexcrichton
Also update the instability reason to include a note about a possible
bad interaction with condition variables on systems that allow
waiting on a RwLock guard.
2016-02-07 00:16:58 +00:00
bors
8c604dc940 Auto merge of #30629 - brson:emscripten-upstream, r=alexcrichton
Here's another go at adding emscripten support. This needs to wait again on new [libc definitions](https://github.com/rust-lang-nursery/libc/pull/122) landing. To get the libc definitions right I had to add support for i686-unknown-linux-musl, which are very similar to emscripten's, which are derived from arm/musl.

This branch additionally removes the makefile dependency on the `EMSCRIPTEN` environment variable by not building the unused compiler-rt.

Again, this is not sufficient for actually compiling to asmjs since it needs additional LLVM patches.

r? @alexcrichton
2016-02-06 21:18:50 +00:00
Brian Anderson
7afb56f51e Add emscripten support to compiletest 2016-02-06 20:56:31 +00:00
Brian Anderson
bd3fe498e5 Add support for i686-unknown-linux-musl 2016-02-06 20:56:31 +00:00
Brian Anderson
81ba4a78b5 rustc: Add obj_is_bitcode to TargetOptions
This tells trans:🔙:write not to LLVM codegen to create .o
files but to put LLMV bitcode in .o files.

Emscripten's emcc supports .o in this format, and this is,
I think, slightly easier than making rlibs work without .o
files.
2016-02-06 20:56:31 +00:00
Brian Anderson
d6c0d859f6 Add the asmjs-unknown-emscripten triple. Add cfgs to libs.
Backtraces, and the compilation of libbacktrace for asmjs, are disabled.

This port doesn't use jemalloc so, like pnacl, it disables jemalloc *for all targets*
in the configure file.

It disables stack protection.
2016-02-06 20:56:14 +00:00
bors
915fa2a378 Auto merge of #31428 - reem:remove-mutexguard-map, r=alexcrichton
It could return in the future if it returned a different guard type, which
could not be used with Condvar, otherwise it is unsafe as another thread
can invalidate an "inner" reference during a Condvar::wait.

cc #27746
2016-02-06 19:16:10 +00:00
bors
3ad5bc01ec Auto merge of #31427 - reem:more-debug-mutex, r=sfackler
There is no reason to require T: 'static; the bound appears to be
a historical artifact.
2016-02-06 17:13:49 +00:00
Ulrik Sverdrup
70650f849f Document that Unique<T> and Shared<T> are non-null 2016-02-06 16:22:17 +01:00
bors
be2ffddffb Auto merge of #31417 - alexcrichton:cloexec-all-the-things, r=brson
These commits finish up closing out https://github.com/rust-lang/rust/issues/24237 by filling out all locations we create new file descriptors with variants that atomically create the file descriptor and set CLOEXEC where possible. Previous support for doing this in `File::open` was added in #27971 and support for `try_clone` was added in #27980. This commit fills out:

* `Socket::new` now passes `SOCK_CLOEXEC`
* `Socket::accept` now uses `accept4`
* `pipe2` is used instead of `pipe`

Unfortunately most of this support is Linux-specific, and most of it is post-2.6.18 (our oldest supported version), so all of the detection here is done dynamically. It looks like OSX does not have equivalent variants for these functions, so there's nothing more we can do there. Support for BSDs can be added over time if they also have these functions.

Closes #24237
2016-02-06 15:15:56 +00:00