]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 #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 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 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.

8 years agotrans: Remove tracking of translation item state.
Michael Woerister [Thu, 16 Jun 2016 22:56:14 +0000 (18:56 -0400)]
trans: Remove tracking of translation item state.

The data tracked here was meant to compare the output of the
translation item collector to the set of translation items found
by the on-demand translator.

8 years agotrans: Set COMDAT section for weak symbols so that Windows can handle them.
Michael Woerister [Thu, 9 Jun 2016 17:39:21 +0000 (13:39 -0400)]
trans: Set COMDAT section for weak symbols so that Windows can handle them.

8 years agotrans: Enable falling back to on-demand instantiation for drop-glue and monomorphizat...
Michael Woerister [Wed, 8 Jun 2016 01:14:51 +0000 (21:14 -0400)]
trans: Enable falling back to on-demand instantiation for drop-glue and monomorphizations.

See issue #34151 for more information.

8 years agotrans: Add missing normalize_associated_type() call to callee::get_fn().
Michael Woerister [Wed, 8 Jun 2016 01:12:40 +0000 (21:12 -0400)]
trans: Add missing normalize_associated_type() call to callee::get_fn().

8 years agohir-trans: Don't generate code for unreachable operands in short-circuiting logical...
Michael Woerister [Fri, 3 Jun 2016 17:24:46 +0000 (13:24 -0400)]
hir-trans: Don't generate code for unreachable operands in short-circuiting logical operations.

8 years agotrans::collector: Also consider initializers of const items.
Michael Woerister [Thu, 2 Jun 2016 21:25:03 +0000 (17:25 -0400)]
trans::collector: Also consider initializers of const items.

8 years agocollector-driven-trans: Take care of nits.
Michael Woerister [Thu, 2 Jun 2016 16:28:29 +0000 (12:28 -0400)]
collector-driven-trans: Take care of nits.

8 years agoPacify make tidy.
Michael Woerister [Thu, 26 May 2016 18:21:08 +0000 (14:21 -0400)]
Pacify make tidy.

8 years agoFix codegen tests by make sure items are translated in AST order.
Michael Woerister [Thu, 26 May 2016 17:04:35 +0000 (13:04 -0400)]
Fix codegen tests by make sure items are translated in AST order.

8 years agoClean up trans::trans_crate() after making things collector driven.
Michael Woerister [Thu, 26 May 2016 16:18:39 +0000 (12:18 -0400)]
Clean up trans::trans_crate() after making things collector driven.

8 years agoMake item translation order deterministic by sorting by symbol name.
Michael Woerister [Thu, 26 May 2016 15:43:53 +0000 (11:43 -0400)]
Make item translation order deterministic by sorting by symbol name.

8 years agoBuild SymbolMap for symbol name conflict checking and caching.
Michael Woerister [Thu, 26 May 2016 12:59:58 +0000 (08:59 -0400)]
Build SymbolMap for symbol name conflict checking and caching.

8 years agoMake drop-glue translation collector-driven.
Michael Woerister [Tue, 10 May 2016 03:56:49 +0000 (23:56 -0400)]
Make drop-glue translation collector-driven.

8 years agoImprove linkage assignment in trans::partitioning.
Michael Woerister [Thu, 19 May 2016 16:35:36 +0000 (12:35 -0400)]
Improve linkage assignment in trans::partitioning.

8 years agoAdapt backend to trans::partitioning dictating the codegen-unit setup.
Michael Woerister [Sat, 14 May 2016 00:48:32 +0000 (20:48 -0400)]
Adapt backend to trans::partitioning dictating the codegen-unit setup.

8 years agoIgnore closure-related translation item collection tests.
Michael Woerister [Sat, 14 May 2016 00:47:32 +0000 (20:47 -0400)]
Ignore closure-related translation item collection tests.

8 years agotrans: Get rid of the last potential on-demand creation of non-closure functions.
Michael Woerister [Fri, 13 May 2016 22:14:47 +0000 (18:14 -0400)]
trans: Get rid of the last potential on-demand creation of non-closure functions.

8 years agoDrive function item translation from collector
James Miller [Fri, 13 May 2016 17:41:42 +0000 (05:41 +1200)]
Drive function item translation from collector

Functions and method are declared ahead-of-time, including generic ones.

