]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #31499 - kamalmarhubi:cfg-flag-invalid-cfgs, r=brson
bors [Wed, 10 Feb 2016 14:24:41 +0000 (14:24 +0000)]
Auto merge of #31499 - kamalmarhubi:cfg-flag-invalid-cfgs, r=brson

A spec like `#[cfg(foo(bar))]` is not allowed as an attribute. This
makes the same spec be rejected by the compiler if passed in as a
`--cfg` argument.

Fixes #31495

8 years agoAuto merge of #31420 - bluss:deque-equality, r=Gankro
bors [Wed, 10 Feb 2016 10:04:46 +0000 (10:04 +0000)]
Auto merge of #31420 - bluss:deque-equality, r=Gankro

collections: Use slice parts in PartialEq for VecDeque

This improves == for VecDeque by using the slice representation.

This will also improve further if codegen for slice comparison improves.

Benchmark run of 1000 u64 elements, comparing for equality (all equal).
Cpu time to compare the vecdeques is reduced to less than 50% of what it
was before.

```
test test_eq_u64       ... bench:  1,885 ns/iter (+/- 163) = 4244 MB/s
test test_eq_new_u64   ... bench:    802 ns/iter (+/- 100) = 9975 MB/s
```

8 years agoFix x86stdcall test with emscripten
Pierre Krieger [Wed, 10 Feb 2016 09:37:02 +0000 (10:37 +0100)]
Fix x86stdcall test with emscripten

8 years agoFix half of emscripten's failing tests
Pierre Krieger [Wed, 10 Feb 2016 09:28:51 +0000 (10:28 +0100)]
Fix half of emscripten's failing tests

8 years agoAuto merge of #31494 - alexcrichton:ar-gnu-by-default, r=brson
bors [Wed, 10 Feb 2016 08:03:06 +0000 (08:03 +0000)]
Auto merge of #31494 - alexcrichton:ar-gnu-by-default, r=brson

The compiler currently vendors its own version of "llvm-ar" (not literally the
binary but rather the library support) and uses it for all major targets by
default (e.g. everything defined in `src/librustc_back/target`). All custom
target specs, however, still search for an `ar` tool by default. This commit
changes this default behavior to using the internally bundled llvm-ar with the
GNU format.

Currently all targets use the GNU format except for OSX which uses the BSD
format (surely makes sense, right?), and custom targets can change the format
via the `archive-format` key in custom target specs.

I suspect that we can outright remove support for invoking an external `ar`
utility, but I figure for now there may be some crazy target relying on that so
we should leave support in for now.

8 years agoAuto merge of #31465 - nagisa:mir-free-fix, r=nikomatsakis
bors [Wed, 10 Feb 2016 04:34:15 +0000 (04:34 +0000)]
Auto merge of #31465 - nagisa:mir-free-fix, r=nikomatsakis

Fixes #31463

8 years agoRustdoc - display `since` version for stable items
Wesley Wiser [Wed, 10 Feb 2016 02:15:29 +0000 (21:15 -0500)]
Rustdoc - display `since` version for stable items

Fixes #27607

8 years agoAuto merge of #31438 - aturon:stab-ip-addr, r=alexcrichton
bors [Wed, 10 Feb 2016 01:05:42 +0000 (01:05 +0000)]
Auto merge of #31438 - aturon:stab-ip-addr, r=alexcrichton

