]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoOnly retain external static symbols across LTO
arcnmx [Sat, 7 Nov 2015 17:22:04 +0000 (12:22 -0500)]
Only retain external static symbols across LTO

8 years agoAuto merge of #31527 - danlrobertson:i15735, r=alexcrichton
bors [Thu, 11 Feb 2016 14:51:47 +0000 (14:51 +0000)]
Auto merge of #31527 - danlrobertson:i15735, r=alexcrichton

After some digging I couldn't find a test for #15735, so I added a simplified version to `run-pass` and tested it against 80a3f45 to ensure it fails.

8 years agoAuto merge of #31487 - oli-obk:breaking_batch/ast/unop, r=Manishearth
bors [Thu, 11 Feb 2016 12:52:42 +0000 (12:52 +0000)]
Auto merge of #31487 - oli-obk:breaking_batch/ast/unop, r=Manishearth

r? @Manishearth

I just noticed they can't be rolled up (often modifying the same line(s) in imports). So once I reach the critical amount for them to be merged I'll create a PR that merges all of them.

8 years agofixup: meta item kind
Oliver Schneider [Thu, 11 Feb 2016 11:35:47 +0000 (12:35 +0100)]
fixup: meta item kind

8 years ago[breaking-change] don't glob export ast::PathListItem_ variants
Oliver 'ker' Schneider [Tue, 9 Feb 2016 17:09:18 +0000 (18:09 +0100)]
[breaking-change] don't glob export ast::PathListItem_ variants

8 years ago[breaking-change] don't glob export ast::StrStyle variants
Oliver 'ker' Schneider [Tue, 9 Feb 2016 17:01:08 +0000 (18:01 +0100)]
[breaking-change] don't glob export ast::StrStyle variants

8 years ago[breaking-change] don't glob export ast::Visibility variants
Oliver 'ker' Schneider [Tue, 9 Feb 2016 16:57:49 +0000 (17:57 +0100)]
[breaking-change] don't glob export ast::Visibility variants

8 years ago[breaking-change] don't glob export ast::TraitItemKind variants
Oliver 'ker' Schneider [Tue, 9 Feb 2016 16:54:11 +0000 (17:54 +0100)]
[breaking-change] don't glob export ast::TraitItemKind variants

8 years ago[breaking-change] don't glob export ast::Mutablity variants
Oliver 'ker' Schneider [Tue, 9 Feb 2016 16:44:47 +0000 (17:44 +0100)]
[breaking-change] don't glob export ast::Mutablity variants

8 years ago[breaking-change] don't glob export ast::MetaItem_
Oliver 'ker' Schneider [Tue, 9 Feb 2016 11:05:20 +0000 (12:05 +0100)]
[breaking-change] don't glob export ast::MetaItem_

8 years ago[breaking-change] don't glob export ast::MacStmtStyle
Oliver 'ker' Schneider [Tue, 9 Feb 2016 10:56:59 +0000 (11:56 +0100)]
[breaking-change] don't glob export ast::MacStmtStyle

8 years ago[breaking-change] don't glob export ast::KleeneOp variants
Oliver 'ker' Schneider [Tue, 9 Feb 2016 10:45:01 +0000 (11:45 +0100)]
[breaking-change] don't glob export ast::KleeneOp variants

8 years ago[breaking-change] don't glob export ast::Item_ variants
Oliver 'ker' Schneider [Tue, 9 Feb 2016 10:36:51 +0000 (11:36 +0100)]
[breaking-change] don't glob export ast::Item_ variants

8 years ago[breaking-change] don't glob export ast::ForeignItem_ variants
Oliver 'ker' Schneider [Tue, 9 Feb 2016 10:31:19 +0000 (11:31 +0100)]
[breaking-change] don't glob export ast::ForeignItem_ variants

8 years ago[breaking-change] don't pub export ast::Stmt_ variants
Oliver Schneider [Mon, 8 Feb 2016 16:23:13 +0000 (17:23 +0100)]
[breaking-change] don't pub export ast::Stmt_ variants

8 years ago[breaking-change] don't pub export ast::IntLitType variants
Oliver Schneider [Mon, 8 Feb 2016 16:16:23 +0000 (17:16 +0100)]
[breaking-change] don't pub export ast::IntLitType variants

8 years ago[breaking-change] don't pub export ast::Lit_ variants
Oliver Schneider [Mon, 8 Feb 2016 16:06:20 +0000 (17:06 +0100)]
[breaking-change] don't pub export ast::Lit_ variants

8 years ago[breaking-change] don't pub export ast::Ty_ variants
Oliver Schneider [Mon, 8 Feb 2016 15:53:21 +0000 (16:53 +0100)]
[breaking-change] don't pub export ast::Ty_ variants