Closures are not considered trans items anymore, instead they are
translated on demands.

8 years agotrans: Make translation of statics collector-driven.
Michael Woerister [Sat, 7 May 2016 00:02:09 +0000 (20:02 -0400)]
trans: Make translation of statics collector-driven.

8 years agoAuto merge of #34720 - Manishearth:rollup, r=Manishearth
bors [Fri, 8 Jul 2016 12:24:43 +0000 (05:24 -0700)]
Auto merge of #34720 - Manishearth:rollup, r=Manishearth

Rollup of 9 pull requests

- Successful merges: #34097, #34456, #34610, #34612, #34659, #34688, #34691, #34699, #34700
- Failed merges:

8 years agoAdd test for std::net::lookup_host() duplicates
Ivan Nejgebauer [Fri, 8 Jul 2016 11:48:46 +0000 (13:48 +0200)]
Add test for std::net::lookup_host() duplicates

8 years agoStabilize `FnOnce::Output` + Fix rebase
petrochenkov [Fri, 8 Jul 2016 10:35:17 +0000 (13:35 +0300)]
Stabilize `FnOnce::Output` + Fix rebase

8 years agoMove some common code into check_struct_path
Vadim Petrochenkov [Sat, 11 Jun 2016 15:47:47 +0000 (18:47 +0300)]
Move some common code into check_struct_path

8 years agoAdd tests + Fix rustdoc regression + Fix rebase
Vadim Petrochenkov [Sat, 11 Jun 2016 15:47:47 +0000 (18:47 +0300)]
Add tests + Fix rustdoc regression + Fix rebase

8 years agoMerge PatKind::QPath into PatKind::Path in HIR
Vadim Petrochenkov [Sat, 11 Jun 2016 15:47:47 +0000 (18:47 +0300)]
Merge PatKind::QPath into PatKind::Path in HIR

8 years agoResolve partially resolved paths in struct patterns/expressions
Vadim Petrochenkov [Sat, 11 Jun 2016 15:47:47 +0000 (18:47 +0300)]
Resolve partially resolved paths in struct patterns/expressions

Treat Def::Err correctly in struct patterns
Make instantiate_path and instantiate_type a bit closer to each other

8 years agoRemove unnecessary accessor function VariantDefData::kind
Vadim Petrochenkov [Sat, 11 Jun 2016 15:47:47 +0000 (18:47 +0300)]
Remove unnecessary accessor function VariantDefData::kind

8 years agoRewrite check_pat_enum, split it into check_pat_tuple_struct and check_pat_path
Vadim Petrochenkov [Sat, 11 Jun 2016 15:47:47 +0000 (18:47 +0300)]
Rewrite check_pat_enum, split it into check_pat_tuple_struct and check_pat_path

Update definitions in def_map for associated types written in unqualified form (like `Self::Output`)
Cleanup finish_resolving_def_to_ty/resolve_ty_and_def_ufcs
Make VariantDef's available through constructor IDs

8 years agoDo not generate Def::Err in bindings
Vadim Petrochenkov [Sat, 11 Jun 2016 15:47:47 +0000 (18:47 +0300)]
Do not generate Def::Err in bindings

Instead of Def::Err erroneous bindings can get usual definitions that doesn't require special cases later on and have less chances to generate ICE.

8 years agoBetter support for associated types in struct patterns
Vadim Petrochenkov [Sat, 11 Jun 2016 15:47:47 +0000 (18:47 +0300)]
Better support for associated types in struct patterns

8 years agoCleanup of some pattern related code
Vadim Petrochenkov [Sat, 11 Jun 2016 15:47:47 +0000 (18:47 +0300)]
Cleanup of some pattern related code

8 years agoDon't generate Def::Err if it's not stored in def_map immediately
Vadim Petrochenkov [Fri, 10 Jun 2016 22:31:25 +0000 (01:31 +0300)]
Don't generate Def::Err if it's not stored in def_map immediately

8 years agoRollup merge of #34700 - inejge:ai-hints, r=alexcrichton
Manish Goregaokar [Fri, 8 Jul 2016 07:44:21 +0000 (13:14 +0530)]
Rollup 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 agoRollup merge of #34699 - phlogisticfugu:master, r=steveklabnik
Manish Goregaokar [Fri, 8 Jul 2016 07:44:21 +0000 (13:14 +0530)]
Rollup merge of #34699 - phlogisticfugu:master, r=steveklabnik

