Commit Graph

61539 Commits

Author SHA1 Message Date
Corey Farwell
a97aed739b Remove unnecessary logic when finding simpilar impl candidates. 2017-02-20 11:40:02 -05:00
Corey Farwell
83fe48d598 Remove else, unindent. 2017-02-20 11:40:02 -05:00
Corey Farwell
de2f7e15ba Rewrite match to use combinators. 2017-02-20 11:40:01 -05:00
Corey Farwell
7e0c3de4c4 Remove else, unindent. 2017-02-20 11:40:01 -05:00
bors
cfebdeaacc Auto merge of #39965 - ArtBears:master, r=steveklabnik
Fixed a typo in CONTRIBUTING.md

Small change to the CONTRIBUTING.md file.

r? @steveklabnik
2017-02-20 10:58:36 +00:00
bors
941d494a6a Auto merge of #39923 - mattyw:patch-1, r=steveklabnik
Variable Bindings possible nitpick

Complete drive by nitpick I'm afraid
2017-02-20 08:16:31 +00:00
bors
e06774ece3 Auto merge of #39304 - jrmuizel:drop-flags, r=steveklabnik
Remove obsolete documentation about drop-flags
2017-02-20 05:51:11 +00:00
bors
322f0d7055 Auto merge of #39966 - steveklabnik:update-mdbook, r=GuillaumeGomez
Update mdbook version

This version of mdbook includes
https://github.com/azerupi/mdBook/pull/207 , which is needed so that
we can start doing linkchecker on the various books.
2017-02-20 03:27:06 +00:00
Steve Klabnik
2795de3c07 Update dependencies
In order to update mdbook, we have to update other stuff too.
2017-02-19 19:20:57 -05:00
Steve Klabnik
7726735636 Update mdbook version
This version of mdbook includes
https://github.com/azerupi/mdBook/pull/207 , which is needed so that
we can start doing linkchecker on the various books.
2017-02-19 19:17:16 -05:00
bors
f57a027f71 Auto merge of #39955 - mp4096:master, r=GuillaumeGomez
Docs: Better explanation of return values for min, max functions for the Iterator trait

Added an explanation that `None` is returned if an iterator is empty.

Also added examples for `max` and `min`. I chose not to add examples for other functions like `max_by_key` etc. so that the examples stay concised and focused on the main functionality.
2017-02-20 00:00:53 +00:00
Glyne J. Gittens
9a6a72b818 Merge branch 'master' of https://github.com/rust-lang/rust 2017-02-19 17:32:21 -05:00
Glyne J. Gittens
b3f61ce538 Removed a typo from CONTRIBUTING.md 2017-02-19 17:30:50 -05:00
bors
0e77277950 Auto merge of #39939 - petrochenkov:regres, r=eddyb
Fix two ICEs in path resolution

Fixes https://github.com/rust-lang/rust/issues/39535
Fixes https://github.com/rust-lang/rust/issues/39559
Fixes https://github.com/rust-lang/rust/issues/39924

r? @eddyb
2017-02-19 17:52:54 +00:00
bors
0128be9ad7 Auto merge of #39871 - binarycrusader:issue-39868, r=alexcrichton
libstd needs update for pending libc change

This  updates libstd to accommodate the fixes made in https://github.com/rust-lang/libc/pull/523

Fixes #39868
2017-02-19 11:21:09 +00:00
Mikhail Pak
eee6752b97 Docs: Better explanation of return values for min, max functions
Explain that a None is returned if the iterator is empty.
2017-02-19 11:01:02 +01:00
bors
aff6161a9e Auto merge of #39912 - nikomatsakis:incr-comp-trait-select-no-vec, r=eddyb
rework `TraitSelect` to avoid a vec and just use two def-ids

