Commit Graph

54715 Commits

Author SHA1 Message Date
petrochenkov
d27e55c5d8 Stabilize FnOnce::Output + Fix rebase 2016-07-08 13:35:17 +03:00
Vadim Petrochenkov
390b639e59 Move some common code into check_struct_path 2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
2859f8bf39 Add tests + Fix rustdoc regression + Fix rebase 2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
9c05fb29d2 Merge PatKind::QPath into PatKind::Path in HIR 2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
a397b60ebb 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
2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
49ea3d48a2 Remove unnecessary accessor function VariantDefData::kind 2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
2cdd9f1c97 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
2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
eb32440d45 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.
2016-07-08 12:42:57 +03:00
Vadim Petrochenkov
4d4c7be19e Better support for associated types in struct patterns 2016-07-08 12:36:45 +03:00
Vadim Petrochenkov
ba419a78f3 Cleanup of some pattern related code 2016-07-08 12:36:45 +03:00
Vadim Petrochenkov
d3c94b25cb Don't generate Def::Err if it's not stored in def_map immediately 2016-07-08 12:36:45 +03:00
Manish Goregaokar
5389ccc0c1 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.
2016-07-08 14:47:00 +05:30
Manish Goregaokar
88350bdf52 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
2016-07-08 14:47:00 +05:30
Manish Goregaokar
793db8fa04 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
2016-07-08 14:46:59 +05:30
Manish Goregaokar
4ee6a666e4 Rollup merge of #34688 - GuillaumeGomez:double_ended_iterator, r=steveklabnik
Improve DoubleEndedIterator examples

Fixes #34065.

r? @steveklabnik
2016-07-08 14:46:59 +05:30
Manish Goregaokar
f4ae98ab8c Rollup merge of #34659 - GuillaumeGomez:path_file_name, r=steveklabnik
Fix `std::path::Path::file_name()` doc

Fixes #34632

r? @steveklabnik
2016-07-08 14:46:59 +05:30
Manish Goregaokar
75276f36fe Rollup merge of #34612 - frewsxcv:io-error-from_raw_os_error, r=steveklabnik
Add doc examples for `io::Error::from_raw_os_error`.

None
2016-07-08 14:46:58 +05:30
Manish Goregaokar
1b06c00ddd 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
2016-07-08 14:46:58 +05:30
Manish Goregaokar
8242a30b9e 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.
2016-07-08 13:14:19 +05:30
bors
3fa1cdf23c 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
2016-07-08 00:41:35 -07:00
Mike Hommey
3fd0387eb2 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
2016-07-08 14:15:04 +09:00
bors
9b4e2a5b2d 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.
2016-07-07 21:48:04 -07:00
Corey Farwell
fc2123a69a Remove unnecessarily mutable reference in doc example. 2016-07-07 22:58:47 -04:00
bors
182bcdbea1 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
2016-07-07 17:58:31 -07:00
Guillaume Gomez
a5be0d21c6 Remove useless doc comment for slice 2016-07-08 02:05:39 +02:00
Brian Anderson
2ad5ed07f8 Merge pull request #34712 from rust-lang/steveklabnik-patch-1
Fix release notes for 1.10
2016-07-08 00:12:25 +01:00
Steve Klabnik
d04e34b7d4 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
2016-07-07 18:17:25 -04:00
cgswords
754759688b Preliminary implementation for TokenStreams and TokenSlices, including unit tests and associated operations. 2016-07-07 11:44:04 -07:00
Alex Crichton
b67f23c847 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
2016-07-07 09:34:46 -07:00
Sam Payson
46e7c9ec74 Changed wording per aturon's comments. 2016-07-07 08:40:15 -07:00
bors
4cf97fe57e 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/`.
2016-07-07 08:39:36 -07:00
bors
9c1783a3a0 Auto merge of #34658 - luqmana:34592-nested_returns, r=eddyb
Just pass in NodeId to FunctionContext::new instead of looking it up.

Fixes #34592.
2016-07-07 05:46:57 -07:00
Ivan Nejgebauer
0314d179aa 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.
2016-07-07 12:03:31 +02:00
bors
a7f5d8a2ef Auto merge of #34672 - luqmana:27021-reassign-match-body, r=eddyb
Make match discriminant reassignment check more accurate.

Fixes #27021.
2016-07-07 02:42:45 -07:00
Phlogistic Fugu
1f99c29c77 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 .\
2016-07-07 01:19:05 -07:00
bors
b4e11c2af8 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
2016-07-06 23:18:23 -07:00
bors
de78655bca 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
2016-07-06 20:04:11 -07:00
吴冉波
d30662f3e7 doc:remove useless conditional compilation feature 2016-07-07 10:34:33 +08:00
bors
5c674a1147 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
2016-07-06 17:02:41 -07:00
Corey Farwell
98e3120ad2 Add doc examples for io::Error::from_raw_os_error. 2016-07-06 19:39:21 -04:00
Steve Klabnik
2262d7383a 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)
2016-07-06 19:13:08 -04:00
Steve Klabnik
8c3efd20e4 Rollup merge of #34667 - KaivoAnastetiks:fix/crate-documentation, r=Manishearth
Add a section about crate documentation.

Fixes #34329
?r @steveklabnik
2016-07-06 19:13:08 -04:00
Steve Klabnik
f8905e1e01 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!
2016-07-06 19:13:08 -04:00
Steve Klabnik
26821a6f88 Rollup merge of #34636 - tshepang:shorten, r=GuillaumeGomez
doc: fix and shorten comment
2016-07-06 19:13:08 -04:00
Steve Klabnik
1b7bebf84d Rollup merge of #34626 - sylvestre:master, r=Manishearth
Fix typos
2016-07-06 19:13:07 -04:00
Steve Klabnik
80e5672f7e 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.

😀
2016-07-06 19:13:07 -04:00
Steve Klabnik
04130595cc Rollup merge of #34621 - KaivoAnastetiks:fix/#33924, r=steveklabnik
Clarifies the meaning of the external mutability.
2016-07-06 19:13:07 -04:00
Steve Klabnik
2acce41d18 Rollup merge of #34619 - frewsxcv:patch-30, r=apasel422
Fix broken markdown link in README.
2016-07-06 19:13:07 -04:00
Steve Klabnik
05806aed66 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
2016-07-06 19:13:07 -04:00
Steve Klabnik
92c0ab01b1 Rollup merge of #34558 - GlenDC:master, r=alexcrichton
rustbuild: propagate bootstrap.py '--help' flag

Fixes #34534.
r? @alexcrichton
2016-07-06 19:13:06 -04:00