After [considerable pushback](https://github.com/rust-lang/rfcs/issues/1451), it's clear that there is a community consensus around providing `IpAddr` in the standard library, together with other APIs using it.

This commit reverts from deprecated status directly to stable. The deprecation landed in 1.6, which has already been released, so the stabilization is marked for 1.7 (currently in beta; will require a backport).

r? @alexcrichton

8 years agoAdd test for issue #15735
Daniel Robertson [Tue, 9 Feb 2016 23:56:10 +0000 (23:56 +0000)]
Add test for issue #15735

Add run-pass test for issue #15735

8 years agoAuto merge of #31523 - steveklabnik:rollup, r=steveklabnik
bors [Tue, 9 Feb 2016 22:28:45 +0000 (22:28 +0000)]
Auto merge of #31523 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #31473, #31513, #31514, #31515, #31516, #31520
- Failed merges:

8 years agoRollup merge of #31520 - steveklabnik:doc_num, r=alexcrichton
Steve Klabnik [Tue, 9 Feb 2016 21:58:59 +0000 (16:58 -0500)]
Rollup merge of #31520 - steveklabnik:doc_num, r=alexcrichton

This commit does two things:

* Re-works the module-level documentation.
* Cleaning up wording and adding links to where error types are used.

Part of #29364

8 years agoRollup merge of #31516 - steveklabnik:doc_tuples, r=brson
Steve Klabnik [Tue, 9 Feb 2016 21:58:59 +0000 (16:58 -0500)]
Rollup merge of #31516 - steveklabnik:doc_tuples, r=brson

Fixes #29339

8 years agoRollup merge of #31515 - steveklabnik:doc_drain, r=alexcrichton
Steve Klabnik [Tue, 9 Feb 2016 21:58:59 +0000 (16:58 -0500)]
Rollup merge of #31515 - steveklabnik:doc_drain, r=alexcrichton

This is the last bit of String docs needed to

Close #29376

8 years agoRollup merge of #31514 - cgar:spelling, r=alexcrichton
Steve Klabnik [Tue, 9 Feb 2016 21:58:59 +0000 (16:58 -0500)]
Rollup merge of #31514 - cgar:spelling, r=alexcrichton

8 years agoRollup merge of #31513 - scottrobertwhittaker:fix-typo, r=alexcrichton
Steve Klabnik [Tue, 9 Feb 2016 21:58:58 +0000 (16:58 -0500)]
Rollup merge of #31513 - scottrobertwhittaker:fix-typo, r=alexcrichton

"particularly" was misspelled.

r? @steveklabnik

8 years agoRollup merge of #31473 - raindev:error-handling-case-study, r=steveklabnik
Steve Klabnik [Tue, 9 Feb 2016 21:58:58 +0000 (16:58 -0500)]
Rollup merge of #31473 - raindev:error-handling-case-study, r=steveklabnik

Remove unnecessary cloning and conversions. Expand tab characters left in code examples.

8 years agomake note of arity and 32-length restriction
Steve Klabnik [Tue, 9 Feb 2016 18:33:02 +0000 (13:33 -0500)]
make note of arity and 32-length restriction

8 years agoProperly document tuples
Steve Klabnik [Tue, 9 Feb 2016 17:54:53 +0000 (12:54 -0500)]
Properly document tuples

Fixes #29339

8 years agoAuto merge of #31425 - oli-obk:mir-pass-plugin, r=nagisa
bors [Tue, 9 Feb 2016 20:27:03 +0000 (20:27 +0000)]
Auto merge of #31425 - oli-obk:mir-pass-plugin, r=nagisa

depends on #31324

r? @nagisa

8 years agotarget_arch is always powerpc64, remove powerpc64le check
Anton Blanchard [Wed, 3 Feb 2016 19:48:26 +0000 (06:48 +1100)]
target_arch is always powerpc64, remove powerpc64le check

We no longer need to check for powerpc64le, so remove it.

8 years agoUse target_endian, not target.arch in cabi_powerpc64
Anton Blanchard [Wed, 3 Feb 2016 00:36:14 +0000 (11:36 +1100)]
Use target_endian, not target.arch in cabi_powerpc64

Now target_arch is powerpc64 on both big and little endian, we need to
use target_endian when there are differences in the two ABIs.

8 years agoSome docs for std::num
Steve Klabnik [Tue, 9 Feb 2016 19:06:24 +0000 (14:06 -0500)]
Some docs for std::num

This commit does two things:

* Re-works the module-level documentation.
* Cleaning up wording and adding links to where error types are used.

Part of #29364

8 years agoAllow prelude imports to shadow eachother (needed for the [pretty] tests)
Jeffrey Seyfried [Tue, 9 Feb 2016 06:26:27 +0000 (06:26 +0000)]
Allow prelude imports to shadow eachother (needed for the [pretty] tests)

Derive the Default impl for NameResolution

8 years agoImprove docs for Drain on String
Steve Klabnik [Tue, 9 Feb 2016 17:02:55 +0000 (12:02 -0500)]
Improve docs for Drain on String

This is the last bit of String docs needed to

Close #29376

8 years agoMinor spelling fixes
Carlos E. Garcia [Tue, 9 Feb 2016 16:52:39 +0000 (11:52 -0500)]
Minor spelling fixes

8 years agomod.rs: fix typo
Scott Whittaker [Tue, 9 Feb 2016 16:47:42 +0000 (11:47 -0500)]
mod.rs: fix typo

"particularly" was misspelled.

8 years agoAllow registering MIR-passes through compiler plugins
Oliver Schneider [Fri, 5 Feb 2016 08:35:54 +0000 (09:35 +0100)]
Allow registering MIR-passes through compiler plugins

8 years agorefactor `MirPass` to always require a tcx
Oliver Schneider [Fri, 5 Feb 2016 08:35:00 +0000 (09:35 +0100)]
refactor `MirPass` to always require a tcx

8 years agomake `MirMap` a struct instead of a type alias for `NodeMap`
Oliver Schneider [Fri, 5 Feb 2016 08:32:33 +0000 (09:32 +0100)]
make `MirMap` a struct instead of a type alias for `NodeMap`

8 years agoRevert deprecation of IpAddr, stabilizing for 1.7
Aaron Turon [Sat, 6 Feb 2016 00:22:45 +0000 (16:22 -0800)]
Revert deprecation of IpAddr, stabilizing for 1.7

After [considerable
pushback](https://github.com/rust-lang/rfcs/issues/1451), it's clear
that there is a community consensus around providing `IpAddr` in the
standard library, together with other APIs using it.

This commit reverts from deprecated status directly to stable. The
deprecation landed in 1.6, which has already been released, so the
stabilization is marked for 1.7 (currently in beta; will require a backport).

8 years agoAuto merge of #31510 - dikaiosune:master, r=bluss
bors [Tue, 9 Feb 2016 15:14:25 +0000 (15:14 +0000)]
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

8 years agoClarifying behavior of #[derive(Ord, PartialOrd)] in doc comments.
Adam Perry [Tue, 9 Feb 2016 05:57:24 +0000 (22:57 -0700)]
Clarifying behavior of #[derive(Ord, PartialOrd)] in doc comments.
Removing redundant statement about lexicographic ordering.

8 years agoFix librustdoc test
Guillaume Gomez [Thu, 11 Feb 2016 10:09:01 +0000 (11:09 +0100)]
Fix librustdoc test

8 years agoCheck if we're not in stable to allow compile_fail option in rustdoc --test
Guillaume Gomez [Tue, 9 Feb 2016 06:18:35 +0000 (07:18 +0100)]
Check if we're not in stable to allow compile_fail option in rustdoc --test

8 years agoAuto merge of #31493 - mechaxl:master, r=steveklabnik
bors [Tue, 9 Feb 2016 10:50:04 +0000 (10:50 +0000)]
Auto merge of #31493 - mechaxl:master, r=steveklabnik

This pull request fixes a minor typo in the prelude documentation.

r? @steveklabnik

8 years agoAuto merge of #31282 - pczarn:mir-trans-builder, r=nagisa
bors [Tue, 9 Feb 2016 08:50:03 +0000 (08:50 +0000)]
Auto merge of #31282 - pczarn:mir-trans-builder, r=nagisa

Closes #31003

8 years agoAuto merge of #31492 - alexcrichton:remove-allow-trivial-casts, r=nrc
bors [Tue, 9 Feb 2016 06:49:41 +0000 (06:49 +0000)]
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.

8 years agoMake rustdoc report driver phase-3 errors instead of continuing
Dirk Gadsden [Tue, 9 Feb 2016 05:09:25 +0000 (21:09 -0800)]
Make rustdoc report driver phase-3 errors instead of continuing

Fixes #31451.

8 years agoAuto merge of #31489 - ben0x539:lock-to-guard, r=alexcrichton
bors [Tue, 9 Feb 2016 04:27:42 +0000 (04:27 +0000)]
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

8 years agoUpdate Makefile
Guillaume Gomez [Sun, 7 Feb 2016 12:03:11 +0000 (13:03 +0100)]
Update Makefile

8 years agoAuto merge of #31500 - steveklabnik:fix_cow, r=alexcrichton
bors [Tue, 9 Feb 2016 02:27:58 +0000 (02:27 +0000)]
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/

8 years agoAuto merge of #31278 - alexcrichton:print-cfg, r=brson
bors [Tue, 9 Feb 2016 00:19:45 +0000 (00:19 +0000)]
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

8 years agodriver: Include invalid predicate in error message
Kamal Marhubi [Mon, 8 Feb 2016 23:47:03 +0000 (18:47 -0500)]
driver: Include invalid predicate in error message

8 years agorustc: Implement a new `--print cfg` flag
Alex Crichton [Mon, 25 Jan 2016 19:36:18 +0000 (11:36 -0800)]
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

8 years agoAuto merge of #31397 - bradfirj:arc-docfix, r=steveklabnik
bors [Mon, 8 Feb 2016 22:19:41 +0000 (22:19 +0000)]
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

8 years agodriver: Disallow predicates in --cfg specs
Kamal Marhubi [Mon, 8 Feb 2016 21:38:35 +0000 (16:38 -0500)]
driver: Disallow predicates in --cfg specs

A spec like `#[cfg(foo(bar))]` is not allowed as an attribute. This
makes the same spec be rejected by the compiler if passed in as a
`--cfg` argument.

Fixes #31495

8 years agodriver: Extract handling of --explain to separate function
Kamal Marhubi [Mon, 8 Feb 2016 20:53:05 +0000 (15:53 -0500)]
driver: Extract handling of --explain to separate function

8 years agodriver: Pass session options to CompilerCallbacks::early_callback()
Kamal Marhubi [Mon, 8 Feb 2016 20:43:01 +0000 (15:43 -0500)]
driver: Pass session options to CompilerCallbacks::early_callback()

8 years agoAdd compile-fail test for invalid cfg predicate in attribute
Kamal Marhubi [Mon, 8 Feb 2016 19:55:38 +0000 (14:55 -0500)]
Add compile-fail test for invalid cfg predicate in attribute

Refs #31495

8 years agoFix up docs for String::from_utf8_lossy()
Steve Klabnik [Mon, 8 Feb 2016 22:10:55 +0000 (17:10 -0500)]
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/

8 years agoCleanup based on review by @nagisa
Piotr Czarnecki [Mon, 8 Feb 2016 22:08:47 +0000 (23:08 +0100)]
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`.

8 years agoBreaking tokens into pieces should behave similar to Parser::bump.
Tomasz Miąsko [Sat, 6 Feb 2016 17:42:17 +0000 (18:42 +0100)]
Breaking tokens into pieces should behave similar to Parser::bump.

Previously when breaking tokens into smaller pieces, the replace_token
function have been used. It replaced current token and updated span
information, but it did not clear the list of expected tokens, neither
did it update remaining info about last token. This could lead to
incorrect error message, like one described in the issue #24780:

  expected one of ... `>` ...  found `>`

8 years agoImplement fmt::Pointer for pointers to unsized types
Kamal Marhubi [Sun, 7 Feb 2016 22:57:01 +0000 (17:57 -0500)]
Implement fmt::Pointer for pointers to unsized types

This allows printing pointers to unsized types with the {:p} formatting
directive. The following impls are extended to unsized types:
 - impl<'a, T: ?Sized> Pointer for &'a T
 - impl<'a, T: ?Sized> Pointer for &'a mut T
 - impl<T: ?Sized> Pointer for *const T
 - impl<T: ?Sized> Pointer for *mut T
 - impl<T: ?Sized> fmt::Pointer for Box<T>
 - impl<T: ?Sized> fmt::Pointer for Rc<T>
 - impl<T: ?Sized> fmt::Pointer for Arc<T>

8 years agoAuto merge of #31324 - nagisa:mir-transforms, r=nikomatsakis
bors [Mon, 8 Feb 2016 19:04:25 +0000 (19:04 +0000)]
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.

8 years agorustc: Use llvm-ar for custom targets by default
Alex Crichton [Mon, 8 Feb 2016 18:27:03 +0000 (10:27 -0800)]
rustc: Use llvm-ar for custom targets by default

The compiler currently vendors its own version of "llvm-ar" (not literally the
binary but rather the library support) and uses it for all major targets by
default (e.g. everything defined in `src/librustc_back/target`). All custom
target specs, however, still search for an `ar` tool by default. This commit
changes this default behavior to using the internally bundled llvm-ar with the
GNU format.

Currently all targets use the GNU format except for OSX which uses the BSD
format (surely makes sense, right?), and custom targets can change the format
via the `archive-format` key in custom target specs.

I suspect that we can outright remove support for invoking an external `ar`
utility, but I figure for now there may be some crazy target relying on that so
we should leave support in for now.

8 years agoFixing typo in prelude documentation
Kenneth Koski [Mon, 8 Feb 2016 18:04:23 +0000 (12:04 -0600)]
Fixing typo in prelude documentation

8 years agoRemove old #[allow(trivial_casts)] annotations
Alex Crichton [Mon, 8 Feb 2016 17:35:09 +0000 (09:35 -0800)]
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.

8 years agoAuto merge of #31462 - thepowersgang:fix_29946, r=dotdash
bors [Mon, 8 Feb 2016 17:05:21 +0000 (17:05 +0000)]
Auto merge of #31462 - thepowersgang:fix_29946, r=dotdash

Generates drop calls at the end of the Fn/FnMut -> FnOnce closure shim

Fix #29946

8 years agoAuto merge of #31442 - pnkfelix:issue-30438-sidestep-dummy-node-during-expand-givens...
bors [Mon, 8 Feb 2016 14:56:24 +0000 (14:56 +0000)]
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.

8 years agostd: `_lock` -> `_guard` in Mutex example
Benjamin Herr [Mon, 8 Feb 2016 13:48:12 +0000 (14:48 +0100)]
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.

8 years agoregression tests for issue #30438.
Felix S. Klock II [Sat, 6 Feb 2016 03:37:21 +0000 (04:37 +0100)]
regression tests for issue #30438.

Fix #30438.

8 years agoSplit dummy in region inference graph into distinct source and sink nodes.
Felix S. Klock II [Sat, 6 Feb 2016 03:28:20 +0000 (04:28 +0100)]
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.

8 years agoRefactor storage of `LandingPad`s
Piotr Czarnecki [Mon, 8 Feb 2016 10:53:06 +0000 (11:53 +0100)]
Refactor storage of `LandingPad`s

8 years agoRefactor the MIR translator to use LLVM Builder directly
Piotr Czarnecki [Mon, 1 Feb 2016 10:04:46 +0000 (11:04 +0100)]
Refactor the MIR translator to use LLVM Builder directly

8 years agoImplement OwnedBuilder and BlockAndBuilder
Piotr Czarnecki [Mon, 1 Feb 2016 10:04:49 +0000 (11:04 +0100)]
Implement OwnedBuilder and BlockAndBuilder

8 years agoAuto merge of #31468 - pitdicker:fs_tests_cleanup, r=alexcrichton
bors [Mon, 8 Feb 2016 07:38:11 +0000 (07:38 +0000)]
Auto merge of #31468 - pitdicker:fs_tests_cleanup, r=alexcrichton

See #29412

8 years agoReallow methods from traits that are shadowed by non-import items
Jeffrey Seyfried [Sat, 6 Feb 2016 23:43:04 +0000 (23:43 +0000)]
Reallow methods from traits that are shadowed by non-import items

8 years agoRefactor away add_export and cleanup the end of resolve_single_import
Jeffrey Seyfried [Sun, 7 Feb 2016 23:06:10 +0000 (23:06 +0000)]
Refactor away add_export and cleanup the end of resolve_single_import

8 years agoReplace children and import_resolutions with a single NameResolution-valued map.
Jeffrey Seyfried [Sun, 7 Feb 2016 23:58:14 +0000 (23:58 +0000)]
Replace children and import_resolutions with a single NameResolution-valued map.

Refactor away resolve_name_in_module in resolve_imports.rs

Rewrite and improve the core name resolution procedure in NameResolution::result and Module::resolve_name

Refactor the duplicate checking code into NameResolution::try_define

8 years agoChange try_define_child to return a Result instead of an Option
Jeffrey Seyfried [Mon, 8 Feb 2016 00:54:31 +0000 (00:54 +0000)]
Change try_define_child to return a Result instead of an Option

8 years agoWrite and use increment_outstanding_references_for and decrement_outstanding_referenc...
Jeffrey Seyfried [Sun, 7 Feb 2016 22:40:23 +0000 (22:40 +0000)]
Write and use increment_outstanding_references_for and decrement_outstanding_references_for

8 years agoRefactor away the fields id and is_public of ImportResolution and rename ImportResolu...
Jeffrey Seyfried [Sun, 7 Feb 2016 22:28:54 +0000 (22:28 +0000)]
Refactor away the fields id and is_public of ImportResolution and rename ImportResolution to NameResolution

8 years agoRefactor away separate tracking of used_public and used_reexport.
Jeffrey Seyfried [Sun, 7 Feb 2016 21:48:24 +0000 (21:48 +0000)]
Refactor away separate tracking of used_public and used_reexport.

NameBinding now encodes these directly with binding.is_public() and (binding.is_public() && binding.is_import()) (respectively)

8 years agoExpand NameBinding to better represent bindings from imports
Jeffrey Seyfried [Sun, 7 Feb 2016 21:34:23 +0000 (21:34 +0000)]
Expand NameBinding to better represent bindings from imports

8 years agoAdd and use an arena for `NameBinding`s
Jeffrey Seyfried [Sun, 7 Feb 2016 21:23:58 +0000 (21:23 +0000)]
Add and use an arena for `NameBinding`s

8 years agoRefactor away Target
Jeffrey Seyfried [Sun, 7 Feb 2016 21:04:01 +0000 (21:04 +0000)]
Refactor away Target

8 years agoMake resolve_name_in_module solely responsible for tracking used crates in lib.rs
Jeffrey Seyfried [Sun, 7 Feb 2016 19:29:51 +0000 (19:29 +0000)]
Make resolve_name_in_module solely responsible for tracking used crates in lib.rs

8 years agoAuto merge of #31470 - alexcrichton:lets-find-jemalloc, r=brson
bors [Sun, 7 Feb 2016 23:31:46 +0000 (23:31 +0000)]
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).

8 years agoClean up Error Handling case study examples
Andrew Barchuk [Sun, 7 Feb 2016 21:00:01 +0000 (23:00 +0200)]
Clean up Error Handling case study examples

Remove unnecessary cloning and conversions. Expand tabs left in examples.

8 years agoAuto merge of #31469 - nagisa:mir-else-dest-fix, r=arielb1
bors [Sun, 7 Feb 2016 20:27:51 +0000 (20:27 +0000)]
Auto merge of #31469 - nagisa:mir-else-dest-fix, r=arielb1

r? @arielb1

8 years agoIgnore if we can't create a symlink in this test
Paul Dicker [Sun, 7 Feb 2016 20:10:29 +0000 (21:10 +0100)]
Ignore if we can't create a symlink in this test

8 years agorustc: Tweak exe allocator for MinGW/rumprun
Alex Crichton [Sun, 7 Feb 2016 20:03:06 +0000 (12:03 -0800)]
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).

8 years ago[MIR] Fix the destination of implicit else branch
Simonas Kazlauskas [Sun, 7 Feb 2016 19:47:23 +0000 (21:47 +0200)]
[MIR] Fix the destination of implicit else branch

8 years agoDon't let `remove_dir_all` recursively remove a symlink
Paul Dicker [Sun, 7 Feb 2016 18:31:14 +0000 (19:31 +0100)]
Don't let `remove_dir_all` recursively remove a symlink
See #29412

8 years agoDo not forget to drop the boxes on scope exits
Simonas Kazlauskas [Sun, 7 Feb 2016 15:58:50 +0000 (17:58 +0200)]
Do not forget to drop the boxes on scope exits

Fixes #31463

8 years agoEmit destructor invocation in FnOnce shim for Fn/FnMut
John Hodge [Sun, 7 Feb 2016 11:35:39 +0000 (19:35 +0800)]
Emit destructor invocation in FnOnce shim for Fn/FnMut

- Fixes #29946

8 years agoUpdate long error explanations
Guillaume Gomez [Sun, 7 Feb 2016 12:02:52 +0000 (13:02 +0100)]
Update long error explanations

8 years agoAdd compile-fail test in rustdoc
Guillaume Gomez [Tue, 5 Jan 2016 22:38:11 +0000 (23:38 +0100)]
Add compile-fail test in rustdoc

8 years agoAuto merge of #31433 - nagisa:fix-man-ur, r=brson
bors [Sun, 7 Feb 2016 10:33:36 +0000 (10:33 +0000)]
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

8 years agoAuto merge of #31450 - bluss:no-null-markers, r=Gankro
bors [Sun, 7 Feb 2016 07:57:06 +0000 (07:57 +0000)]
Auto merge of #31450 - bluss:no-null-markers, r=Gankro

Document that Unique<T> and Shared<T> are non-null

8 years agoAuto merge of #31445 - saurvs:master, r=brson
bors [Sun, 7 Feb 2016 03:50:39 +0000 (03:50 +0000)]
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.

8 years agoAuto merge of #31440 - reem:rwlock-map-fix, r=alexcrichton
bors [Sun, 7 Feb 2016 00:16:58 +0000 (00:16 +0000)]
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.

8 years agoAuto merge of #30629 - brson:emscripten-upstream, r=alexcrichton
bors [Sat, 6 Feb 2016 21:18:50 +0000 (21:18 +0000)]
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

8 years agoAdd emscripten support to compiletest
Brian Anderson [Wed, 6 Jan 2016 19:21:28 +0000 (19:21 +0000)]
Add emscripten support to compiletest

8 years agoAdd support for i686-unknown-linux-musl
Brian Anderson [Tue, 29 Dec 2015 22:33:58 +0000 (22:33 +0000)]
Add support for i686-unknown-linux-musl

8 years agorustc: Add obj_is_bitcode to TargetOptions
Brian Anderson [Fri, 27 Nov 2015 19:44:33 +0000 (19:44 +0000)]
rustc: Add obj_is_bitcode to TargetOptions

This tells trans::back::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.

8 years agoAdd the asmjs-unknown-emscripten triple. Add cfgs to libs.
Brian Anderson [Thu, 26 Nov 2015 19:05:10 +0000 (19:05 +0000)]
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.

8 years agoAuto merge of #31428 - reem:remove-mutexguard-map, r=alexcrichton
bors [Sat, 6 Feb 2016 19:16:10 +0000 (19:16 +0000)]
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

8 years agoAuto merge of #31427 - reem:more-debug-mutex, r=sfackler
bors [Sat, 6 Feb 2016 17:13:49 +0000 (17:13 +0000)]
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.

8 years agoDocument that Unique<T> and Shared<T> are non-null
Ulrik Sverdrup [Sat, 6 Feb 2016 15:18:23 +0000 (16:18 +0100)]
Document that Unique<T> and Shared<T> are non-null