8 years ago[breaking-change] remove unused enum ast::PrimTy
Oliver Schneider [Mon, 8 Feb 2016 15:35:20 +0000 (16:35 +0100)]
[breaking-change] remove unused enum ast::PrimTy

8 years agoremove unit test that can't be tested anymore
Oliver Schneider [Wed, 23 Dec 2015 21:29:43 +0000 (22:29 +0100)]
remove unit test that can't be tested anymore

8 years ago[breaking-change] remove the sign from integer literals in the ast
Oliver Schneider [Thu, 11 Feb 2016 08:52:55 +0000 (09:52 +0100)]
[breaking-change] remove the sign from integer literals in the ast

8 years ago[breaking-change] don't glob export ast::{UintTy, IntTy} variants
Oliver Schneider [Mon, 8 Feb 2016 15:20:57 +0000 (16:20 +0100)]
[breaking-change] don't glob export ast::{UintTy, IntTy} variants

8 years ago[breaking-change] don't glob export ast::FloatTy variants
Oliver Schneider [Mon, 8 Feb 2016 15:09:01 +0000 (16:09 +0100)]
[breaking-change] don't glob export ast::FloatTy variants

8 years ago[breaking-change] don't glob export ast::Expr_ variants
Oliver Schneider [Mon, 8 Feb 2016 15:05:05 +0000 (16:05 +0100)]
[breaking-change] don't glob export ast::Expr_ variants

8 years ago[breaking-change] don't glob export ast::ExplicitSelf_ variants
Oliver Schneider [Mon, 8 Feb 2016 14:43:56 +0000 (15:43 +0100)]
[breaking-change] don't glob export ast::ExplicitSelf_ variants

8 years ago[breaking-change] don't glob export ast::Decl_ variants
Oliver Schneider [Mon, 8 Feb 2016 14:34:47 +0000 (15:34 +0100)]
[breaking-change] don't glob export ast::Decl_ variants

8 years ago[breaking-change] don't glob export ast::CaptureClause variants
Oliver Schneider [Mon, 8 Feb 2016 14:27:08 +0000 (15:27 +0100)]
[breaking-change] don't glob export ast::CaptureClause variants

8 years ago[breaking-change] don't glob import/export syntax::abi enum variants
Oliver Schneider [Fri, 5 Feb 2016 12:13:36 +0000 (13:13 +0100)]
[breaking-change] don't glob import/export syntax::abi enum variants

8 years ago[breaking-change] don't glob export ast::BlockCheckMode variants
Oliver Schneider [Mon, 8 Feb 2016 11:44:45 +0000 (12:44 +0100)]
[breaking-change] don't glob export ast::BlockCheckMode variants

8 years ago[breaking-change] don't glob import ast::FunctionRetTy variants
Oliver Schneider [Mon, 8 Feb 2016 14:04:11 +0000 (15:04 +0100)]
[breaking-change] don't glob import ast::FunctionRetTy variants

8 years ago[breaking-change] don't glob export ast::BinOp_
Oliver Schneider [Mon, 8 Feb 2016 12:16:12 +0000 (13:16 +0100)]
[breaking-change] don't glob export ast::BinOp_

8 years ago[breaking-change] don't glob export ast::UnOp variants
Oliver Schneider [Mon, 8 Feb 2016 12:21:29 +0000 (13:21 +0100)]
[breaking-change] don't glob export ast::UnOp variants

8 years agoAuto merge of #31525 - antonblanchard:powerpc64_merge4, r=alexcrichton
bors [Thu, 11 Feb 2016 10:56:45 +0000 (10:56 +0000)]
Auto merge of #31525 - antonblanchard:powerpc64_merge4, r=alexcrichton

We no longer have a separate powerpc64 and powerpc64le target_arch, and instead use target_endian to select between the two. These patches fix a couple of remaining issues.

8 years agoAuto merge of #31507 - dirk:dirk/fix-rustdoc-undeclared-type-ice, r=nrc
bors [Thu, 11 Feb 2016 09:01:12 +0000 (09:01 +0000)]
Auto merge of #31507 - dirk:dirk/fix-rustdoc-undeclared-type-ice, r=nrc

Fixes #31451.

8 years agoAuto merge of #31357 - rthomas:hashers, r=alexcrichton
bors [Thu, 11 Feb 2016 06:48:54 +0000 (06:48 +0000)]
Auto merge of #31357 - rthomas:hashers, r=alexcrichton

add a public hasher function for HashSet and HashMap

8 years agoAdd a public hasher function for HashSet and HashMap
Ryan Thomas [Tue, 2 Feb 2016 03:29:48 +0000 (14:29 +1100)]
Add a public hasher function for HashSet and HashMap