r? @eddyb
2017-02-19 06:30:38 +00:00
Vadim Petrochenkov
8c7d0077ab Avoid ICE in Self::Assoc in impl headers 2017-02-19 00:34:08 +03:00
Vadim Petrochenkov
bf95c29c98 Privatize fields of PathResolution
Ensure Def::Err has depth == 0
2017-02-19 00:34:08 +03:00
bors
306035c217 Auto merge of #39933 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests

- Successful merges: #39847, #39862, #39898, #39904, #39928
- Failed merges:
2017-02-18 17:10:34 +00:00
Guillaume Gomez
98c2cf2ae5 Rollup merge of #39928 - GuillaumeGomez:env_func_urls, r=frewsxcv
Add missing urls for env functions

r? @frewsxcv
2017-02-18 18:10:15 +01:00
Guillaume Gomez
a7e2227bdd Rollup merge of #39904 - Stebalien:cleanup-string-split-off, r=frewsxcv
Fixup String::split_off documentation

1. Clarify that `String::split_off` returns one string and modifies self in-place. The documentation implied that it returns two new strings.

2. Make the documentation mirror `Vec::split_off`.
2017-02-18 18:10:14 +01:00
Guillaume Gomez
33d1346588 Rollup merge of #39898 - king6cong:logic_clean, r=alexcrichton
code order tweak
2017-02-18 18:10:13 +01:00
Guillaume Gomez
e4c285d1ac Rollup merge of #39862 - stjepang:fix-wording-localkey, r=GuillaumeGomez
Fix wording in LocalKey documentation

Fixes #39841

r? @GuillaumeGomez
2017-02-18 18:10:12 +01:00
Guillaume Gomez
e49f76f72e Rollup merge of #39847 - CBenoit:patch-1, r=frewsxcv
Correct a typo in procedural macros chapter of the Book.

A simple and short correction for procedural macros chapter of the Rust Programming Language Book.
2017-02-18 18:10:11 +01:00
Guillaume Gomez
84aca88cda Add missing urls for env functions 2017-02-18 14:44:56 +01:00
bors
8f2fc9db15 Auto merge of #39887 - nikomatsakis:issue-39292, r=arielb1
erase late bound regions in `get_vtable_methods()`

Higher-ranked object types can otherwise cause late-bound regions to
sneak into the substs, leading to the false conclusion that some method
is unreachable.

r? @arielb1, who wrote the heart of this patch anyhow

Fixes #39292
2017-02-18 12:17:06 +00:00
Matt Williams
5fa50d995b Variable Bindings possible nitpick
Complete drive by nitpick I'm afraid
2017-02-18 09:57:33 +00:00
bors
3c97cbe4c2 Auto merge of #39877 - estebank:remove-params, r=petrochenkov
Remove noop method `Substs::params()`

Re: 48b3dd11f5 & 7a8d4822d8
2017-02-18 09:50:10 +00:00
bors
9f1762a058 Auto merge of #39854 - nagisa:mir-asm-stmt, r=nikomatsakis
[MIR] Make InlineAsm a Statement

Previously InlineAsm was an Rvalue, but its semantics doesn't really match the semantics of an
Rvalue - rather it behaves more like a Statement.

r? @nikomatsakis you wanted this to happen
2017-02-18 04:49:56 +00:00
bors
23a0c2657a Auto merge of #39837 - alexcrichton:llvm-crt-static, r=brson
rustc: Link statically to the MSVCRT

This commit changes all MSVC rustc binaries to be compiled with
`-C target-feature=+crt-static` to link statically against the MSVCRT instead of
dynamically (as it does today). This also necessitates compiling LLVM in a
different fashion, ensuring it's compiled with `/MT` instead of `/MD`.

cc #37406
2017-02-17 22:12:00 +00:00
Nicholas Nethercote
4749175ced rework TraitSelect to avoid a vec and just use two def-ids 2017-02-17 10:48:46 -05:00
bors
536a900c47 Auto merge of #39578 - canndrew:nixos-bootstrap-fix, r=alexcrichton
Fix for bootstrapping on NixOS

