Commit Graph

93340 Commits

Author SHA1 Message Date
bors
823a75d9ba Auto merge of #60841 - alexcrichton:update-compiler-builtins, r=RalfJung
Update the compiler_builtins crate

This updates to 0.1.13 for `compiler_builtins`, published to fix a few
issues. The feature changes here are updated because `compiler_builtins`
no longer enables the `c` feature by default but we want to do so
through our build still.

Closes #60747
Closes #60782
2019-05-17 16:11:20 +00:00
Alex Crichton
3c9790e429 Update the compiler_builtins crate
This updates to 0.1.13 for `compiler_builtins`, published to fix a few
issues. The feature changes here are updated because `compiler_builtins`
no longer enables the `c` feature by default but we want to do so
through our build still.

Closes #60747
Closes #60782
2019-05-17 07:17:15 -07:00
bors
b982867a73 Auto merge of #60171 - matthewjasper:full-nll-compare-mode, r=pnkfelix
Use -Zborrowck=mir for NLL compare mode

closes #56993

r? @pnkfelix
2019-05-17 13:01:23 +00:00
bors
39401465da Auto merge of #60892 - davidtwco:issue-60622, r=oli-obk
Checking generic args after late bound region err.

Fixes #60622.

This PR fixes an ICE that occurs when a late bound region error is
emitted and that resulted in the rest of the generic arguments of a
function not being checked.

For example, you could specify a generic type parameter `T` in a function
call `foo<'_, T>()` to a function that doesn't have a generic type
parameter.

Since an error wasn't emitted from the function, compilation
continued to parts of typeck that didn't expect a generic type argument
in a call for a function that didn't have any generic type arguments.
2019-05-17 10:14:19 +00:00
David Wood
bff8a86698
Checking generic args after late bound region err.
This commit fixes an ICE that occurs when a late bound region error is
emitted and that resulted in the rest of the generic arguments of a
function not being checked.

For example, you could specify a generic type parameter `T` in a function
call `foo<'_, T>()` to a function that doesn't have a generic type
parameter.

Since an error wasn't emitted from the function, compilation
continued to parts of typeck that didn't expect a generic type argument
in a call for a function that didn't have any generic type arguments.
2019-05-17 09:12:40 +01:00
bors
68fd80fa1e Auto merge of #60899 - cuviper:RawEntryMut-origin-story, r=Centril
doc: correct the origin of RawEntryMut
2019-05-17 07:24:16 +00:00
bors
c2e49bf1a2 Auto merge of #60817 - ecstatic-morse:issue-60779, r=Centril
Add stubs to keyword docs

Resolves #60779.

This commit gives each stable keyword a short entry in the "Keywords" section in the docs for `std`. The newly added entries are only a single line each and contain the main purpose of the keyword. I changed some of the existing summary lines for consistency's sake. Each line is either an imperative ("name the type of a trait object" for `dyn`), or an object ("An abstract data type" for `enum`). I tried to avoid using the keyword itself or the word "keyword" in the summary.

Later commits can flesh out each keyword with an example for each context in which it can appear as well as a link to the appropriate part of the rust book.

**edit:**
Here's the list of keywords and summaries (sans formatting) to ease reviewing. I'll try to keep this up to date as I make changes:

