]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAllow types passed to [] to coerce, like .index()
Aidan Hobson Sayers [Tue, 28 Feb 2017 23:46:47 +0000 (23:46 +0000)]
Allow types passed to [] to coerce, like .index()

Fixes #40085

7 years agoAuto merge of #39892 - petrochenkov:rt, r=alexcrichton
bors [Fri, 24 Feb 2017 16:06:15 +0000 (16:06 +0000)]
Auto merge of #39892 - petrochenkov:rt, r=alexcrichton

Fix test caching on Windows/GNU

Addresses https://github.com/rust-lang/rust/issues/36385#issuecomment-277131231

Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns.
Now mingw startup objects are built in the native directory and then copied into the sysroot directory. They are also rebuilt only when necessary, so test caching works.

7 years agoAuto merge of #39714 - vadimcn:top-level-expn2, r=michaelwoerister
bors [Fri, 24 Feb 2017 07:30:11 +0000 (07:30 +0000)]
Auto merge of #39714 - vadimcn:top-level-expn2, r=michaelwoerister

Code cleanup.

r? @michaelwoerister

Just figured out that the same condition may be expressed much more cleanly.
Sorry for the churn!

7 years agoAuto merge of #39851 - alexcrichton:verify-unstable, r=brson
bors [Fri, 24 Feb 2017 02:40:16 +0000 (02:40 +0000)]
Auto merge of #39851 - alexcrichton:verify-unstable, r=brson

test: Verify all sysroot crates are unstable

As we continue to add more crates to the compiler and use them to implement
various features we want to be sure we're not accidentally expanding the API
surface area of the compiler! To that end this commit adds a new `run-make` test
which will attempt to `extern crate foo` all crates in the sysroot, verifying
that they're all unstable.

This commit discovered that the `std_shim` and `test_shim` crates were
accidentally stable and fixes the situation by deleting those shims. The shims
are no longer necessary due to changes in Cargo that have happened since they
were originally incepted.

7 years agoAuto merge of #40039 - abonander:issue_40001, r=jseyfried
bors [Thu, 23 Feb 2017 16:56:13 +0000 (16:56 +0000)]
Auto merge of #40039 - abonander:issue_40001, r=jseyfried

Don't assume plugin-whitelisted attributes are proc macro attributes

closes #40001

7 years agoDon't assume plugin-whitelisted attributes are proc macro attributes
Austin Bonander [Wed, 22 Feb 2017 19:15:12 +0000 (11:15 -0800)]
Don't assume plugin-whitelisted attributes are proc macro attributes

closes #40001

7 years agoAuto merge of #39866 - steveklabnik:unstable-book, r=alexcrichton
bors [Wed, 22 Feb 2017 23:08:35 +0000 (23:08 +0000)]
Auto merge of #39866 - steveklabnik:unstable-book, r=alexcrichton

Create the Unstable Book

Part of https://github.com/rust-lang/rust/issues/39588

This isn't done yet. To do:

- [x] import the nightly book contents here
- [ ] possibly write some more chapters

This will _not_ be done before it lands; that's part of the whole unstable thing.

7 years agoget linkcheck clean
Steve Klabnik [Tue, 21 Feb 2017 22:30:00 +0000 (17:30 -0500)]
get linkcheck clean

7 years agofix some links
Steve Klabnik [Mon, 20 Feb 2017 22:25:33 +0000 (17:25 -0500)]
fix some links

7 years agoTRPL Nightly -> Unstable Book
Steve Klabnik [Thu, 16 Feb 2017 01:27:58 +0000 (20:27 -0500)]
TRPL Nightly -> Unstable Book

Port the chapters from TRPL's "Nightly Rust" section to the Unstable
Book, and remove it from TRPL.

7 years agowrite intro
Steve Klabnik [Wed, 15 Feb 2017 23:32:49 +0000 (18:32 -0500)]
write intro

7 years agoImport basic book contents
Steve Klabnik [Wed, 15 Feb 2017 23:27:16 +0000 (18:27 -0500)]
Import basic book contents