enhancewindows documentation in getting-started

- minor pronoun fix We -> You
- PATH troubleshooting
- dir output is vertical (but did not include timestamps)
- executables not in %PATH% require .\

r? @steveklabnik

8 years agoRollup merge of #34691 - jseyfried:remove_erroneous_unit_struct_checks, r=nrc
Manish Goregaokar [Fri, 8 Jul 2016 07:44:20 +0000 (13:14 +0530)]
Rollup merge of #34691 - jseyfried:remove_erroneous_unit_struct_checks, r=nrc

parser: Remove outdated checks for empty braced struct expressions (`S {}`)

This is a pure refactoring.
r? @nrc

8 years agoRollup merge of #34688 - GuillaumeGomez:double_ended_iterator, r=steveklabnik
Manish Goregaokar [Fri, 8 Jul 2016 07:44:20 +0000 (13:14 +0530)]
Rollup merge of #34688 - GuillaumeGomez:double_ended_iterator, r=steveklabnik

Improve DoubleEndedIterator examples

Fixes #34065.

r? @steveklabnik

8 years agoRollup merge of #34659 - GuillaumeGomez:path_file_name, r=steveklabnik
Manish Goregaokar [Fri, 8 Jul 2016 07:44:20 +0000 (13:14 +0530)]
Rollup merge of #34659 - GuillaumeGomez:path_file_name, r=steveklabnik

Fix `std::path::Path::file_name()` doc

Fixes #34632

r? @steveklabnik

8 years agoRollup merge of #34612 - frewsxcv:io-error-from_raw_os_error, r=steveklabnik
Manish Goregaokar [Fri, 8 Jul 2016 07:44:20 +0000 (13:14 +0530)]
Rollup merge of #34612 - frewsxcv:io-error-from_raw_os_error, r=steveklabnik

Add doc examples for `io::Error::from_raw_os_error`.

None

8 years agoRollup merge of #34610 - wuranbo:patch-2, r=steveklabnik
Manish Goregaokar [Fri, 8 Jul 2016 07:44:19 +0000 (13:14 +0530)]
Rollup merge of #34610 - wuranbo:patch-2, r=steveklabnik

doc: make the conditional-compilation example work

If not, the error `does not have these features: foo` confused.
r? @steveklabnik

8 years agoRollup merge of #34097 - arbitrary-cat:master, r=steveklabnik
Manish Goregaokar [Fri, 8 Jul 2016 07:44:19 +0000 (13:14 +0530)]
Rollup merge of #34097 - arbitrary-cat:master, r=steveklabnik

Revise wording in Rc documentation.

The term "thread-local" has a widely accepted meaning which is not
the meaning it's used for here.

8 years agoAuto merge of #34679 - eddyb:mir-nested-pairs, r=dotdash
bors [Fri, 8 Jul 2016 07:41:35 +0000 (00:41 -0700)]
Auto merge of #34679 - eddyb:mir-nested-pairs, r=dotdash

Handle nested pairs in MIR trans.

Found while trying to compile the latest Servo master.

cc @shinglyu

8 years agoUpdate jemalloc to include a fix for startup issues on OSX 10.12
Mike Hommey [Fri, 8 Jul 2016 05:11:55 +0000 (14:11 +0900)]
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 agoAuto merge of #34682 - CensoredUsername:clobber-docs, r=eddyb
bors [Fri, 8 Jul 2016 04:48:04 +0000 (21:48 -0700)]
Auto merge of #34682 - CensoredUsername:clobber-docs, r=eddyb

Correct inline assembly clobber formatting.

Fixes the formatting for inline assembly clobbers used in the book.
As this causes llvm to silently ignore the clobber an error is also
added to catch cases in which the wrong formatting was used.
Additionally a test case is added to confirm that this error works.

This fixes #34458

Note: this is only one out of a few possible ways to fix the issue
depending on how the asm! macro formatting is wanted.

Additionally, it'd be nicer to have some kind of test or feedback
from llvm if the clobber constraints are valid, but I do not know
enough about llvm to say if or how this is possible.