NixOS puts Linux's dynamic loader in wierd place. Detect when we're on NixOS and patch the downloaded bootstrap executables appropriately.
2017-02-17 15:20:11 +00:00
bors
dc0bb3f283 Auto merge of #39485 - canndrew:inference-fix-39297, r=nikomatsakis
Ignore expected type in diverging blocks

As per comment: https://github.com/rust-lang/rust/issues/39297#issuecomment-276810343
2017-02-17 10:46:59 +00:00
bors
e879aa43ef Auto merge of #39852 - alexcrichton:appveyor-separate-dist, r=brson
appveyor: Move MSVC dist builds to their own builder

In the long run we want to separate out the dist builders from the test
builders. This provides us leeway to expand the dist builders with more tools
(e.g. Cargo and the RLS) without impacting cycle times.

Currently the Travis dist builders double-up the platforms they provide builds
for, so I figured we could try that out for MSVC as well. This commit adds a new
AppVeyor builder which runs a dist for all the MSVC targets:

* x86_64-pc-windows-msvc
* i686-pc-windows-msvc
* i586-pc-windows-msvc

If this takes too long and/or times out we'll need to split this up. In any case
we're going to need more capacity from AppVeyor no matter what becaue the two
pc-windows-gnu targets can't cross compile so we need at least 2 more builders
no matter what.
2017-02-17 07:32:18 +00:00
Steven Allen
eec9e988e1 Fixup String::split_off documentation
1. Clarify that `String::split_off` returns one string and modifies self
   in-place. The documentation implied that it returns two new strings.

2. Make the documentation mirror `Vec::split_off`.
2017-02-16 22:49:46 -08:00
Andrew Cann
5e324bdc91 Style fixups 2017-02-17 14:00:58 +08:00
bors
16c94cd673 Auto merge of #39752 - keeperofdakeys:macro-error, r=keeperofdakeys
Refactor macro resolution errors + add derive macro suggestions

Move legacy macro resolution error reporting to `finalize_current_module_macro_resolutions`, and provide suggestions for derive macros.

Fixes #39323

cc https://github.com/rust-lang/rust/issues/30197

r? @jseyfried
2017-02-17 04:02:18 +00:00
king6cong
860900cfc3 code order tweak 2017-02-17 09:47:37 +08:00
Shawn Walker-Salas
68a9d8bf21 Update src/liblibc 2017-02-16 13:04:14 -08:00
bors
668864d9ed Auto merge of #38368 - arthurprs:hm-adapt, r=alexcrichton
Adaptive hashmap implementation

All credits to @pczarn who wrote https://github.com/rust-lang/rfcs/pull/1796 and https://github.com/contain-rs/hashmap2/pull/5

 **Background**

Rust std lib hashmap puts a strong emphasis on security, we did some improvements in https://github.com/rust-lang/rust/pull/37470 but in some very specific cases and for non-default hashers it's still vulnerable (see #36481).

This is a simplified version of https://github.com/rust-lang/rfcs/pull/1796 proposal sans switching hashers on the fly and other things that require an RFC process and further decisions. I think this part has great potential by itself.

