]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #34776 - cuviper:solaris-readdir, r=alexcrichton
bors [Thu, 14 Jul 2016 02:32:17 +0000 (19:32 -0700)]
Auto merge of #34776 - cuviper:solaris-readdir, r=alexcrichton

std: fix `readdir` errors for solaris

A `NULL` from `readdir` could be the end of stream or an error.  The only
way to know is to check `errno`, so it must be set to a known value first,
like a 0 that POSIX will never use.

This currently only matters for solaris targets, as the other unix platforms
are using `readdir_r` with a direct error return indication.  However, this is
getting deprecated (#34668) so they should all eventually switch to `readdir`.

This PR adds `set_errno`, uses it to clear the value before calling `readdir`,
then checks it again after to see the reason for a `NULL`.  A few other small
fixes are included just to get solaris compiling at all.

I couldn't get cross-compilation completely going, so I don't have a good way
to test this beyond a smoke-test cargo build of std.  I'd appreciate input from
someone more familiar with solaris -- cc @nbaksalyar?

8 years agoAuto merge of #34684 - oli-obk:eval_rustdoc_array_len, r=alexcrichton
bors [Wed, 13 Jul 2016 23:27:30 +0000 (16:27 -0700)]
Auto merge of #34684 - oli-obk:eval_rustdoc_array_len, r=alexcrichton

evaluate the array length of fixed size array types in rustdoc

mitgates #34579

to fix it we'd need an expression simplifier.

r? @steveklabnik

cc @Osspial

8 years agoAuto merge of #33642 - xen0n:ergonomic-format-macro, r=alexcrichton
bors [Wed, 13 Jul 2016 20:26:57 +0000 (13:26 -0700)]
Auto merge of #33642 - xen0n:ergonomic-format-macro, r=alexcrichton

Ergonomic format_args!

Fixes #9456 (at last).

Not a ground-up rewrite of the existing machinery, but more like an added intermediary layer between macro arguments and format placeholders. This is now implementing Rust RFC 1618!

8 years agosyntax_ext: format: better code documentation
Wang Xuerui [Thu, 2 Jun 2016 13:47:34 +0000 (21:47 +0800)]
syntax_ext: format: better code documentation

8 years agoformat: add tests for ergonomic format_args!
Wang Xuerui [Sat, 21 May 2016 15:08:30 +0000 (23:08 +0800)]
format: add tests for ergonomic format_args!

format: workaround pretty-printer to pass tests

8 years agosyntax_ext: format: de-duplicate argument objects
Wang Xuerui [Thu, 2 Jun 2016 10:16:24 +0000 (18:16 +0800)]
syntax_ext: format: de-duplicate argument objects

8 years agosyntax_ext: format: process counts uniquely and separately
Wang Xuerui [Sat, 21 May 2016 08:00:01 +0000 (16:00 +0800)]
syntax_ext: format: process counts uniquely and separately

8 years agosyntax_ext: format: allow multiple formats for one argument
Wang Xuerui [Sat, 14 May 2016 12:42:47 +0000 (20:42 +0800)]
syntax_ext: format: allow multiple formats for one argument

This commit removed the restriction of only allowing one type per argument.
This is achieved by adding mappings between macro arguments and format
placeholders, then taking the mapping into consideration when emitting
the Arguments expression.

syntax_ext: format: fix implicit positional arguments

syntax_ext: format: don't panic if no args given for implicit positional args

Check the list lengths before use.
Fixes regression of `compile-fail/macro-backtrace-println.rs`.

syntax_ext: format: also map CountIsParam indices to expanded args

syntax_ext: format: fix ICE in case of malformed format args

8 years agosyntax_ext: format: rename variants of ArgumentType for clarity
Wang Xuerui [Sat, 21 May 2016 04:58:17 +0000 (12:58 +0800)]
syntax_ext: format: rename variants of ArgumentType for clarity

8 years agosyntax_ext: format: resolve named arguments early
Wang Xuerui [Sun, 5 Jun 2016 12:39:05 +0000 (20:39 +0800)]
syntax_ext: format: resolve named arguments early

Converts named argument references into indices, right after
verification as suggested by @alexcrichton. This drastically simplifies
the whole process!

8 years agosyntax_ext: format: separate verification and translation of pieces
Wang Xuerui [Sun, 5 Jun 2016 10:01:37 +0000 (18:01 +0800)]
syntax_ext: format: separate verification and translation of pieces

8 years agoformat: remove all implicit ref handling outside of libfmt_macros
Wang Xuerui [Mon, 16 May 2016 17:02:42 +0000 (01:02 +0800)]
format: remove all implicit ref handling outside of libfmt_macros

format: beautifully get rid of ArgumentNext and CountIsNextParam

Now that CountIsNextParam and ArgumentNext are resolved during parse,
the need for handling them outside of libfmt_macros is obviated.

Note: *one* instance of implicit reference handling still remains, and
that's for implementing `all_args_simple`. It's trivial enough though,
so in this case it may be tolerable.

8 years agolibfmt_macros: resolve all implicit refs while parsing
Wang Xuerui [Mon, 16 May 2016 06:10:54 +0000 (14:10 +0800)]
libfmt_macros: resolve all implicit refs while parsing

8 years agoAuto merge of #34772 - jseyfried:cleanup_interner, r=eddyb
bors [Wed, 13 Jul 2016 17:26:18 +0000 (10:26 -0700)]
Auto merge of #34772 - jseyfried:cleanup_interner, r=eddyb

Start cleaning up the string interner

r? @eddyb

8 years agoAuto merge of #34752 - ollie27:rustdoc_search, r=GuillaumeGomez
bors [Wed, 13 Jul 2016 14:27:43 +0000 (07:27 -0700)]
Auto merge of #34752 - ollie27:rustdoc_search, r=GuillaumeGomez

rustdoc: Fix methods in seach results

Currently methods from extern crates are sometimes added to the search
index when they shouldn't be or added with the original path rather than
the reexported path. This fixes that by making sure `cache().paths` only
contains local paths like the description for it states. It also fixes a
few minor issues with link rendering and redirect generation which would
point to local crate docs even if the docs for that crate hadn't been
generated.

Also a bug with methods implemented on traits which caused wrong paths and
so dead links in the search results has been fixed.

For example:
[before](https://doc.rust-lang.org/nightly/std/?search=is_disjoint) [after](https://ollie27.github.io/rust_doc_test/std/?search=is_disjoint)
[before](https://doc.rust-lang.org/nightly/std/?search=map_or) [after](https://ollie27.github.io/rust_doc_test/std/?search=map_or)
[before](https://doc.rust-lang.org/nightly/std/?search=unsafecell%3A%3Anew) [after](https://ollie27.github.io/rust_doc_test/std/?search=unsafecell%3A%3Anew)
[before](https://doc.rust-lang.org/nightly/std/?search=rng%3A%3Agen_) [after](https://ollie27.github.io/rust_doc_test/std/?search=rng%3A%3Agen_)
[before](https://doc.rust-lang.org/nightly/std/?search=downcast_ref) [after](https://ollie27.github.io/rust_doc_test/std/?search=downcast_ref)

Fixes #20246

8 years agoAuto merge of #34608 - apasel422:ll, r=bluss
bors [Wed, 13 Jul 2016 11:31:30 +0000 (04:31 -0700)]
Auto merge of #34608 - apasel422:ll, r=bluss

Replace `LinkedList`'s use of `Box` with `Shared`

Closes #34417

8 years agoAuto merge of #34660 - jseyfried:fix_parse_stmt, r=nrc
bors [Wed, 13 Jul 2016 08:37:07 +0000 (01:37 -0700)]
Auto merge of #34660 - jseyfried:fix_parse_stmt, r=nrc

Fix bugs in macro-expanded statement parsing

Fixes #34543.

This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => {
    println!("") println!("")
    //^ Semicolons are now required on macro-expanded non-braced macro invocations
    //| in statement positions.
    let x = 0
    //^ Semicolons are now required on macro-expanded `let` statements
    //| that are followed by more statements, so this would break.
    let y = 0 //< (this would still be allowed to reduce breakage in the wild)
}
fn main() { m!() }
```

r? @eddyb

8 years agoevaluate the array length of fixed size array types in rustdoc
Oliver Schneider [Wed, 13 Jul 2016 08:35:58 +0000 (10:35 +0200)]
evaluate the array length of fixed size array types in rustdoc

8 years agoAuto merge of #34756 - habnabit:mutex-refunwindsafe, r=alexcrichton
bors [Wed, 13 Jul 2016 05:43:31 +0000 (22:43 -0700)]
Auto merge of #34756 - habnabit:mutex-refunwindsafe, r=alexcrichton

Mutex and RwLock need RefUnwindSafe too

Incomplete, because I don't know what the appropriate stability annotation is here, but this is an attempt to bring the documentation for `std::panic` in line with reality. Right now, it says:

>Types like `&Mutex<T>`, however, are unwind safe because they implement poisoning by default.

But only `Mutex<T>`, not `&Mutex<T>`, is unwind-safe.

8 years agoStart a best-effort warning cycle.
Jeffrey Seyfried [Tue, 12 Jul 2016 03:56:19 +0000 (03:56 +0000)]
Start a best-effort warning cycle.

8 years agocleanup: Refactor parser method `finish_parsing_statement` -> `parse_full_stmt`.
Jeffrey Seyfried [Thu, 7 Jul 2016 04:12:20 +0000 (04:12 +0000)]
cleanup: Refactor parser method `finish_parsing_statement` -> `parse_full_stmt`.

8 years agoAllow macro-expanded macros in trailing expression positions to expand into statements:
Jeffrey Seyfried [Tue, 5 Jul 2016 08:21:25 +0000 (08:21 +0000)]
Allow macro-expanded macros in trailing expression positions to expand into statements:

```rust
macro_rules! m { () => { let x = 1; x } }
macro_rules! n { () => {
    m!() //< This can now expand into statements
}}
fn main() { n!(); }
```

and revert needless fallout fixes.

8 years agoFix bug in the pretty printer.
Jeffrey Seyfried [Tue, 5 Jul 2016 11:21:25 +0000 (11:21 +0000)]
Fix bug in the pretty printer.

8 years agoAuto merge of #34739 - therealbstern:ipv4unspec, r=alexcrichton
bors [Wed, 13 Jul 2016 02:11:02 +0000 (19:11 -0700)]
Auto merge of #34739 - therealbstern:ipv4unspec, r=alexcrichton

Mark Ipv4Addr is_unspecified as stable and provide reference.

Per [#27709 (comment)](https://github.com/rust-lang/rust/issues/27709#issuecomment-231280999), no RFC is needed here.

IPv4 "unspecified" has been defined in [Stevens], and has been part of the IPv4 stack for quite some time.  This property should become stable, since this use of 0.0.0.0 is not going anywhere.

[Stevens][_UNIX Network Programming Volume 1, Second Edition_.  Stevens, W. Richard.  Prentice-Hall, 1998.  p. 891]

Please let me know if I got the rustdoc wrong or something.  I tried to be as terse as possible while still conveying the appropriate information.

This also has a slight impact on PR #34694, but that one came first, so this shouldn't block it, IMO.

8 years agoAuto merge of #34705 - alexcrichton:clean-deprecated, r=brson
bors [Tue, 12 Jul 2016 22:15:56 +0000 (15:15 -0700)]
Auto merge of #34705 - alexcrichton:clean-deprecated, r=brson

std: Clean out deprecated APIs

This primarily removes a lot of `sync::Static*` APIs and rejiggers the
associated implementations. While doing this it was discovered that the
`is_poisoned` method can actually result in a data race for the Mutex/RwLock
primitives, so the inner `Cell<bool>` was changed to an `AtomicBool` to prevent
the associated data race. Otherwise the usage/gurantees should be the same
they were before.

8 years agostd: Clean out deprecated APIs
Alex Crichton [Thu, 7 Jul 2016 18:46:09 +0000 (11:46 -0700)]
std: Clean out deprecated APIs

This primarily removes a lot of `sync::Static*` APIs and rejiggers the
associated implementations. While doing this it was discovered that the
`is_poisoned` method can actually result in a data race for the Mutex/RwLock
primitives, so the inner `Cell<bool>` was changed to an `AtomicBool` to prevent
the associated data race. Otherwise the usage/gurantees should be the same
they were before.

8 years agoAuto merge of #34757 - sourcefrog:debug-filetype, r=alexcrichton
bors [Tue, 12 Jul 2016 13:54:46 +0000 (06:54 -0700)]
Auto merge of #34757 - sourcefrog:debug-filetype, r=alexcrichton

Derive Debug on FileType.

Partially fixes #32054

8 years agorustdoc: Fix methods in seach results
Oliver Middleton [Sat, 9 Jul 2016 13:07:37 +0000 (14:07 +0100)]
rustdoc: Fix methods in seach results

Currently methods from extern crates are sometimes added to the search
index when they shouldn't be or added with the original path rather than
the reexported path. This fixes that by making sure `cache().paths` only
contains local paths like the description for it states. It also fixes a
few minor issues with link rendering and redirect generation which would
point to local crate docs even if the docs for that crate hadn't been
generated.

Also a bug with methods implemented on traits which caused wrong paths and
so dead links in the search results has been fixed.

8 years agoAuto merge of #34778 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Tue, 12 Jul 2016 10:58:33 +0000 (03:58 -0700)]
Auto merge of #34778 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 7 pull requests

- Successful merges: #34736, #34737, #34740, #34742, #34749, #34750, #34770
- Failed merges: #33951

8 years agoRollup merge of #34770 - davidko:patch-1, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:24 +0000 (12:08 +0200)]
Rollup merge of #34770 - davidko:patch-1, r=steveklabnik

Fixed some typos

I believe these are typos?

8 years agoRollup merge of #34750 - GuillaumeGomez:error_doc, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:24 +0000 (12:08 +0200)]
Rollup merge of #34750 - GuillaumeGomez:error_doc, r=steveklabnik

Add examples for std::Error module

Fixes #29352.

r? @steveklabnik

8 years agoRollup merge of #34749 - GuillaumeGomez:any_doc, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:23 +0000 (12:08 +0200)]
Rollup merge of #34749 - GuillaumeGomez:any_doc, r=steveklabnik

Improve std::any module doc

Fixes #29340.

r? @steveklabnik

8 years agoRollup merge of #34742 - abhijeetbhagat:master, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:23 +0000 (12:08 +0200)]
Rollup merge of #34742 - abhijeetbhagat:master, r=steveklabnik

Update on struct expressions

Update doc for struct expressions (#32769)

8 years agoRollup merge of #34740 - GuillaumeGomez:boxed_doc, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:23 +0000 (12:08 +0200)]
Rollup merge of #34740 - GuillaumeGomez:boxed_doc, r=steveklabnik

Improve boxed docs

Fixes #29343.

r? @steveklabnik

8 years agoRollup merge of #34737 - frewsxcv:libstd-process-child, r=GuillaumeGomez
Guillaume Gomez [Tue, 12 Jul 2016 10:08:23 +0000 (12:08 +0200)]
Rollup merge of #34737 - frewsxcv:libstd-process-child, r=GuillaumeGomez

Various `std::process` doc improvements.

None

8 years agoRollup merge of #34736 - GuillaumeGomez:cells_doc, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:22 +0000 (12:08 +0200)]
Rollup merge of #34736 - GuillaumeGomez:cells_doc, r=steveklabnik

Add missing examples for std::cell types

Fixes #29344.

r? @steveklabnik

8 years agoAuto merge of #34755 - jonas-schievink:minor-differences, r=eddyb
bors [Tue, 12 Jul 2016 08:06:34 +0000 (01:06 -0700)]
Auto merge of #34755 - jonas-schievink:minor-differences, r=eddyb

Move variant_size_differences out of trans

Also enhances the error message a bit, fixes #30505 on the way, and adds
a test (which was missing).

Closes #34018

8 years agoAuto merge of #34637 - GuillaumeGomez:syntax_codes, r=jonathandturner
bors [Tue, 12 Jul 2016 05:09:44 +0000 (22:09 -0700)]
Auto merge of #34637 - GuillaumeGomez:syntax_codes, r=jonathandturner

Syntax codes

r? @jonathandturner

cc @steveklabnik

This is a first big shot. I'll do the second one later in the week once this one is merged.

8 years agostd: clear errno before readdir, then check it (solaris)
Josh Stone [Tue, 12 Jul 2016 04:43:53 +0000 (21:43 -0700)]
std: clear errno before readdir, then check it (solaris)

A `NULL` from `readdir` could be the end of stream or an error.  The
only way to know is to check `errno`, so it must be set to a known value
first, like a 0 that POSIX will never use.

This patch adds `set_errno`, uses it to clear the value before calling
`readdir`, then checks it again after to see the reason for a `NULL`.

8 years agolibc: fast-forward for solaris `RTLD_DEFAULT`
Josh Stone [Tue, 12 Jul 2016 04:43:31 +0000 (21:43 -0700)]
libc: fast-forward for solaris `RTLD_DEFAULT`

8 years agostd: Fix IPV6 imports for solaris
Josh Stone [Tue, 12 Jul 2016 04:35:54 +0000 (21:35 -0700)]
std: Fix IPV6 imports for solaris

Like BSDs, Solaris maps `IPV6_ADD_MEMBERSHIP` and `IPV6_DROP_MEMBERSHIP`
from `IPV6_JOIN_GROUP` and `IPV6_LEAVE_GROUP` respectively.

8 years agostd: Fix `Thread::set_name()` for newlib and solaris
Josh Stone [Tue, 12 Jul 2016 04:35:47 +0000 (21:35 -0700)]
std: Fix `Thread::set_name()` for newlib and solaris

The `use ffi::CStr` in `unix/thread.rs` was previously guarded, but now
all platforms need it for `Thread::set_name()`.  Newlib and Solaris do
nothing here, as they have no way to set a thread name, but they still
define the same method signature.

8 years agoFix fallout.
Jeffrey Seyfried [Sat, 2 Jul 2016 15:49:50 +0000 (15:49 +0000)]
Fix fallout.

8 years agoParse macro-expanded statements like ordinary statements.
Jeffrey Seyfried [Sat, 2 Jul 2016 09:32:23 +0000 (09:32 +0000)]
Parse macro-expanded statements like ordinary statements.

8 years agoClean up statement parsing without changing the semantics of `parse_stmt`.
Jeffrey Seyfried [Sat, 2 Jul 2016 09:01:21 +0000 (09:01 +0000)]
Clean up statement parsing without changing the semantics of `parse_stmt`.

8 years agoMark Ipv4Addr is_unspecified as stable and provide reference.
Ben Stern [Sat, 9 Jul 2016 17:45:38 +0000 (13:45 -0400)]
Mark Ipv4Addr is_unspecified as stable and provide reference.

8 years agoAuto merge of #33971 - bltavares:28322/default-channel-to-stable-on-tarball, r=brson
bors [Tue, 12 Jul 2016 00:27:31 +0000 (17:27 -0700)]
Auto merge of #33971 - bltavares:28322/default-channel-to-stable-on-tarball, r=brson

Use --release-channel=stable by default on releases

> Release tarballs should be compilable with just basic ./configure ;
> make ; sudo make install without having to pass special flags to
> configure. This is the case of the --release-channel option, that must
> be changed in the releases.

This commit detects the presence of .git, as it happens on other parts
of `configure` to assume it is a tarball. Then it changes the default
value stored, before parsing the arguments, while still allowing it to
be overriden before any action verifying the flag is done.

Closes #28322

8 years agoFactor the `RefCell` out of the `Interner`.
Jeffrey Seyfried [Mon, 11 Jul 2016 20:00:07 +0000 (20:00 +0000)]
Factor the `RefCell` out of the `Interner`.

8 years agoRefactor `get_ident_interner` -> `with_ident_interner`.
Jeffrey Seyfried [Mon, 11 Jul 2016 19:33:40 +0000 (19:33 +0000)]
Refactor `get_ident_interner` -> `with_ident_interner`.

8 years agoAvoid passing around the thread-local interner in `librustc_metadata`.
Jeffrey Seyfried [Mon, 11 Jul 2016 09:42:31 +0000 (09:42 +0000)]
Avoid passing around the thread-local interner in `librustc_metadata`.

8 years agoRemove `Interner<T>` and rename `StrInterner` to `Interner`.
Jeffrey Seyfried [Mon, 11 Jul 2016 08:00:48 +0000 (08:00 +0000)]
Remove `Interner<T>` and rename `StrInterner` to `Interner`.

8 years agoEncapsulate `RcStr` in `syntax::util::interner`.
Jeffrey Seyfried [Mon, 11 Jul 2016 07:55:54 +0000 (07:55 +0000)]
Encapsulate `RcStr` in `syntax::util::interner`.

8 years agoRemove unused field `interner` from the parser.
Jeffrey Seyfried [Mon, 11 Jul 2016 09:02:16 +0000 (09:02 +0000)]
Remove unused field `interner` from the parser.

8 years agoFixed some typos
David [Mon, 11 Jul 2016 21:43:56 +0000 (14:43 -0700)]
Fixed some typos

8 years agoMove E0533 to E0558 (because of external change)
Guillaume Gomez [Mon, 11 Jul 2016 21:27:27 +0000 (23:27 +0200)]
Move E0533 to E0558 (because of external change)

8 years agoFix typos
ggomez [Mon, 4 Jul 2016 12:20:45 +0000 (14:20 +0200)]
Fix typos

8 years agoUpdate make tidy
Guillaume Gomez [Sun, 3 Jul 2016 22:16:53 +0000 (00:16 +0200)]
Update make tidy

8 years agoAdd E0537 error explanation
Guillaume Gomez [Sun, 3 Jul 2016 14:58:43 +0000 (16:58 +0200)]
Add E0537 error explanation

8 years agoAdd E0536 error explanation
Guillaume Gomez [Sun, 3 Jul 2016 14:53:17 +0000 (16:53 +0200)]
Add E0536 error explanation

8 years agoAdd E0535 error explanation
Guillaume Gomez [Sun, 3 Jul 2016 14:47:30 +0000 (16:47 +0200)]
Add E0535 error explanation

8 years agoAdd E0534 error explanation
Guillaume Gomez [Sun, 3 Jul 2016 14:34:47 +0000 (16:34 +0200)]
Add E0534 error explanation

8 years agoAdd E0533 error explanation
Guillaume Gomez [Sun, 3 Jul 2016 14:24:19 +0000 (16:24 +0200)]
Add E0533 error explanation

8 years agoAuto merge of #34686 - alexcrichton:new-stage, r=luqmana
bors [Mon, 11 Jul 2016 18:29:52 +0000 (11:29 -0700)]
Auto merge of #34686 - alexcrichton:new-stage, r=luqmana

rustc: Update stage0 to beta-2016-07-06

Hot off the presses, let's update our stage0 compiler!

8 years ago`std::process` doc improvements.
Corey Farwell [Sat, 9 Jul 2016 15:47:12 +0000 (11:47 -0400)]
`std::process` doc improvements.

* Link to `process::Command` from `process::Child`.
* Move out inline Markdown link in doc comment.
* Link to `process::Child::wait` from `process::Child`.
* Link to `process::Child` from `process::ChildStdin`.
* Link to `process::Child` from `process::ChildStdout`.
* Link to `process::Child` from `process::ChildStderr`.

8 years agoImprove boxed docs
Guillaume Gomez [Sat, 9 Jul 2016 17:57:08 +0000 (19:57 +0200)]
Improve boxed docs

8 years agoAdd missing examples for std::cell types
Guillaume Gomez [Sat, 9 Jul 2016 13:01:15 +0000 (15:01 +0200)]
Add missing examples for std::cell types

8 years agoRegister reads on the corrent HIR item
Jonas Schievink [Mon, 11 Jul 2016 15:11:51 +0000 (17:11 +0200)]
Register reads on the corrent HIR item

8 years agoSet unwind_safe_lock_refs stability to 1.12.0.
Aaron Gallagher [Mon, 11 Jul 2016 14:34:20 +0000 (07:34 -0700)]
Set unwind_safe_lock_refs stability to 1.12.0.

This is the first (and presumably only) use of this feature.

8 years agoAuto merge of #34725 - GuillaumeGomez:doc_slice, r=steveklabnik
bors [Mon, 11 Jul 2016 14:13:50 +0000 (07:13 -0700)]
Auto merge of #34725 - GuillaumeGomez:doc_slice, r=steveklabnik

Improve slice docs

Fixes  #29337.

r? @steveklabnik

8 years agoDon't register reads for external items
Jonas Schievink [Sun, 10 Jul 2016 23:46:56 +0000 (01:46 +0200)]
Don't register reads for external items

Presumably, this ICEs when translating an inlined item from another
crate. There shouldn't be a need to track dependencies in that case.

8 years agoCalculate the 2 largest variants using iterators
Jonas Schievink [Sun, 10 Jul 2016 23:43:55 +0000 (01:43 +0200)]
Calculate the 2 largest variants using iterators

No need to store all sizes in a vector

8 years agoGet rid of `node_levels` and `node_lint_levels`
Jonas Schievink [Sun, 10 Jul 2016 23:21:12 +0000 (01:21 +0200)]
Get rid of `node_levels` and `node_lint_levels`

8 years agoDerive Debug on FileType.
Martin Pool [Sun, 10 Jul 2016 22:37:41 +0000 (15:37 -0700)]
Derive Debug on FileType.

Partially fixes #32054

8 years agoMutex and RwLock need RefUnwindSafe too.
Aaron Gallagher [Sat, 9 Jul 2016 05:48:04 +0000 (22:48 -0700)]
Mutex and RwLock need RefUnwindSafe too.

8 years agoAdd examples for std::Error module
Guillaume Gomez [Sun, 10 Jul 2016 14:02:26 +0000 (16:02 +0200)]
Add examples for std::Error module

8 years agoMove variant_size_differences out of trans
Jonas Schievink [Thu, 2 Jun 2016 21:43:16 +0000 (23:43 +0200)]
Move variant_size_differences out of trans

Also enhances the error message a bit, fixes #30505 on the way, and adds
a test (which was missing).

Closes #34018

8 years agoAuto merge of #34753 - sfackler:demangle-curly-braces, r=alexcrichton
bors [Sun, 10 Jul 2016 19:30:00 +0000 (12:30 -0700)]
Auto merge of #34753 - sfackler:demangle-curly-braces, r=alexcrichton

Demangle curly braces

They show up in things like
fn(&std..panic..PanicInfo<'_>) $u7b$hook$u7d$::fn_pointer_shim.8352::h01f889b2277c719d

r? @alexcrichton

8 years agoImprove std::any module doc
Guillaume Gomez [Sun, 10 Jul 2016 13:09:55 +0000 (15:09 +0200)]
Improve std::any module doc

8 years agoDemangle curly braces
Steven Fackler [Sun, 10 Jul 2016 17:04:20 +0000 (10:04 -0700)]
Demangle curly braces

They show up in things like
fn(&std..panic..PanicInfo<'_>) $u7b$hook$u7d$::fn_pointer_shim.8352::h01f889b2277c719d

8 years agoAuto merge of #34657 - oli-obk:no_needless_const_eval, r=eddyb
bors [Sun, 10 Jul 2016 13:43:47 +0000 (06:43 -0700)]
Auto merge of #34657 - oli-obk:no_needless_const_eval, r=eddyb

don't const eval constants during MIR creation

this didn't work very well anyway, because const_eval can't eval all kinds of constants.

8 years agoAuto merge of #34731 - GGist:fix_sync_try_recv, r=alexcrichton
bors [Sun, 10 Jul 2016 07:22:33 +0000 (00:22 -0700)]
Auto merge of #34731 - GGist:fix_sync_try_recv, r=alexcrichton

Check for data in Receiver::try_recv before reporting disconnect

Fixes #34711

r? @alexcrichton

8 years agoAuto merge of #34745 - alexandermerritt:slice-doc, r=brson
bors [Sun, 10 Jul 2016 04:16:20 +0000 (21:16 -0700)]
Auto merge of #34745 - alexandermerritt:slice-doc, r=brson

make docs for clone_from_slice consistent with copy_from_slice

What 'this slice' refers to is not intuitive, given this method can appear in other places, e.g. in docs for Vec.

8 years agomake clone_from_slice consistent with copy_from_slice
Alexander Merritt [Sun, 10 Jul 2016 01:43:47 +0000 (21:43 -0400)]
make clone_from_slice consistent with copy_from_slice

What 'this slice' refers to is not intuitive (we're in the docs for Vec).

8 years agoAuto merge of #34723 - GuillaumeGomez:slice_doc, r=apasel422
bors [Sun, 10 Jul 2016 01:16:48 +0000 (18:16 -0700)]
Auto merge of #34723 - GuillaumeGomez:slice_doc, r=apasel422

Remove useless doc comment for slice

r? @steveklabnik

This doc comment isn't useful so I removed it. It also "fixes" the weird rustdoc output.

Before:

![screenshot from 2016-07-08 02-04-59](https://cloud.githubusercontent.com/assets/3050060/16688164/fbb321d6-451c-11e6-8d98-53346bc6eb1e.png)

After:

![screenshot from 2016-07-08 02-05-31](https://cloud.githubusercontent.com/assets/3050060/16688166/00b174e4-451d-11e6-83dd-93ab2509f647.png)

8 years agoAuto merge of #34365 - petrochenkov:deferr, r=eddyb
bors [Sat, 9 Jul 2016 22:16:21 +0000 (15:16 -0700)]
Auto merge of #34365 - petrochenkov:deferr, r=eddyb

Some more pattern cleanup and bugfixing

The next part of https://github.com/rust-lang/rust/pull/34095

The most significant fixed mistake is definitions for partially resolved associated types not being updated after full resolution.
```
fn f<T: Fn()>(arg: T::Output) { .... } // <- the definition of T::Output was not updated in def_map
```
For this reason unstable associated types of stable traits, like `FnOnce::Output`, could be used in stable code when written in unqualified form. Now they are properly checked, this is a **[breaking-change]** (pretty minor one, but a crater run would be nice). The fix is not to use unstable library features in stable code, alternatively `FnOnce::Output` can be stabilized.

Besides that, paths in struct patterns and expressions `S::A { .. }` are now fully resolved as associated types. Such types cannot be identified as structs at the moment, i.e. the change doesn't make previously invalid code valid, but it improves error diagnostics.

Other changes: `Def::Err` is supported better (less chances for ICEs for erroneous code), some incorrect error messages are corrected, some duplicated error messages are not reported, ADT definitions are now available through constructor IDs, everything else is cleanup and code audit.

Fixes https://github.com/rust-lang/rust/issues/34209
Closes https://github.com/rust-lang/rust/issues/22933 (adds tests)

r? @eddyb

8 years agoUpdate on struct expressions (check #32769)
abhi [Sat, 9 Jul 2016 20:40:57 +0000 (02:10 +0530)]
Update on struct expressions (check #32769)

8 years agoAuto merge of #34717 - frewsxcv:sink, r=apasel422
bors [Sat, 9 Jul 2016 19:16:57 +0000 (12:16 -0700)]
Auto merge of #34717 - frewsxcv:sink, r=apasel422

Remove unnecessarily mutable reference in doc example.

None

8 years agoAuto merge of #34728 - michaelwoerister:issue34569, r=luqmana
bors [Sat, 9 Jul 2016 16:17:35 +0000 (09:17 -0700)]
Auto merge of #34728 - michaelwoerister:issue34569, r=luqmana

trans: Make sure that closures only get translated once.

Fixes #34569.

8 years agotrans: Make sure that closures only get translated once.
Michael Woerister [Sat, 9 Jul 2016 00:24:46 +0000 (20:24 -0400)]
trans: Make sure that closures only get translated once.

8 years agoAuto merge of #34709 - GuillaumeGomez:primitives, r=steveklabnik
bors [Sat, 9 Jul 2016 13:18:55 +0000 (06:18 -0700)]
Auto merge of #34709 - GuillaumeGomez:primitives, r=steveklabnik

Improve primitive integers documentation

Fixes #29335.

r? @steveklabnik

8 years agoImprove slice docs
Guillaume Gomez [Fri, 8 Jul 2016 15:21:16 +0000 (17:21 +0200)]
Improve slice docs

8 years agoAuto merge of #33987 - crlf0710:patch-1, r=steveklabnik
bors [Sat, 9 Jul 2016 09:43:56 +0000 (02:43 -0700)]
Auto merge of #33987 - crlf0710:patch-1, r=steveklabnik

doc: Correct char::escape_unicode documentation.

A quick fix for documentation.

8 years agoAuto merge of #34719 - glandium:issue34674, r=alexcrichton
bors [Sat, 9 Jul 2016 06:23:22 +0000 (23:23 -0700)]
Auto merge of #34719 - glandium:issue34674, r=alexcrichton

Update jemalloc to include a fix for startup issues on OSX 10.12

This fixes jemalloc/jemalloc#140 in the version used by the rust compiler.

Fixes #34674

8 years agoCheck for data in Receiver::try_recv before reporting disconnect
Andrew [Sat, 9 Jul 2016 02:05:10 +0000 (19:05 -0700)]
Check for data in Receiver::try_recv before reporting disconnect

8 years agoAuto merge of #34700 - inejge:ai-hints, r=alexcrichton
bors [Sat, 9 Jul 2016 02:07:45 +0000 (19:07 -0700)]
Auto merge of #34700 - inejge:ai-hints, r=alexcrichton

Use hints with getaddrinfo() in std::net::lookup_host()

As noted in #24250, `std::net::lookup_host()` repeats each IPv[46] address in the result set. The number of repetitions is OS-dependent; e.g., Linux and FreeBSD give three copies, OpenBSD gives two. Filtering the duplicates can be done by the user if `lookup_host()` is used explicitly, but not with functions like `TcpStream::connect()`. What happens with the latter is that any unsuccessful connection attempt will be repeated as many times as there are duplicates of the address.

The program:

```rust
use std::net::TcpStream;

fn main() {
    let _stream = TcpStream::connect("localhost:4444").unwrap();
}
```

results in the following capture:

[capture-before.txt](https://github.com/rust-lang/rust/files/352004/capture-before.txt)

assuming that "localhost" resolves both to ::1 and 127.0.0.1, and that the listening program opens just an IPv4 socket (e.g., `nc -l 127.0.0.1 4444`.) The reason for this behavior is explained in [this comment](https://github.com/rust-lang/rust/issues/24250#issuecomment-92240152): `getaddrinfo()` is not constrained.

Various OSS projects (I checked out Postfix, OpenLDAP, Apache HTTPD and BIND) which use `getaddrinfo()` generally constrain the result set by using a non-NULL `hints` parameter and setting at least `ai_socktype` to `SOCK_STREAM`. `SOCK_DGRAM` would also work. Other parameters are unnecessary for pure name resolution.

The patch in this PR initializes a `hints` struct and passes it to `getaddrinfo()`, which eliminates the duplicates. The same test program as above with this change produces:

[capture-after.txt](https://github.com/rust-lang/rust/files/352042/capture-after.txt)

All `libstd` tests pass with this patch.

8 years agoAuto merge of #34690 - alexcrichton:clarify-vcvars, r=brson
bors [Fri, 8 Jul 2016 22:00:09 +0000 (15:00 -0700)]
Auto merge of #34690 - alexcrichton:clarify-vcvars, r=brson

Clarify rustbuild + msvc + vcvars in README

The invocation of vcvars is only needed for versions of Visual Studio that
rustbuild or cmake doesn't understand, but if older versions are installed then
there's no need to call vcvars.

Closes #34576

8 years agoImprove primitive integers documentation
Guillaume Gomez [Thu, 7 Jul 2016 21:02:10 +0000 (23:02 +0200)]
Improve primitive integers documentation

8 years agoAuto merge of #33890 - michaelwoerister:collector-driven-trans, r=eddyb
bors [Fri, 8 Jul 2016 15:34:36 +0000 (08:34 -0700)]
Auto merge of #33890 - michaelwoerister:collector-driven-trans, r=eddyb

Drive trans from the output of the translation item collector

This PR changes the way how translation works above the item level. Instead of walking the HIR and calling `trans_item()` on everything encountered (while instantiating monomorphizations on-demand), we now just process the list of translation items generated by the `trans::collector`. Using the collector has the benefit of being able to know the exact set of monomorphizations and symbols before actually running translation, something that is crucial for incremental compilation (but also has [other benefits](https://github.com/rust-lang/rust/pull/33602)).

The collector has existed for quite a while now, but so far it's output was only used for running some auto-tests. With this PR it becomes the only source of truth about what gets translated.

One modification we had to make, compared to the initial approach, is that closures are not represented as their own `TransItems`. Doing so, while still supporting non-MIR-based translation, would have been prohibitively complex, and not worth the trouble since legacy-trans will disappear sooner or later. Once there is solely MIR-trans, it would be a good idea to make closures `TransItems` again.

This PR removes the most obvious functions and tables that are not needed anymore, but there's definitely still more cleanup possible later on (e.g. `monomorphize::monomorphic_fn()` does very little at this point). Since there are already more than 10 commits in here, doing this in a separate PR seems to be a better idea.

These changes definitely warrant a crater run.

Thanks @Aatch, for taking on one of the more tedious tasks during the dev-sprint!
Thanks @eddyb, for doing some nice refactorings to symbol name generation and making sure these landed so I could use them!

cc @rust-lang/compiler
cc @rust-lang/tools

8 years agotrans: Adjust linkage assignment so that we don't need weak linkage.
Michael Woerister [Fri, 10 Jun 2016 23:06:21 +0000 (19:06 -0400)]
trans: Adjust linkage assignment so that we don't need weak linkage.

8 years agoUpdate LLVM.
Michael Woerister [Wed, 22 Jun 2016 15:59:34 +0000 (11:59 -0400)]
Update LLVM.