7 years agoCreate "The Unstable Book"
Steve Klabnik [Wed, 15 Feb 2017 22:43:03 +0000 (17:43 -0500)]
Create "The Unstable Book"

part of #39588

7 years agoAuto merge of #39855 - steveklabnik:mdbook-reference, r=GuillaumeGomez
bors [Tue, 21 Feb 2017 23:46:20 +0000 (23:46 +0000)]
Auto merge of #39855 - steveklabnik:mdbook-reference, r=GuillaumeGomez

Port the reference to mdbook

Part of #39588.

This is only a work in progress. Still left to do:

- [x] double check contents weren't duplicated/lost with the move to individual pages (I'm going to do this)
- [x] fix up links [and footnotes](https://github.com/rust-lang/rust/pull/39855#issuecomment-280168170) (@frewsxcv has volunteered to help with this)
- [x] change `src/doc/reference.md` to redirect to the book
- [x] move the reference on the doc index to be part of the bookshelf

7 years agoAuto merge of #39765 - GuillaumeGomez:file-not-found-for-module-error, r=jseyfried
bors [Tue, 21 Feb 2017 21:08:11 +0000 (21:08 +0000)]
Auto merge of #39765 - GuillaumeGomez:file-not-found-for-module-error, r=jseyfried

File not found for module error

Fixes #39542.

r? @jonathandturner

Maybe you want to take a look @pnkfelix?

7 years agotest: Verify all sysroot crates are unstable
Alex Crichton [Wed, 15 Feb 2017 16:53:18 +0000 (08:53 -0800)]
test: Verify all sysroot crates are unstable

As we continue to add more crates to the compiler and use them to implement
various features we want to be sure we're not accidentally expanding the API
surface area of the compiler! To that end this commit adds a new `run-make` test
which will attempt to `extern crate foo` all crates in the sysroot, verifying
that they're all unstable.

This commit discovered that the `std_shim` and `test_shim` crates were
accidentally stable and fixes the situation by deleting those shims. The shims
are no longer necessary due to changes in Cargo that have happened since they
were originally incepted.

7 years agomove the reference to the bookshelf
Steve Klabnik [Thu, 16 Feb 2017 01:37:06 +0000 (20:37 -0500)]
move the reference to the bookshelf

7 years agoRedirect to the new reference
Steve Klabnik [Thu, 16 Feb 2017 01:35:30 +0000 (20:35 -0500)]
Redirect to the new reference

7 years agoAdd footnote style.
Steve Klabnik [Tue, 21 Feb 2017 03:04:29 +0000 (22:04 -0500)]
Add footnote style.

Until https://github.com/azerupi/mdBook/issues/210 is resolved,
we'll import the css file.

7 years agoGet linkchecker clean
Steve Klabnik [Tue, 21 Feb 2017 06:15:29 +0000 (01:15 -0500)]
Get linkchecker clean

This affects the book, some missed things in the reference, the grammar,
and the standard library. Whew!

7 years agostatements and expressions
Steve Klabnik [Tue, 21 Feb 2017 05:44:38 +0000 (00:44 -0500)]
statements and expressions

7 years agotypes
Steve Klabnik [Tue, 21 Feb 2017 05:32:52 +0000 (00:32 -0500)]
types

7 years agomemory model
Steve Klabnik [Tue, 21 Feb 2017 05:27:06 +0000 (00:27 -0500)]
memory model

7 years agoItems
Corey Farwell [Tue, 21 Feb 2017 05:23:40 +0000 (00:23 -0500)]
Items

7 years agolinkage
Steve Klabnik [Tue, 21 Feb 2017 05:13:55 +0000 (00:13 -0500)]
linkage

7 years agounsafety
Steve Klabnik [Tue, 21 Feb 2017 05:12:14 +0000 (00:12 -0500)]
unsafety

7 years agoinfluences
Steve Klabnik [Tue, 21 Feb 2017 05:06:32 +0000 (00:06 -0500)]
influences

7 years agoItems and attributes
Corey Farwell [Tue, 21 Feb 2017 04:28:06 +0000 (23:28 -0500)]
Items and attributes

7 years agoCrates and source files
Corey Farwell [Tue, 21 Feb 2017 04:25:58 +0000 (23:25 -0500)]
Crates and source files

7 years agoProcedural macros
Corey Farwell [Tue, 21 Feb 2017 04:15:56 +0000 (23:15 -0500)]
Procedural macros

7 years agoMacros By Example
Corey Farwell [Tue, 21 Feb 2017 04:11:52 +0000 (23:11 -0500)]
Macros By Example

7 years agoMacros
Corey Farwell [Tue, 21 Feb 2017 04:11:15 +0000 (23:11 -0500)]
Macros

7 years agoPaths
Corey Farwell [Tue, 21 Feb 2017 04:11:01 +0000 (23:11 -0500)]
Paths

7 years agoTokens
Corey Farwell [Tue, 21 Feb 2017 04:10:49 +0000 (23:10 -0500)]
Tokens

7 years agoComments
Corey Farwell [Tue, 21 Feb 2017 04:10:32 +0000 (23:10 -0500)]
Comments

7 years agoIdentifiers
Corey Farwell [Tue, 21 Feb 2017 04:10:18 +0000 (23:10 -0500)]
Identifiers

7 years agoString table productions
Corey Farwell [Tue, 21 Feb 2017 04:09:56 +0000 (23:09 -0500)]
String table productions

7 years agoUnicode productions
Corey Farwell [Tue, 21 Feb 2017 04:09:26 +0000 (23:09 -0500)]
Unicode productions

7 years agoIntroduction
Corey Farwell [Tue, 21 Feb 2017 04:08:55 +0000 (23:08 -0500)]
Introduction

7 years agoclean up some things
Steve Klabnik [Wed, 15 Feb 2017 22:55:02 +0000 (17:55 -0500)]
clean up some things

I double checked that everything is here and in the correct order; this fixes things up

7 years agoStart the port of the reference to mdBook
Steve Klabnik [Wed, 15 Feb 2017 19:57:33 +0000 (14:57 -0500)]
Start the port of the reference to mdBook

This only really moves the files, there's a lot more work coming
in the next commits.

Part of #39588.

7 years agoAuto merge of #39874 - amosonn:master, r=alexcrichton
bors [Tue, 21 Feb 2017 16:04:44 +0000 (16:04 +0000)]
Auto merge of #39874 - amosonn:master, r=alexcrichton

Fixes overflow in libsdt/io/cursor.rs "seek"

Fixes #39631
Test which fails (with old implementation), then fix to implementation.

7 years agoAdd long error explanations
Guillaume Gomez [Sun, 12 Feb 2017 14:18:41 +0000 (15:18 +0100)]
Add long error explanations

7 years agoAuto merge of #39990 - CryZe:emscripten-no-vectorization, r=alexcrichton
bors [Tue, 21 Feb 2017 04:36:46 +0000 (04:36 +0000)]
Auto merge of #39990 - CryZe:emscripten-no-vectorization, r=alexcrichton

Turn off Vectorization for Emscripten

When targeting Emscripten, rustc emits Vector Instructions by default. However Web Assembly doesn't support Vector Instructions yet, which causes Binaryen to fail converting the intermediate asm.js code to Web Assembly. While asm.js kind of supports Vector Instructions, they aren't supported by any browser other than Firefox, often meaning that they need to be emulated very slowly. So it should just be turned off
for all Emscripten targets.

Fixes #38558

7 years agoTurn off Vectorization for Emscripten
Christopher Serr [Mon, 20 Feb 2017 22:20:06 +0000 (23:20 +0100)]
Turn off Vectorization for Emscripten

When targeting Emscripten, rustc emits Vector Instructions by default.
However Web Assembly doesn't support Vector Instructions yet, which
causes Binaryen to fail converting the intermediate asm.js code to Web
Assembly. While asm.js kind of supports Vector Instructions, they
aren't supported by any browser other than Firefox, often meaning that
they need to be emulated very slowly. So it should just be turned off
for all Emscripten targets.

Fixes #38558

7 years agoAuto merge of #39717 - pnkfelix:check-timestamps-in-compiletest-miropt, r=alexcrichton
bors [Mon, 20 Feb 2017 21:31:17 +0000 (21:31 +0000)]
Auto merge of #39717 - pnkfelix:check-timestamps-in-compiletest-miropt, r=alexcrichton

When compiletest'ing src/test/mir-opt, check timestamps.

The tests in src/test/mir-opt embed references to generated files. The names of the generated files embed node id's, which will change depending on the content of the original source.

To guard against comparisons against stale output, check the timestamps of the supposed output against the timestamp of the original source (i.e. any output should be at least as new as the source that was recompiled).

Fix #39690.

7 years agoAuto merge of #39981 - frewsxcv:rollup, r=frewsxcv
bors [Mon, 20 Feb 2017 18:58:28 +0000 (18:58 +0000)]
Auto merge of #39981 - frewsxcv:rollup, r=frewsxcv

Rollup of 3 pull requests

- Successful merges: #39913, #39937, #39976
- Failed merges:

7 years agoRollup merge of #39976 - steveklabnik:reenable-book-linkchecker, r=frewsxcv
Corey Farwell [Mon, 20 Feb 2017 17:42:55 +0000 (12:42 -0500)]
Rollup merge of #39976 - steveklabnik:reenable-book-linkchecker, r=frewsxcv

Reenable linkchecker for books

In some senses, this is a revert of https://github.com/rust-lang/rust/pull/39633/commits/cacb3bc9c741a7d41a1085af850cd3ff852307f5#diff-b64563d143f859565c8357a28ef81101R212; we disabled linkchecker for the book because the links were added by JavaScript. Now, that's fixed upstream, and so we can re-enable the checker.

This also involves two other fixes: we have to check for `name`s as well as `id`s for links, and the linking algorithm of mdBook changed to the same as rustdoc's, so we change some links back.

~~~This isn't quite ready yet; it's [depending on a PR of mine to mdBook](https://github.com/azerupi/mdBook/pull/209). After that's released, this should be the last of these kinds of shenanigans~~~ ðŸ˜„

This is good to go ðŸ˜„

7 years agoRollup merge of #39937 - arthurprs:hm-adapt, r=frewsxcv
Corey Farwell [Mon, 20 Feb 2017 17:42:54 +0000 (12:42 -0500)]
Rollup merge of #39937 - arthurprs:hm-adapt, r=frewsxcv

Fix spelling in hashmap comments

Fixing my bad english from #38368

Note to self: triple check spelling/grammar

7 years agoRollup merge of #39913 - nikomatsakis:inference-error, r=pnkfelix
Corey Farwell [Mon, 20 Feb 2017 17:42:53 +0000 (12:42 -0500)]
Rollup merge of #39913 - nikomatsakis:inference-error, r=pnkfelix

Report full details of inference errors

When the old suggestion machinery was removed by @brson in https://github.com/rust-lang/rust/pull/37057, it was not completely removed. There was a bit of code that had the job of going through errors and finding those for which suggestions were applicable, and it remained, causing us not to emit the full details of such errors.  This PR removes that.

I've also added various lifetime tests to the UI test suite (so you can also see the before/after there). I have some concrete thoughts on how to improve these cases and am planning on writing those up in some mentoring issues (@CengizIO has expressed interest in working on those changes, so I plan to work with him on it, at least to start).

cc @jonathandturner

7 years agoAdd tests for newly added error codes
Guillaume Gomez [Sun, 12 Feb 2017 14:08:15 +0000 (15:08 +0100)]
Add tests for newly added error codes

7 years agoAdd error codes for errors in libsyntax
Guillaume Gomez [Sun, 12 Feb 2017 13:33:17 +0000 (14:33 +0100)]
Add error codes for errors in libsyntax

7 years agoUpdate mdBook version
Steve Klabnik [Mon, 20 Feb 2017 15:24:20 +0000 (10:24 -0500)]
Update mdBook version

This brings in a needed bugfix.

7 years agoEnable linkchecker on books
Steve Klabnik [Mon, 20 Feb 2017 14:30:42 +0000 (09:30 -0500)]
Enable linkchecker on books

Previously, mdBook used JavaScript to add header links, so we
skipped checking the book. As of
https://github.com/rust-lang/rust/pull/39966, it no longer does,
so we can start checking again.

There is a twist, though: it uses name instead of id, so let's test
for both. They're both valid links anyway, so it's good to have the
checker check anyway.

7 years agoFix #39690: make mir-opt mode for compiletest check timestamps.
Felix S. Klock II [Thu, 9 Feb 2017 15:48:43 +0000 (16:48 +0100)]
Fix #39690: make mir-opt mode for compiletest check timestamps.

This version removes prior use of `time` crate, to satisify vendoring requirements.

remove extraneous whitespace change

7 years agoAuto merge of #39748 - Rufflewind:master, r=steveklabnik
bors [Mon, 20 Feb 2017 15:06:07 +0000 (15:06 +0000)]
Auto merge of #39748 - Rufflewind:master, r=steveklabnik

Rust Book: Generics: Resolving ambiguities

- Add a small section to generics.md to explain how ambiguities in type inference can be resolved using the `::<>` syntax.
- Add links from syntax-index.md and iterators.md.
- Minor edits to iterators.md and structs.md.

7 years agoRevert "Fix up links"
Steve Klabnik [Mon, 20 Feb 2017 14:09:12 +0000 (09:09 -0500)]
Revert "Fix up links"

This reverts commit 7f1d1c6d9a7be5e427bace30e740b16b25f25c92.

The original commit was created because mdBook and rustdoc had
different generation algorithms for header links; now with
https://github.com/rust-lang/rust/pull/39966 , the algorithms
are the same. So let's undo this change.

... when I came across this problem, I said "eh, this isn't fun,
but it doesn't take that long." I probably should have just actually
taken the time to fix upstream, given that they were amenable. Oh
well!

7 years agoAuto merge of #39965 - ArtBears:master, r=steveklabnik
bors [Mon, 20 Feb 2017 10:58:36 +0000 (10:58 +0000)]
Auto merge of #39965 - ArtBears:master, r=steveklabnik

Fixed a typo in CONTRIBUTING.md

Small change to the CONTRIBUTING.md file.

r? @steveklabnik

7 years agoAuto merge of #39923 - mattyw:patch-1, r=steveklabnik
bors [Mon, 20 Feb 2017 08:16:31 +0000 (08:16 +0000)]
Auto merge of #39923 - mattyw:patch-1, r=steveklabnik

Variable Bindings possible nitpick

Complete drive by nitpick I'm afraid

7 years agoAuto merge of #39304 - jrmuizel:drop-flags, r=steveklabnik
bors [Mon, 20 Feb 2017 05:51:11 +0000 (05:51 +0000)]
Auto merge of #39304 - jrmuizel:drop-flags, r=steveklabnik

Remove obsolete documentation about drop-flags

7 years agoAuto merge of #39966 - steveklabnik:update-mdbook, r=GuillaumeGomez
bors [Mon, 20 Feb 2017 03:27:06 +0000 (03:27 +0000)]
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.

7 years agoRust Book: Generics: Resolving ambiguities
Phil Ruffwind [Sat, 11 Feb 2017 22:00:56 +0000 (17:00 -0500)]
Rust Book: Generics: Resolving ambiguities

- Add a small section to generics.md to explain how ambiguities in type
  inference can be resolved using the ::<> syntax.
- Add links from syntax-index.md and iterators.md.
- Minor edits to iterators.md and structs.md.

7 years agoUpdate dependencies
Steve Klabnik [Mon, 20 Feb 2017 00:20:57 +0000 (19:20 -0500)]
Update dependencies

In order to update mdbook, we have to update other stuff too.

7 years agoUpdate mdbook version
Steve Klabnik [Sun, 19 Feb 2017 23:55:57 +0000 (18:55 -0500)]
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.

7 years agoAuto merge of #39955 - mp4096:master, r=GuillaumeGomez
bors [Mon, 20 Feb 2017 00:00:53 +0000 (00:00 +0000)]
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.

7 years agoMerge branch 'master' of https://github.com/rust-lang/rust
Glyne J. Gittens [Sun, 19 Feb 2017 22:32:21 +0000 (17:32 -0500)]
Merge branch 'master' of https://github.com/rust-lang/rust

7 years agoRemoved a typo from CONTRIBUTING.md
Glyne J. Gittens [Sun, 19 Feb 2017 22:30:50 +0000 (17:30 -0500)]
Removed a typo from CONTRIBUTING.md

7 years agofix run-pass test that required `Copy` impl
Niko Matsakis [Sun, 19 Feb 2017 20:26:32 +0000 (15:26 -0500)]
fix run-pass test that required `Copy` impl

7 years agoAuto merge of #39939 - petrochenkov:regres, r=eddyb
bors [Sun, 19 Feb 2017 17:52:54 +0000 (17:52 +0000)]
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

7 years agoAuto merge of #39871 - binarycrusader:issue-39868, r=alexcrichton
bors [Sun, 19 Feb 2017 11:21:09 +0000 (11:21 +0000)]
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

7 years agoDocs: Better explanation of return values for min, max functions
Mikhail Pak [Sun, 19 Feb 2017 10:01:02 +0000 (11:01 +0100)]
Docs: Better explanation of return values for min, max functions

Explain that a None is returned if the iterator is empty.

7 years agoAuto merge of #39912 - nikomatsakis:incr-comp-trait-select-no-vec, r=eddyb
bors [Sun, 19 Feb 2017 06:30:38 +0000 (06:30 +0000)]
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

7 years agoAvoid ICE in Self::Assoc in impl headers
Vadim Petrochenkov [Sat, 18 Feb 2017 21:15:30 +0000 (00:15 +0300)]
Avoid ICE in Self::Assoc in impl headers

7 years agoPrivatize fields of PathResolution
Vadim Petrochenkov [Sat, 18 Feb 2017 19:11:42 +0000 (22:11 +0300)]
Privatize fields of PathResolution

Ensure Def::Err has depth == 0

7 years agoFix spelling in comments
arthurprs [Sat, 18 Feb 2017 20:06:00 +0000 (21:06 +0100)]
Fix spelling in comments

7 years agoAuto merge of #39933 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sat, 18 Feb 2017 17:10:34 +0000 (17:10 +0000)]
Auto merge of #39933 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 5 pull requests

- Successful merges: #39847, #39862, #39898, #39904, #39928
- Failed merges:

7 years agoRollup merge of #39928 - GuillaumeGomez:env_func_urls, r=frewsxcv
Guillaume Gomez [Sat, 18 Feb 2017 17:10:15 +0000 (18:10 +0100)]
Rollup merge of #39928 - GuillaumeGomez:env_func_urls, r=frewsxcv

Add missing urls for env functions

r? @frewsxcv

7 years agoRollup merge of #39904 - Stebalien:cleanup-string-split-off, r=frewsxcv
Guillaume Gomez [Sat, 18 Feb 2017 17:10:14 +0000 (18:10 +0100)]
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`.

7 years agoRollup merge of #39898 - king6cong:logic_clean, r=alexcrichton
Guillaume Gomez [Sat, 18 Feb 2017 17:10:13 +0000 (18:10 +0100)]
Rollup merge of #39898 - king6cong:logic_clean, r=alexcrichton

code order tweak

7 years agoRollup merge of #39862 - stjepang:fix-wording-localkey, r=GuillaumeGomez
Guillaume Gomez [Sat, 18 Feb 2017 17:10:12 +0000 (18:10 +0100)]
Rollup merge of #39862 - stjepang:fix-wording-localkey, r=GuillaumeGomez

Fix wording in LocalKey documentation

Fixes #39841

r? @GuillaumeGomez

7 years agoRollup merge of #39847 - CBenoit:patch-1, r=frewsxcv
Guillaume Gomez [Sat, 18 Feb 2017 17:10:11 +0000 (18:10 +0100)]
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.

7 years agoRebuild mingw startup objects only when necessary
Vadim Petrochenkov [Sat, 18 Feb 2017 17:10:01 +0000 (20:10 +0300)]
Rebuild mingw startup objects only when necessary

7 years agoAdd missing urls for env functions
Guillaume Gomez [Sat, 18 Feb 2017 13:44:56 +0000 (14:44 +0100)]
Add missing urls for env functions

7 years agoAuto merge of #39887 - nikomatsakis:issue-39292, r=arielb1
bors [Sat, 18 Feb 2017 12:17:06 +0000 (12:17 +0000)]
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

7 years agoVariable Bindings possible nitpick
Matt Williams [Sat, 18 Feb 2017 09:57:33 +0000 (09:57 +0000)]
Variable Bindings possible nitpick

Complete drive by nitpick I'm afraid

7 years agoAuto merge of #39877 - estebank:remove-params, r=petrochenkov
bors [Sat, 18 Feb 2017 09:50:10 +0000 (09:50 +0000)]
Auto merge of #39877 - estebank:remove-params, r=petrochenkov

Remove noop method `Substs::params()`

Re: 48b3dd11f59f48819031206ee2b3ab98ceae1550 & 7a8d4822d8eb922f0cd50e92f420b5f1938db64d

7 years agoAuto merge of #39854 - nagisa:mir-asm-stmt, r=nikomatsakis
bors [Sat, 18 Feb 2017 04:49:56 +0000 (04:49 +0000)]
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

7 years agoAuto merge of #39837 - alexcrichton:llvm-crt-static, r=brson
bors [Fri, 17 Feb 2017 22:12:00 +0000 (22:12 +0000)]
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

7 years agoremove vestiges of the old suggestion machinery
Niko Matsakis [Fri, 17 Feb 2017 15:33:06 +0000 (10:33 -0500)]
remove vestiges of the old suggestion machinery

7 years agoadd some sample UI error test cases
Niko Matsakis [Fri, 17 Feb 2017 15:32:25 +0000 (10:32 -0500)]
add some sample UI error test cases

These are some samples that I have been focusing on improving over
time. In this PR, I mainly want to stem the bleeding where we in some
cases we show an error that gives you no possible way to divine the
problem.

7 years agorework `TraitSelect` to avoid a vec and just use two def-ids
Nicholas Nethercote [Fri, 4 Nov 2016 06:31:52 +0000 (17:31 +1100)]
rework `TraitSelect` to avoid a vec and just use two def-ids

7 years agoAuto merge of #39578 - canndrew:nixos-bootstrap-fix, r=alexcrichton
bors [Fri, 17 Feb 2017 15:20:11 +0000 (15:20 +0000)]
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.

7 years agoAuto merge of #39485 - canndrew:inference-fix-39297, r=nikomatsakis
bors [Fri, 17 Feb 2017 10:46:59 +0000 (10:46 +0000)]
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

7 years agoAuto merge of #39852 - alexcrichton:appveyor-separate-dist, r=brson
bors [Fri, 17 Feb 2017 07:32:18 +0000 (07:32 +0000)]
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.

7 years agoFixup String::split_off documentation
Steven Allen [Fri, 17 Feb 2017 06:49:46 +0000 (22:49 -0800)]
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`.

7 years agoStyle fixups
Andrew Cann [Fri, 17 Feb 2017 06:00:58 +0000 (14:00 +0800)]
Style fixups

7 years agoAuto merge of #39752 - keeperofdakeys:macro-error, r=keeperofdakeys
bors [Fri, 17 Feb 2017 04:02:18 +0000 (04:02 +0000)]
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

7 years agocode order tweak
king6cong [Fri, 17 Feb 2017 01:47:37 +0000 (09:47 +0800)]
code order tweak

7 years agoUpdate src/liblibc
Shawn Walker-Salas [Thu, 16 Feb 2017 21:04:14 +0000 (13:04 -0800)]
Update src/liblibc

7 years agoAuto merge of #38368 - arthurprs:hm-adapt, r=alexcrichton
bors [Thu, 16 Feb 2017 20:32:45 +0000 (20:32 +0000)]
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)
```