**Proposal**
This PR adds code checking for extra long probe and shifts lengths (see code comments and https://github.com/rust-lang/rfcs/pull/1796 for details), when those are encountered the hashmap will grow (even if the capacity limit is not reached yet) _greatly_ attenuating the degenerate performance case.

We need a lower bound on the minimum occupancy that may trigger the early resize, otherwise in extreme cases it's possible to turn the CPU attack into a memory attack. The PR code puts that lower bound at half of the max occupancy (defined by ResizePolicy). This reduces the protection (it could potentially be exploited between 0-50% occupancy) but makes it completely safe.

**Drawbacks**

* May interact badly with poor hashers.  Maps using those may not use the desired capacity.
* It adds 2-3 branches to the common insert path, luckily those are highly predictable and there's room to shave some in future patches.
* May complicate exposure of ResizePolicy in the future as the constants are a function of the fill factor.

**Example**

Example code that exploit the exposure of iteration order and weak hasher.

```
const MERGE: usize = 10_000usize;
#[bench]
fn merge_dos(b: &mut Bencher) {
    let first_map: $hashmap<usize, usize, FnvBuilder> = (0..MERGE).map(|i| (i, i)).collect();
    let second_map: $hashmap<usize, usize, FnvBuilder> = (MERGE..MERGE * 2).map(|i| (i, i)).collect();
    b.iter(|| {
        let mut merged = first_map.clone();
        for (&k, &v) in &second_map {
            merged.insert(k, v);
        }
        ::test::black_box(merged);
    });
}
```

_91 is stdlib and _ad is patched (the end capacity in both cases is the same)

```
running 2 tests
test _91::merge_dos              ... bench:  47,311,843 ns/iter (+/- 2,040,302)
test _ad::merge_dos              ... bench:     599,099 ns/iter (+/- 83,270)
```
2017-02-16 20:32:45 +00:00
arthurprs
57940d063c Resize hashmap when long probes are detected 2017-02-16 21:28:43 +01:00
Alex Crichton
5286c681a9 appveyor: Move MSVC dist builds to their own builder
In the long run we want to separate out the dist builders from the test
builders. This provides us leeway to expand the dist builders with more tools
(e.g. Cargo and the RLS) without impacting cycle times.

Currently the Travis dist builders double-up the platforms they provide builds
for, so I figured we could try that out for MSVC as well. This commit adds a new
AppVeyor builder which runs a dist for all the MSVC targets:

* x86_64-pc-windows-msvc
* i686-pc-windows-msvc
* i586-pc-windows-msvc

If this takes too long and/or times out we'll need to split this up. In any case
we're going to need more capacity from AppVeyor no matter what becaue the two
pc-windows-gnu targets can't cross compile so we need at least 2 more builders
no matter what.
2017-02-16 12:18:36 -08:00
Niko Matsakis
f2d8a00191 erase late bound regions in get_vtable_methods()
Higher-ranked object types can otherwise cause late-bound regions to
sneak into the substs, leading to the false conclusion that some method
is unreachable.  The heart of this patch is from @arielb1.
2017-02-16 13:56:06 -05:00
Josh Driver
2d91e7aab8 Refactor macro resolution errors + add derive macro suggestions 2017-02-16 22:03:15 +10:30
bors
ccd96c945f Auto merge of #39824 - alexcrichton:disable-dist-src, r=brson
travis: Disable source tarballs on most builders

Currently we create a source tarball on almost all of the `DEPLOY=1` builders
but this has the adverse side effect of all source tarballs overriding
themselves in the S3 bucket. Normally this is ok but unfortunately a source
tarball created on Windows is not buildable on Unix.

On Windows the vendored sources contain paths with `\` characters in them which
when interpreted on Unix end up in "file not found" errors.

Instead of this overwriting behavior, whitelist just one linux builder for
producing tarballs and avoid producing tarballs on all other hosts.
2017-02-16 08:20:29 +00:00
Benoît CORTIER
36b00cf217 Correct a typo in procedural macros chapter of the Book. (fixup [c8292fcd6a]) 2017-02-16 09:18:19 +01:00
Shawn Walker-Salas
5789539311 simplify home_dir by removing unnecessary getpwuid_r wrapper 2017-02-15 22:52:47 -08:00
Esteban Küber
a7f63d12a7 Remove noop method Substs::params()
Re: 48b3dd11f5
2017-02-15 22:17:07 -08:00
bors
d77af7f639 Auto merge of #39876 - frewsxcv:rollup, r=frewsxcv
Rollup of 12 pull requests

- Successful merges: #39775, #39793, #39804, #39834, #39836, #39839, #39840, #39843, #39844, #39846, #39857, #39861
- Failed merges:
2017-02-16 05:52:46 +00:00