keyword | summary
-- | --
Self | The implementing type within a `trait` or `impl` block, or the current type within a type definition.
as | Cast between types, or rename an import.
async | ExperimentalReturn a Future instead of blocking the current thread.
await | ExperimentalSuspend execution until the result of a Future is ready.
break | Exit early from a loop.
const | Compile-time constants and deterministic functions.
continue | Skip to the next iteration of a loop.
crate | A Rust binary or library.
dyn | Name the type of a trait object.
else | What to do when an if condition does not hold.
enum | A type that can be any one of several variants.
extern | Link to or import external code.
false | A value of type bool representing logical false.
fn | A function or function pointer.
for | Iteration with in, trait implementation with impl, or higher-ranked trait bounds (for<'a>).
if | Evaluate a block if a condition holds.
impl | Implement some functionality for a type.
in | Iterate over a series of values with for.
let | Bind a value to a variable.
loop | Loop indefinitely.
match | Control flow based on pattern matching.
mod | Organize code into modules.
move | Capture a closure's environment by value.
mut | A mutable binding, reference, or pointer.
pub | Make an item visible to others.
ref | Bind by reference during pattern matching.
return | Return a value from a function.
self | The receiver of a method, or the current module.
static | A place that is valid for the duration of a program.
struct | A type that is composed of other types.
super | The parent of the current module.
trait | A common interface for a class of types.
true | A value of type bool representing logical true.
type | Define an alias for an existing type.
union | The Rust equivalent of a C-style union.
unsafe | Code or interfaces whose memory safety cannot be verified by the type system.
use | Import or rename items from other crates or modules.
where | Add constraints that must be upheld to use an item.
while | Loop while a condition is upheld.
2019-05-17 03:52:27 +00:00
Josh Stone
4d61fb1ba4 doc: correct the origin of RawEntryMut 2019-05-16 18:15:09 -07:00
bors
1bbb1353be Auto merge of #60898 - Centril:rollup-76o2g8a, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #60685 (Switch to SPDX 2.1 license expression)
 - #60687 (Fix .natvis visualizers.)
 - #60805 (remove compiletest's dependency on `filetime`)
 - #60862 (Get ty from local_decls instead of using Place)
 - #60873 (Parse alternative incorrect uses of await and recover)
 - #60894 (Add entry-like methods to HashSet)

Failed merges:

r? @ghost
2019-05-17 00:55:01 +00:00
Mazdak Farrokhzad
a80a1d0e0d
Rollup merge of #60894 - cuviper:hash_set_entry, r=cramertj,Centril
Add entry-like methods to HashSet

* `HashSet::get_or_insert`
* `HashSet::get_or_insert_with`

These provide a simplification of the `Entry` API for `HashSet`, with
names chosen to match the similar methods on `Option`.
2019-05-17 02:54:18 +02:00
Mazdak Farrokhzad
70b38d13a5
Rollup merge of #60873 - estebank:bad-await, r=Centril
Parse alternative incorrect uses of await and recover

Fix #60613.

r? @Centril
2019-05-17 02:54:17 +02:00
Mazdak Farrokhzad
71cd93a104
Rollup merge of #60862 - spastorino:get-ty-from-local_decls, r=oli-obk
Get ty from local_decls instead of using Place

r? @oli-obk This is from one of your review on Place 2.0
2019-05-17 02:54:16 +02:00
Mazdak Farrokhzad
23d91e272b
Rollup merge of #60805 - euclio:filetime-dep, r=Mark-Simulacrum
remove compiletest's dependency on `filetime`
2019-05-17 02:54:14 +02:00
Mazdak Farrokhzad
a925973927
Rollup merge of #60687 - MaulingMonkey:pr-fix-natvis-files, r=alexcrichton
Fix .natvis visualizers.

### Updated to handle these changes:
  - `core::ptr::*` lost their `__0` elements and are just plain pointers
  - `core::ptr::*` probably shouldn't dereference in `DisplayString` s
  - `VecDeque` probably *should* dereference it's buf pointer to display individual items.
  - `VecDeque` and `Vec` use `core::ptr::*` s
  - `VecDeque` and `LinkedList` moved modules again.

### Retested - still working fine, left alone:
  - `String`, `&str`, `Option`

### Side Chatter
  - Props to Alex for pointing out this was broken in the `#ides-and-editors` Discord channel
  - It'd be nice if there was a sane way to automate unit testing these visualizers.
    (I assume COM automation of Visual Studio would be a no go on the build servers, and probably really incredibly painful to write too!  Suggestions welcome...)
2019-05-17 02:54:13 +02:00
Mazdak Farrokhzad
5972408408
Rollup merge of #60685 - dtolnay:spdx, r=nikomatsakis
Switch to SPDX 2.1 license expression

[According to the Cargo Reference:](https://doc.rust-lang.org/cargo/reference/manifest.html)

> This is an SPDX 2.1 license expression for this package. Currently crates.io will validate the license provided against a whitelist of known license and exception identifiers from the SPDX license list 2.4. Parentheses are not currently supported.
>
> Multiple licenses can be separated with a \`/\`, although that usage is deprecated. Instead, use a license expression with AND and OR operators to get more explicit semantics.

The notation with slashes is deprecated in favor of explicit AND or OR.

As I understand it, Rust's license is MIT *OR* Apache-2.0 matching the meaning of *OR* defined by [SPDX Specification 2.1](https://spdx.org/spdx-specification-21-web-version):

> If presented with a choice between two or more licenses, use the disjunctive binary "OR" operator to construct a new license expression, where both the left and right operands are valid license expression values.
2019-05-17 02:54:11 +02:00
Josh Stone
9161a4dbef Comment why get_or_insert returns &T 2019-05-16 16:21:31 -07:00
Josh Stone
5e2c9d38e9 Add a hash_set_entry tracking issue 2019-05-16 15:37:01 -07:00
Esteban Küber
c084d0ed7d review comments 2019-05-16 15:25:58 -07:00
Josh Stone
5f938342ce Add entry-like methods to HashSet
* `HashSet::get_or_insert`
* `HashSet::get_or_insert_with`

These provide a simplification of the `Entry` API for `HashSet`, with
names chosen to match the similar methods on `Option`.
2019-05-16 15:10:52 -07:00
bors
4f53b5c42b Auto merge of #60888 - Manishearth:rollup-oihtoyq, r=Manishearth
Rollup of 5 pull requests

Successful merges:

 - #60207 (Outdent example, preserving nested fence)
 - #60278 (Document the `html_root_url` doc attribute value.)
 - #60597 (Do some simple constant propagation in the ConstProp pass)
 - #60837 (Update release notes for 1.35.0)
 - #60887 (Update clippy)

Failed merges:

r? @ghost
2019-05-16 21:54:53 +00:00
Dylan MacKenzie
851be33f2a Add all keywords to keyword docs
This commit gives each stable keyword a short entry in the "Keywords"
section in the docs for `std`. The newly added entries are a single
summary line and a note that the documentation is not yet complete.  I
changed some of the existing summary lines for consistency's sake. Each
line is either a verb phrase ("name the type of a trait object" for
`dyn`), or an object ("A value of type `bool` representing logical true"
for `true`). I tried to avoid using the keyword itself or the word
"keyword" in the summary.

Later PRs can flesh out each keyword with an example of each
context in which a keyword can appear and a link to the rust book.

Keywords which are not close to stable rust such as `box` (which is
getting unstabilized) or `try` are ignored in this PR.
2019-05-16 14:46:33 -07:00
Esteban Küber
4117c6d33c Move some parser recovery methods to diagnostics 2019-05-16 14:31:07 -07:00
Esteban Küber
27a2881402 Fix span for await macro call 2019-05-16 14:30:39 -07:00
Esteban Küber
b9d6fe3ae9 Review comments
- Change wording of suggestion
- Move recovery logic to `diagnostics.rs`
- Reduce ammount of code duplication
2019-05-16 13:58:44 -07:00
Esteban Küber
0183a575f6 readd match await test case 2019-05-16 13:58:44 -07:00
Esteban Küber
c616605005 Point at enclosing fn/closure when it's not async 2019-05-16 13:58:44 -07:00
Esteban Küber
91c36c40bd tidy fix 2019-05-16 13:58:44 -07:00
Esteban Küber
01c6689604 Simplify span usage for incorrect await 2019-05-16 13:58:44 -07:00
Esteban Küber
ee02661474 Split parser logic to its own method 2019-05-16 13:56:44 -07:00
Esteban Küber
d763faf921 Parse alternative incorrect uses of await and recover 2019-05-16 13:56:44 -07:00
Manish Goregaokar
b80a906011
Rollup merge of #60887 - Manishearth:clippyup, r=Manishearth
Update clippy

r? @ghost
2019-05-16 12:31:49 -07:00
Manish Goregaokar
43ff70b8ce
Rollup merge of #60837 - jonas-schievink:releases-1.35.0, r=pietroalbini
Update release notes for 1.35.0

(Applied remaining nit, rebased onto master, and added CVE link to the 1.34.2 release notes, as discussed in the release team meeting)

r? @pietroalbini
2019-05-16 12:31:47 -07:00
Manish Goregaokar
e7f27947cf
Rollup merge of #60597 - wesleywiser:const_prop, r=oli-obk
Do some simple constant propagation in the ConstProp pass

r? @oli-obk

I added a few test cases. Let me know if you think there should be more.
2019-05-16 12:31:46 -07:00
Manish Goregaokar
2ae06976e4
Rollup merge of #60278 - ehuss:doc-html_root_url, r=GuillaumeGomez
Document the `html_root_url` doc attribute value.

I'm not sure if this was intentionally not documented, but I think it would be good to include. This was added in #9691.  `--extern-html-root-url` is unstable, but I don't think it hurts to mention it.
2019-05-16 12:31:44 -07:00
Manish Goregaokar
a6be03f2e7
Rollup merge of #60207 - felixrabe:patch-1, r=steveklabnik
Outdent example, preserving nested fence
2019-05-16 12:31:43 -07:00
Manish Goregaokar
6f3c8cd481 Update clippy 2019-05-16 12:11:32 -07:00
bors
7d5aa43325 Auto merge of #60874 - ehuss:update-cargo, r=alexcrichton
Update cargo

17 commits in 759b6161a328db1d4863139e90875308ecd25a75..c4fcfb725b4be00c72eb9cf30c7d8b095577c280
2019-05-06 20:47:49 +0000 to 2019-05-15 19:48:47 +0000
- tests: registry: revert readonly permission after running tests. (rust-lang/cargo#6947)
- Remove Candidate (rust-lang/cargo#6946)
- Fix for "Running cargo update without a Cargo.lock ignores arguments" rust-lang/cargo#6872 (rust-lang/cargo#6904)
- Fix a minor mistake in the changelog. (rust-lang/cargo#6944)
- Give a better error message when crates.io requests time out (rust-lang/cargo#6936)
- Re-enable compatibility with readonly CARGO_HOME (rust-lang/cargo#6940)
- Fix version of `ignore`. (rust-lang/cargo#6938)
- Stabilize offline mode. (rust-lang/cargo#6934)
- zsh: Add doc options to include non-public items documentation (rust-lang/cargo#6929)
- zsh: Suggest --lib option as binary template now the default (rust-lang/cargo#6926)
- Migrate package include/exclude to gitignore patterns. (rust-lang/cargo#6924)
- Implement the Cargo half of pipelined compilation (take 2) (rust-lang/cargo#6883)
- Always include `Cargo.toml` when packaging. (rust-lang/cargo#6925)
- Remove unnecessary calls to masquerade_as_nightly_cargo. (rust-lang/cargo#6923)
- download: fix "Downloaded 1 crates" message (crates -&gt; crate) (rust-lang/cargo#6920)
- Changed RUST_LOG usage to CARGO_LOG to avoid confusion. (rust-lang/cargo#6918)
- crate download: don't print that a crate was the largest download if it was the only download (rust-lang/cargo#6916)
2019-05-16 18:57:00 +00:00
Eric Huss
6a09cfab0b Update cargo 2019-05-16 10:31:13 -07:00
bors
1962adea6a Auto merge of #60877 - Centril:rollup-j0o5mo5, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #59825 (string: implement From<&String> for String)
 - #59923 (Fix convert module's documentation links)
 - #60691 (Include expression to wait for to the span of Await)
 - #60769 (Update rustc book CLI docs.)
 - #60816 (README.md: Mention MSVC 2017+, not 2013(!))
 - #60851 (Move `box` from the stable keyword to unstable keywords list)

Failed merges:

r? @ghost
2019-05-16 09:58:30 +00:00
Mazdak Farrokhzad
b59ce94bce
Rollup merge of #60851 - Pulkit07:issue60849, r=Centril
Move `box` from the stable keyword to unstable keywords list

Fixes #60849
2019-05-16 10:43:35 +02:00
Mazdak Farrokhzad
90952171ac
Rollup merge of #60816 - scottmcm:vcpp-download-link, r=alexcrichton
README.md: Mention MSVC 2017+, not 2013(!)

LLVM will soon require 2017+ (and our in-tree version just rejected the version of 2015 I was using), so update the mention and provide a link.

Ref: https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library
2019-05-16 10:43:34 +02:00
Mazdak Farrokhzad
6b299878ba
Rollup merge of #60769 - ehuss:rustc-cli-docs, r=steveklabnik
Update rustc book CLI docs.

This adds a little detail (and missing flags) to the rustc book. There is still a lot of information missing, but this seemed like a good step to expanding it.
2019-05-16 10:43:33 +02:00
Mazdak Farrokhzad
013e4daa41
Rollup merge of #60691 - topecongiro:await-macro-span, r=Centril
Include expression to wait for to the span of Await

Currently the span of `await!` only includes itself:

```rust
    await!(3);
//  ^^^^^
```

This PR changes it so that the span holds the whole `await!` expression:

```rust
    await!(3);
//  ^^^^^^^^^
2019-05-16 10:43:30 +02:00
Mazdak Farrokhzad
250fe9b37e
Rollup merge of #59923 - czipperz:fix-convert-doc-links, r=steveklabnik
Fix convert module's documentation links

r? @steveklabnik
2019-05-16 10:43:28 +02:00
Mazdak Farrokhzad
f08c5bbc85
Rollup merge of #59825 - jsgf:from-ref-string, r=sfackler
string: implement From<&String> for String

Allow Strings to be created from borrowed Strings. This is mostly
to make things like passing `&String` to an `impl Into<String>`
parameter frictionless.

Fixes #59827.
2019-05-16 10:43:24 +02:00
bors
472211ab0a Auto merge of #60811 - wesleywiser:bump_measureme, r=varkor
Bump measureme dependency to 0.3

measureme@0.3 adds a version header to the binary file format which will
help reduce tool breakage in the future.
2019-05-16 07:04:03 +00:00
bors
024c25dc79 Auto merge of #60763 - matklad:tt-parser, r=petrochenkov
Move token tree related lexer state to a separate struct

Just a types-based refactoring.

We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
2019-05-16 04:15:12 +00:00
bors
49d139c64b Auto merge of #60693 - saleemjaffer:refactor_fntype_stuff, r=eddyb
refactor some `FnType` stuff to `rustc::ty::layout`

Does work in the direction of #56166.
2019-05-16 01:26:13 +00:00
Santiago Pastorino
6d207f53a4 Get ty from local_decls instead of using Place 2019-05-15 21:24:18 +02:00
Pulkit Goyal
65d09ea468 Move box from the stable keyword to unstable keywords list
Fixes #60849
2019-05-15 16:22:39 +03:00