8 years agoRemove unnecessarily mutable reference in doc example.
Corey Farwell [Fri, 8 Jul 2016 01:37:31 +0000 (21:37 -0400)]
Remove unnecessarily mutable reference in doc example.

8 years agoAuto merge of #34575 - cgswords:tstream, r=nrc
bors [Fri, 8 Jul 2016 00:58:31 +0000 (17:58 -0700)]
Auto merge of #34575 - cgswords:tstream, r=nrc

Introducing TokenStreams and TokenSlices for procedural macros

This pull request introduces TokenStreams and TokenSlices into the compiler in preparation for usage as part of RFC 1566 (procedural macros).

r? @nrc

8 years agoRemove useless doc comment for slice
Guillaume Gomez [Fri, 8 Jul 2016 00:05:39 +0000 (02:05 +0200)]
Remove useless doc comment for slice

8 years agoMerge pull request #34712 from rust-lang/steveklabnik-patch-1
Brian Anderson [Thu, 7 Jul 2016 23:12:25 +0000 (00:12 +0100)]
Merge pull request #34712 from rust-lang/steveklabnik-patch-1

Fix release notes for 1.10

8 years agoFix release notes for 1.10
Steve Klabnik [Thu, 7 Jul 2016 22:17:25 +0000 (18:17 -0400)]
Fix release notes for 1.10

Path was not actually given a default impl in #32990, even though the PR title said it did.

r? @brson

8 years agoPreliminary implementation for TokenStreams and TokenSlices, including unit tests...
cgswords [Wed, 29 Jun 2016 18:55:10 +0000 (11:55 -0700)]
Preliminary implementation for TokenStreams and TokenSlices, including unit tests and associated operations.

8 years agoClarify rustbuild + msvc + vcvars in README
Alex Crichton [Wed, 6 Jul 2016 18:35:33 +0000 (11:35 -0700)]
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 agoChanged wording per aturon's comments.
Sam Payson [Thu, 7 Jul 2016 15:40:15 +0000 (08:40 -0700)]
Changed wording per aturon's comments.

8 years agoAuto merge of #34677 - alexcrichton:no-more-build-directory, r=brson
bors [Thu, 7 Jul 2016 15:39:36 +0000 (08:39 -0700)]
Auto merge of #34677 - alexcrichton:no-more-build-directory, r=brson

rustbuild: Remove the `build` directory

The organization in rustbuild was a little odd at the moment where the `lib.rs`
was quite small but the binary `main.rs` was much larger. Unfortunately as well
there was a `build/` directory with the implementation of the build system, but
this directory was ignored by GitHub on the file-search prompt which was a
little annoying.