8 years agoAuto merge of #31461 - jseyfried:remove_import_resolutions, r=nrc
bors [Thu, 11 Feb 2016 04:27:13 +0000 (04:27 +0000)]
Auto merge of #31461 - jseyfried:remove_import_resolutions, r=nrc

This PR adds to `NameBinding` so it can more fully represent bindings from imports as well from items, refactors away `Target`, generalizes `ImportResolution` to a simpler type `NameResolution`, and uses a single `NameResolution`-valued map in place the existing maps `children` and `import_resolutions` (of `NameBinding`s and `ImportResolution`s, respectively), simplifying duplicate checking and name resolution.

It also unifies the `resolve_name_in_module` in `lib.rs` with its namesake in `resolve_imports.rs`, clarifying and improving the core logic (fixes #31403 and fixes #31404) while maintaining clear future-comparability with shadowable globs (i.e., never reporting that a resolution is a `Success` or is `Failing` unless this would also be knowable with shadowable globs).

Since it fixes #31403, this is technically a [breaking-change], but it is exceedingly unlikely to cause breakage in practice. The following is an example of code that would break:
```rust
mod foo {
    pub mod bar {} // This defines bar in the type namespace
    pub use alpha::bar; // This defines bar in the value namespace

    // This should define baz in both namespaces, but it only defines baz in the type namespace.
    pub use self::bar as baz;
    pub fn baz() {} // This should collide with baz, but now it does not.
}

pub fn f() {}
mod alpha {
    pub use self::f as bar; // Changing this to `pub fn bar() {}` causes the collision right now.
    pub use super::*;
}
```

r? @nrc

8 years agoAuto merge of #31479 - kamalmarhubi:fmt-pointer-unsized, r=alexcrichton
bors [Thu, 11 Feb 2016 01:54:15 +0000 (01:54 +0000)]
Auto merge of #31479 - kamalmarhubi:fmt-pointer-unsized, r=alexcrichton

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 #31409 - alexcrichton:command-exec, r=aturon
bors [Wed, 10 Feb 2016 22:51:43 +0000 (22:51 +0000)]
Auto merge of #31409 - alexcrichton:command-exec, r=aturon

These commits are an implementation of https://github.com/rust-lang/rfcs/pull/1359 which is tracked via https://github.com/rust-lang/rust/issues/31398. The `before_exec` implementation fit easily with the current process spawning framework we have, but unfortunately the `exec` implementation required a bit of a larger refactoring. The stdio handles were all largely managed as implementation details of `std::process` and the `exec` function lived in `std::sys`, so the two didn't have access to one another.

I took this as a sign that a deeper refactoring was necessary, and I personally feel that the end result is cleaner for both Windows and Unix. The commits should be separated nicely for reviewing (or all at once if you're feeling ambitious), but the changes made here were:

* The process spawning on Unix was refactored in to a pre-exec and post-exec function. The post-exec function isn't allowed to do any allocations of any form, and management of transmitting errors back to the parent is managed by the pre-exec function (as it's the one that actually forks).
* Some management of the exit status was pushed into platform-specific modules. On Unix we must cache the return value of `wait` as the pid is consumed after we wait on it, but on Windows we can just keep querying the system because the handle stays valid.
* The `Stdio::None` variant was renamed to `Stdio::Null` to better reflect what it's doing.
* The global lock on `CreateProcess` is now correctly positioned to avoid unintended inheritance of pipe handles that other threads are sending to their child processes. After a more careful reading of the article referenced the race is not in `CreateProcess` itself, but rather the property that handles are unintentionally shared.
* All stdio management now happens in platform-specific modules. This provides a cleaner implementation/interpretation for `FromFraw{Fd,Handle}` for each platform as well as a cleaner transition from a configuration to what-to-do once we actually need to do the spawn.

With these refactorings in place, implementing `before_exec` and `exec` ended up both being pretty trivial! (each in their own commit)

8 years agoAuto merge of #31455 - tmiasko:expected-tokens, r=alexcrichton
bors [Wed, 10 Feb 2016 20:55:53 +0000 (20:55 +0000)]
Auto merge of #31455 - tmiasko:expected-tokens, r=alexcrichton

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 agostd: Move constant back to where it needs to be
Alex Crichton [Tue, 9 Feb 2016 23:14:12 +0000 (15:14 -0800)]
std: Move constant back to where it needs to be

Lost track of this during the std::process refactorings

8 years agostd: Use macros from libc instead of locally
Alex Crichton [Tue, 9 Feb 2016 23:13:33 +0000 (15:13 -0800)]
std: Use macros from libc instead of locally

Helps cut down on #[cfg]!

8 years agostd: Implement CommandExt::exec
Alex Crichton [Thu, 4 Feb 2016 19:16:32 +0000 (11:16 -0800)]
std: Implement CommandExt::exec

This commit implements the `exec` function proposed in [RFC 1359][rfc] which is
a function on the `CommandExt` trait to execute all parts of a `Command::spawn`
without the `fork` on Unix. More details on the function itself can be found in
the comments in the commit.

[rfc]: https://github.com/rust-lang/rfcs/pull/1359

cc #31398

8 years agostd: Push process stdio setup in std::sys
Alex Crichton [Thu, 4 Feb 2016 19:10:37 +0000 (11:10 -0800)]
std: Push process stdio setup in std::sys

Most of this is platform-specific anyway, and we generally have to jump through
fewer hoops to do the equivalent operation on Windows. One benefit for Windows
today is that this new structure avoids an extra `DuplicateHandle` when creating
pipes. For Unix, however, the behavior should be the same.

Note that this is just a pure refactoring, no functionality was added or
removed.

8 years agostd: Lift out Windows' CreateProcess lock a bit
Alex Crichton [Thu, 4 Feb 2016 17:59:47 +0000 (09:59 -0800)]
std: Lift out Windows' CreateProcess lock a bit

The function `CreateProcess` is not itself unsafe to call from many threads, the
article in question is pointing out that handles can be inherited by unintended
child processes. This is basically the same race as the standard Unix
open-then-set-cloexec race.

Since the intention of the lock is to protect children from inheriting
unintended handles, the lock is now lifted out to before the creation of the
child I/O handles (which will all be inheritable). This will ensure that we only
have one process in Rust at least creating inheritable handles at a time,
preventing unintended inheritance to children.

8 years agostd: Rename Stdio::None to Stdio::Null
Alex Crichton [Thu, 4 Feb 2016 17:53:01 +0000 (09:53 -0800)]
std: Rename Stdio::None to Stdio::Null

This better reflects what it's actually doing as we don't actually have an
option for "leave this I/O slot as an empty hole".

8 years agostd: Push Child's exit status to sys::process
Alex Crichton [Thu, 4 Feb 2016 02:09:35 +0000 (18:09 -0800)]
std: Push Child's exit status to sys::process

On Unix we have to be careful to not call `waitpid` twice, but we don't have to
be careful on Windows due to the way process handles work there. As a result the
cached `Option<ExitStatus>` is only necessary on Unix, and it's also just an
implementation detail of the Unix module.

At the same time. also update some code in `kill` on Unix to avoid a wonky
waitpid with WNOHANG. This was added in 0e190b9a to solve #13124, but the
`signal(0)` method is not supported any more so there's no need to for this
workaround. I believe that this is no longer necessary as it's not really doing
anything.

8 years agostd: Implement CommandExt::before_exec
Alex Crichton [Thu, 4 Feb 2016 00:55:59 +0000 (16:55 -0800)]
std: Implement CommandExt::before_exec

This is a Unix-specific function which adds the ability to register a closure to
run pre-exec to configure the child process as required (note that these
closures are run post-fork).

cc #31398

8 years agostd: Refactor process spawning on Unix
Alex Crichton [Sat, 31 Oct 2015 18:09:43 +0000 (11:09 -0700)]
std: Refactor process spawning on Unix

* Build up the argp/envp pointers while the `Command` is being constructed
  rather than only when `spawn` is called. This will allow better sharing of
  code between fork/exec paths.
* Rename `child_after_fork` to `exec` and have it only perform the exec half of
  the spawning. This also means the return type has changed to `io::Error`
  rather than `!` to represent errors that happen.

8 years agoAuto merge of #30686 - wesleywiser:rustdoc_display_since, r=steveklabnik
bors [Wed, 10 Feb 2016 17:23:40 +0000 (17:23 +0000)]
Auto merge of #30686 - wesleywiser:rustdoc_display_since, r=steveklabnik

Here's some screenshots after this change:

![screen shot 2016-01-03 at 11 38 30 am](https://cloud.githubusercontent.com/assets/831192/12079661/23da4e38-b20f-11e5-8c84-ba51d7a59c3f.png)
![screen shot 2016-01-03 at 11 40 39 am](https://cloud.githubusercontent.com/assets/831192/12079663/23e00012-b20f-11e5-9f01-408cc8d43687.png)
![screen shot 2016-01-03 at 11 42 17 am](https://cloud.githubusercontent.com/assets/831192/12079662/23dfe6c2-b20f-11e5-9998-53abc643e2ef.png)

I tried to click through the `std` docs and make sure everything that can have stability attributes has it rendered but I'm probably missing some. I'd also appreciate any feedback on the css changes. I had difficulty getting the `since` labels aligning correctly for enum variants. If anyone has a better idea for that, I'd be glad to implement it.

Fixes #27607

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