This commit reorganizes rustbuild slightly where all the library files (the
build system) is located directly inside of `src/bootstrap` and all the binaries
now live in `src/bootstrap/bin` (they're small). Hopefully this should allow
GitHub to index and allow navigating all the files while maintaining a
relatively similar layout to the other libraries in `src/`.

8 years agoAuto merge of #34658 - luqmana:34592-nested_returns, r=eddyb
bors [Thu, 7 Jul 2016 12:46:57 +0000 (05:46 -0700)]
Auto merge of #34658 - luqmana:34592-nested_returns, r=eddyb

Just pass in NodeId to FunctionContext::new instead of looking it up.

Fixes #34592.

8 years agoUse hints with getaddrinfo() in std::net::lokup_host()
Ivan Nejgebauer [Thu, 7 Jul 2016 10:03:31 +0000 (12:03 +0200)]
Use hints with getaddrinfo() in std::net::lokup_host()

When resolving a hostname, pass a hints struct where ai_socktype is
set to SOCK_STREAM in order to eliminate repeated results for each
protocol family.

8 years agoAuto merge of #34672 - luqmana:27021-reassign-match-body, r=eddyb
bors [Thu, 7 Jul 2016 09:42:45 +0000 (02:42 -0700)]
Auto merge of #34672 - luqmana:27021-reassign-match-body, r=eddyb

Make match discriminant reassignment check more accurate.

Fixes #27021.

8 years agomore windows documentation in getting-started
Phlogistic Fugu [Thu, 7 Jul 2016 08:19:05 +0000 (01:19 -0700)]
more windows documentation in getting-started

- minor pronoun fix We -> You
- PATH troubleshooting
- dir output is vertical (but did not include timestamps)
- executables not in %PATH% require .\

8 years agoAuto merge of #34655 - jseyfried:improve_resolver_api, r=nrc
bors [Thu, 7 Jul 2016 06:18:23 +0000 (23:18 -0700)]
Auto merge of #34655 - jseyfried:improve_resolver_api, r=nrc

Add to `resolve`'s public API

This adds a public method `with_module_lexical_scope` to `Resolver` to allow users to resolve a path in the lexical scope of an arbitrary module.
r? @nrc

8 years agoAuto merge of #34652 - jseyfried:fix_expansion_perf, r=nrc
bors [Thu, 7 Jul 2016 03:04:11 +0000 (20:04 -0700)]
Auto merge of #34652 - jseyfried:fix_expansion_perf, r=nrc

Fix expansion performance regression

**syntax-[breaking-change] cc #31645**

This fixes #34630 by reverting commit 5bf7970 of PR #33943, which landed in #34424.

By removing the `Rc<_>` wrapping around `Delimited` and `SequenceRepetition` in `TokenTree`, 5bf7970 made cloning `TokenTree`s more expensive. While this had no measurable performance impact on the compiler's crates, it caused an order of magnitude performance regression on some macro-heavy code in the wild. I believe this is due to clones of `TokenTree`s in `macro_parser.rs` and/or `macro_rules.rs`.

r? @nrc

8 years agodoc:remove useless conditional compilation feature
吴冉波 [Thu, 7 Jul 2016 02:34:33 +0000 (10:34 +0800)]
doc:remove useless conditional compilation feature

8 years agoAuto merge of #34695 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 7 Jul 2016 00:02:41 +0000 (17:02 -0700)]
Auto merge of #34695 - steveklabnik:rollup, r=steveklabnik

Rollup of 15 pull requests

- Successful merges: #33250, #33265, #34277, #34327, #34521, #34558, #34615, #34619, #34621, #34625, #34626, #34636, #34664, #34667, #34685
- Failed merges: #33951

8 years agoAdd doc examples for `io::Error::from_raw_os_error`.
Corey Farwell [Sat, 2 Jul 2016 13:50:19 +0000 (09:50 -0400)]
Add doc examples for `io::Error::from_raw_os_error`.

8 years agoRollup merge of #34685 - GuillaumeGomez:section_header, r=steveklabnik
Steve Klabnik [Wed, 6 Jul 2016 23:13:08 +0000 (19:13 -0400)]
Rollup merge of #34685 - GuillaumeGomez:section_header, r=steveklabnik

Remove invalid CSS rule for doc titles

r? @steveklabnik

Before:

![issue](https://cloud.githubusercontent.com/assets/3050060/16625595/a2f65914-43a5-11e6-9ff2-bcdf11b68cc3.png)

After:

![fixed](https://cloud.githubusercontent.com/assets/3050060/16625602/a9b635ee-43a5-11e6-9f9d-853137eb4e6b.png)

8 years agoRollup merge of #34667 - KaivoAnastetiks:fix/crate-documentation, r=Manishearth
Steve Klabnik [Wed, 6 Jul 2016 23:13:08 +0000 (19:13 -0400)]
Rollup merge of #34667 - KaivoAnastetiks:fix/crate-documentation, r=Manishearth

Add a section about crate documentation.

Fixes #34329
?r @steveklabnik

8 years agoRollup merge of #34664 - alexcrichton:bump, r=brson
Steve Klabnik [Wed, 6 Jul 2016 23:13:08 +0000 (19:13 -0400)]
Rollup merge of #34664 - alexcrichton:bump, r=brson

Bump version to 1.12.0

Beta's now in the forge, let's start working on 1.12.0!

8 years agoRollup merge of #34636 - tshepang:shorten, r=GuillaumeGomez
Steve Klabnik [Wed, 6 Jul 2016 23:13:08 +0000 (19:13 -0400)]
Rollup merge of #34636 - tshepang:shorten, r=GuillaumeGomez

doc: fix and shorten comment

8 years agoRollup merge of #34626 - sylvestre:master, r=Manishearth
Steve Klabnik [Wed, 6 Jul 2016 23:13:07 +0000 (19:13 -0400)]
Rollup merge of #34626 - sylvestre:master, r=Manishearth

Fix typos

8 years agoRollup merge of #34625 - jaredmanning:patch-1, r=apasel422
Steve Klabnik [Wed, 6 Jul 2016 23:13:07 +0000 (19:13 -0400)]
Rollup merge of #34625 - jaredmanning:patch-1, r=apasel422

Fix spacing in for loop enumeration example

Add a space between the comma and j in (i, j) to make it look nice.

This addresses my recent issue #34624.

😀

8 years agoRollup merge of #34621 - KaivoAnastetiks:fix/#33924, r=steveklabnik
Steve Klabnik [Wed, 6 Jul 2016 23:13:07 +0000 (19:13 -0400)]
Rollup merge of #34621 - KaivoAnastetiks:fix/#33924, r=steveklabnik

Clarifies the meaning of the external mutability.

8 years agoRollup merge of #34619 - frewsxcv:patch-30, r=apasel422
Steve Klabnik [Wed, 6 Jul 2016 23:13:07 +0000 (19:13 -0400)]
Rollup merge of #34619 - frewsxcv:patch-30, r=apasel422

Fix broken markdown link in README.

8 years agoRollup merge of #34615 - rdotdk:master, r=Manishearth
Steve Klabnik [Wed, 6 Jul 2016 23:13:07 +0000 (19:13 -0400)]
Rollup merge of #34615 - rdotdk:master, r=Manishearth

update cargo doc link

updated proper link of cargo doc that contains details about list of options available in semantic versioninig for the dependencies section in Cargo.toml

8 years agoRollup merge of #34558 - GlenDC:master, r=alexcrichton
Steve Klabnik [Wed, 6 Jul 2016 23:13:06 +0000 (19:13 -0400)]
Rollup merge of #34558 - GlenDC:master, r=alexcrichton

rustbuild: propagate bootstrap.py '--help' flag

Fixes #34534.
r? @alexcrichton

8 years agoRollup merge of #34521 - llogiq:doc-fixes, r=steveklabnik
Steve Klabnik [Wed, 6 Jul 2016 23:13:06 +0000 (19:13 -0400)]
Rollup merge of #34521 - llogiq:doc-fixes, r=steveklabnik

extend+improve HIR types documentation

8 years agoRollup merge of #34327 - nrc:save-fix-tuple, r=jseyfried
Steve Klabnik [Wed, 6 Jul 2016 23:13:06 +0000 (19:13 -0400)]
Rollup merge of #34327 - nrc:save-fix-tuple, r=jseyfried

save-analysis: fix a bug with tuple sub-expressions

8 years agoRollup merge of #34277 - ollie27:docs_num, r=steveklabnik
Steve Klabnik [Wed, 6 Jul 2016 23:13:06 +0000 (19:13 -0400)]
Rollup merge of #34277 - ollie27:docs_num, r=steveklabnik

Add/improve num const docs

This adds short summaries to all num consts.

r? @steveklabnik

8 years agoRollup merge of #33265 - tshepang:peek, r=steveklabnik
Steve Klabnik [Wed, 6 Jul 2016 23:13:05 +0000 (19:13 -0400)]
Rollup merge of #33265 - tshepang:peek, r=steveklabnik

doc: some `peek` improvements

8 years agoRollup merge of #33250 - durka:patch-19, r=steveklabnik
Steve Klabnik [Wed, 6 Jul 2016 23:13:05 +0000 (19:13 -0400)]
Rollup merge of #33250 - durka:patch-19, r=steveklabnik

update documentation of tuple/unit structs

I made the "tuple structs are useless" editorializing a bit weaker and moved it to the end. Feel free to overrule me on that.

I also added an example of how to unpack a tuple struct with dot notation, because it came up on IRC.

`braced_empty_structs` is stable now, so I updated the example for unit-like structs to use that syntax. Should we show both ways?

cc @ubsan
r? @steveklabnik or @GuillaumeGomez

8 years agoAuto merge of #34689 - alexcrichton:fix-nightlies, r=alexcrichton
bors [Wed, 6 Jul 2016 21:05:35 +0000 (14:05 -0700)]
Auto merge of #34689 - alexcrichton:fix-nightlies, r=alexcrichton

First attempt to fix nightlies

This is just https://github.com/rust-lang/rust/pull/34669 but I added some comments so it can land.