]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoappveyor: Use VS2017 for all our images
Alex Crichton [Tue, 13 Nov 2018 21:42:05 +0000 (13:42 -0800)]
appveyor: Use VS2017 for all our images

Originally added in #55935 to test build times, this was reverted
in #56201 due to a belief that it caused the exit code 259 spurious
errors. We've since learned, however, that the 259 exit code is likely
not related to this image update as we're getting it in a number of
locations now.

VS2017 looks like it may be required to compile LLVm in the near future,
notably discovered by #58408 where we attempted to update LLVM.

5 years agoAdd back in MSVC version check for LLVM
Alex Crichton [Fri, 1 Mar 2019 19:26:19 +0000 (11:26 -0800)]
Add back in MSVC version check for LLVM

5 years agoAuto merge of #58631 - spastorino:place2_1, r=oli-obk
bors [Fri, 1 Mar 2019 10:00:17 +0000 (10:00 +0000)]
Auto merge of #58631 - spastorino:place2_1, r=oli-obk

Put Local, Static and Promoted as one Base variant of Place

Related to #52708

The `Place` 2.0 representation use a `Base` variant for `Local`, `Static` and `Promoted` so we start making this change in the current `Place` to make the following steps simpler.

r? @oli-obk

5 years agoAuto merge of #58689 - memoryruins:exclude_should_panic, r=oli-obk
bors [Fri, 1 Mar 2019 05:17:14 +0000 (05:17 +0000)]
Auto merge of #58689 - memoryruins:exclude_should_panic, r=oli-obk

Add unstable option to ignore should_panic tests

Add an unstable option `--exclude-should-panic` to libtest to workaround https://github.com/rust-lang/miri/issues/636

?r @oli-obk
cc @RalfJung

5 years agoPut Local, Static and Promoted as one Base variant of Place
Santiago Pastorino [Fri, 22 Feb 2019 04:24:03 +0000 (05:24 +0100)]
Put Local, Static and Promoted as one Base variant of Place

5 years agoAuto merge of #58408 - alexcrichton:update-llvm, r=michaelwoerister
bors [Fri, 1 Mar 2019 01:22:15 +0000 (01:22 +0000)]
Auto merge of #58408 - alexcrichton:update-llvm, r=michaelwoerister

rustc: Update LLVM, remove dead wasm code

This commit updates the LLVM branch to the rebased version of the
upstream release/8.x branch. This includes a wasm patch which means that
the `rewrite_imports` pass in rustc is no longer needed (yay!) and we
can instead rely on `wasm-import-module`, an attribute we're already
emitting, to take care of all the work.

5 years agoAuto merge of #58250 - Zoxc:rustc-interface-1, r=oli-obk
bors [Thu, 28 Feb 2019 21:02:12 +0000 (21:02 +0000)]
Auto merge of #58250 - Zoxc:rustc-interface-1, r=oli-obk

Introduce rustc_interface and move some methods there

Split out from https://github.com/rust-lang/rust/pull/56732

r? @oli-obk

5 years agoIntroduce rustc_interface and move some methods there
John Kåre Alsaker [Sat, 8 Dec 2018 19:30:23 +0000 (20:30 +0100)]
Introduce rustc_interface and move some methods there

5 years agoAuto merge of #57760 - dlrobertson:varargs1, r=alexreg
bors [Thu, 28 Feb 2019 15:00:25 +0000 (15:00 +0000)]
Auto merge of #57760 - dlrobertson:varargs1, r=alexreg

Support defining C compatible variadic functions

## Summary

Add support for defining C compatible variadic functions in unsafe rust with
`extern "C"` according to [RFC 2137].

## Details

### Parsing
When parsing a user defined function that is `unsafe` and `extern "C"` allow
variadic signatures and inject a "spoofed" `VaList` in the new functions
signature. This allows the user to interact with the variadic arguments via a
`VaList` instead of manually using `va_start` and `va_end` (See [RFC 2137] for
details).

### Codegen

When running codegen for a variadic function, remove the "spoofed" `VaList`
from the function signature and inject `va_start` when the arg local
references are created for the function and `va_end` on return.

## TODO

 - [x] Get feedback on injecting `va_start/va_end` in MIR vs codegen
 - [x] Properly inject `va_end` - It seems like it should be possible to inject
       `va_end` on the `TerminatorKind::Return`. I just need to figure out how
       to get the `LocalRef` here.
 - [x] Properly call Rust defined C variadic functions in Rust - The spoofed
       `VaList` causes problems here.

Related to: #44930

r? @ghost

[RFC 2137]: https://github.com/rust-lang/rfcs/blob/master/text/2137-variadic.md

5 years agoAuto merge of #58208 - taiki-e:libstd-2018, r=Centril
bors [Thu, 28 Feb 2019 11:38:40 +0000 (11:38 +0000)]
Auto merge of #58208 - taiki-e:libstd-2018, r=Centril

libstd => 2018

Transitions `libstd` to Rust 2018; cc #58099

r? @Centril

5 years agoFix rebase fail
Taiki Endo [Wed, 27 Feb 2019 07:15:56 +0000 (16:15 +0900)]
Fix rebase fail

5 years agoFix some imports and paths
Taiki Endo [Sun, 17 Feb 2019 13:35:20 +0000 (22:35 +0900)]
Fix some imports and paths

5 years agoFix error in tag-that-dare-not-speak-its-name
Taiki Endo [Fri, 15 Feb 2019 14:54:05 +0000 (23:54 +0900)]
Fix error in tag-that-dare-not-speak-its-name

5 years agoFix errors in test/ui
Taiki Endo [Fri, 15 Feb 2019 11:31:00 +0000 (20:31 +0900)]
Fix errors in test/ui

5 years agoRevert removed #![feature(nll)]
Taiki Endo [Sun, 10 Feb 2019 19:25:30 +0000 (04:25 +0900)]
Revert removed #![feature(nll)]

5 years agoFix #[macro_use] extern crate in sys/cloudabi
Taiki Endo [Sun, 10 Feb 2019 19:24:34 +0000 (04:24 +0900)]
Fix #[macro_use] extern crate in sys/cloudabi

5 years agolibstd => 2018
Taiki Endo [Sun, 10 Feb 2019 19:23:21 +0000 (04:23 +0900)]
libstd => 2018

5 years agoWhitelist containers that allow older toolchains
Alex Crichton [Wed, 27 Feb 2019 16:03:54 +0000 (08:03 -0800)]
Whitelist containers that allow older toolchains

We'll use this as a temporary measure to get an LLVM update landed, but
we'll have to go through and update images later to make sure they've
got the right toolchains.

5 years agoAuto merge of #58777 - Centril:rollup, r=Centril
bors [Wed, 27 Feb 2019 15:54:48 +0000 (15:54 +0000)]
Auto merge of #58777 - Centril:rollup, r=Centril

Rollup of 14 pull requests

Successful merges:

 - #58075 (Fix for issue  #58050)
 - #58627 (rustdoc: move collapse and unindent docs passes earlier)
 - #58630 (Make `visit_clobber` panic-safe.)
 - #58678 (Deny `async fn` in 2015 edition)
 - #58680 (Fix an indexing error when using `x.py help`)
 - #58703 (Fix copy-pasted typo for read_string return value)
 - #58744 (Update dlmalloc to 0.1.3)
 - #58746 (std: docs: Disable running several Stdio doctests)
 - #58748 (update scoped_tls to 1.0)
 - #58749 (Reduce Repetitions of (n << amt) >> amt)
 - #58752 (Update string_cache_codegen to 0.4.2)
 - #58755 (Clarify `rotate_{left,right}` docs)
 - #58757 (Normalize the type Self resolves to in an impl)
 - #58761 (Add tracking issue for the unwind attribute)

Failed merges:

r? @ghost

5 years agoFix doc comments in librustc/hir/lowering.rs
Dan Robertson [Sun, 24 Feb 2019 00:17:25 +0000 (00:17 +0000)]
Fix doc comments in librustc/hir/lowering.rs

5 years agoRename variadic to c_variadic
Dan Robertson [Fri, 8 Feb 2019 17:30:42 +0000 (17:30 +0000)]
Rename variadic to c_variadic

Function signatures with the `variadic` member set are actually
C-variadic functions. Make this a little more explicit by renaming the
`variadic` boolean value, `c_variadic`.

5 years agoRefactor FunctionCx::codgen_terminator
Dan Robertson [Sat, 2 Feb 2019 16:34:09 +0000 (16:34 +0000)]
Refactor FunctionCx::codgen_terminator

 - Move closures defined in codegen_terminator into a separate helper
   structure and implementation.
 - Create helper functions for each of the complex match arms on the
   terminators kind in codegen_terminator.

5 years agoAdd c_variadic to the unstable-book
Dan Robertson [Sun, 24 Feb 2019 22:40:49 +0000 (22:40 +0000)]
Add c_variadic to the unstable-book

 - Add the c_variadic language feature
 - Add the c_variadic library feature

5 years agoAdd c_variadic language feature item
Dan Robertson [Sun, 24 Feb 2019 22:40:11 +0000 (22:40 +0000)]
Add c_variadic language feature item

5 years agoSupport defining C compatible variadic functions
Dan Robertson [Fri, 30 Nov 2018 15:53:44 +0000 (15:53 +0000)]
Support defining C compatible variadic functions

Add support for defining C compatible variadic functions in unsafe rust
with extern "C".

5 years agoFix tidy check for language and library features
Dan Robertson [Tue, 26 Feb 2019 17:02:28 +0000 (17:02 +0000)]
Fix tidy check for language and library features

5 years agoRollup merge of #58761 - Mark-Simulacrum:add-feature-gate-unwind, r=Centril
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:37 +0000 (13:32 +0100)]
Rollup merge of #58761 - Mark-Simulacrum:add-feature-gate-unwind, r=Centril

Add tracking issue for the unwind attribute

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

5 years agoRollup merge of #58757 - aoikonomopoulos:issue-58212, r=oli-obk
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:36 +0000 (13:32 +0100)]
Rollup merge of #58757 - aoikonomopoulos:issue-58212, r=oli-obk

Normalize the type Self resolves to in an impl

This is required at the very least in order to evaluate associated
constants for arrays.

Fixes #57796
Fixes #58212.

r? @oli-obk
cc @hellow554

5 years agoRollup merge of #58755 - tbu-:pr_doc_clarifyrotate, r=Centril
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:34 +0000 (13:32 +0100)]
Rollup merge of #58755 - tbu-:pr_doc_clarifyrotate, r=Centril

Clarify `rotate_{left,right}` docs

I wondered what the `<<!` operator is although the exclamation mark was
only the end of the sentence.

5 years agoRollup merge of #58752 - taiki-e:update-string_cache_codegen, r=alexcrichton
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:33 +0000 (13:32 +0100)]
Rollup merge of #58752 - taiki-e:update-string_cache_codegen, r=alexcrichton

Update string_cache_codegen to 0.4.2

This removes two dependencies of the old version (string_cache is already the latest version).

5 years agoRollup merge of #58749 - kenta7777:reduce-repetition, r=oli-obk
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:31 +0000 (13:32 +0100)]
Rollup merge of #58749 - kenta7777:reduce-repetition, r=oli-obk

Reduce Repetitions of (n << amt) >> amt

Fixes part of [#49937](https://github.com/rust-lang/rust/issues/49937).

5 years agoRollup merge of #58748 - hellow554:scoped_tls, r=estebank
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:29 +0000 (13:32 +0100)]
Rollup merge of #58748 - hellow554:scoped_tls, r=estebank

update scoped_tls to 1.0

scoped_tls has been updated to version 1.0
This PR will hopefully merge flawlessly :)

This fixes, among others, https://github.com/alexcrichton/scoped-tls/issues/9

Note, that the nightly feature has been removed in https://github.com/alexcrichton/scoped-tls/commit/64bd7b84a1765fb72a32caed3c17c970bdc6ad57

5 years agoRollup merge of #58746 - ipetkov:std-process-docs, r=cramertj
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:27 +0000 (13:32 +0100)]
Rollup merge of #58746 - ipetkov:std-process-docs, r=cramertj

std: docs: Disable running several Stdio doctests

* A number of `Stdio` related doc examples include running the "rev"
command to illustrate piping commands. The majority of these tests are
marked as `no_run` except for two tests which were not
* Not running these tests is unlikely to cause any negative impact, and
doing so also allows the test suite to pass in environments where the
"rev" command is unavailable

5 years agoRollup merge of #58744 - jethrogb:jb/dlmalloc-0.1.3, r=alexcrichton
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:26 +0000 (13:32 +0100)]
Rollup merge of #58744 - jethrogb:jb/dlmalloc-0.1.3, r=alexcrichton

Update dlmalloc to 0.1.3

r? @alexcrichton

5 years agoRollup merge of #58703 - shepmaster:read_line_return, r=centril
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:24 +0000 (13:32 +0100)]
Rollup merge of #58703 - shepmaster:read_line_return, r=centril

Fix copy-pasted typo for read_string return value

5 years agoRollup merge of #58680 - varkor:xpy-help-index-error, r=alexcrichton
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:23 +0000 (13:32 +0100)]
Rollup merge of #58680 - varkor:xpy-help-index-error, r=alexcrichton

Fix an indexing error when using `x.py help`

Fixes https://github.com/rust-lang/rust/issues/58640.

5 years agoRollup merge of #58678 - doctorn:refuse-async-fn-2015-edition, r=varkor
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:21 +0000 (13:32 +0100)]
Rollup merge of #58678 - doctorn:refuse-async-fn-2015-edition, r=varkor

Deny `async fn` in 2015 edition

This commit prevents code using `async fn` from being compiled in Rust 2015 edition.

Compiling code of the form:

```rust
async fn foo() {}
```

Will now result in the error:

```
error[E0670]: `async fn` is not permitted in the 2015 edition
 --> async.rs:1:1
  |
1 | async fn foo() {}
  | ^^^^^

error: aborting due to error

For more information about an error, try `rustc --explain E0670`.
```

This resolves #58652 and also resolves #53714.

r? @varkor

5 years agoRollup merge of #58630 - nnethercote:fix-fold_clobber, r=petrochenkov
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:19 +0000 (13:32 +0100)]
Rollup merge of #58630 - nnethercote:fix-fold_clobber, r=petrochenkov

Make `visit_clobber` panic-safe.

Local measurements indicate the performance effect is negligible.

r? @petrochenkov

5 years agoRollup merge of #58627 - euclio:rustdoc-pass-order, r=QuietMisdreavus
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:18 +0000 (13:32 +0100)]
Rollup merge of #58627 - euclio:rustdoc-pass-order, r=QuietMisdreavus

rustdoc: move collapse and unindent docs passes earlier

Moves these passes as early as possible so later passes will see the same markdown that is passed to the test collector.

Fixes #58473, and a similar issue with the private-doc-tests lint.

r? @QuietMisdreavus

5 years agoRollup merge of #58075 - asettouf:master, r=varkor
Mazdak Farrokhzad [Wed, 27 Feb 2019 12:32:16 +0000 (13:32 +0100)]
Rollup merge of #58075 - asettouf:master, r=varkor

Fix for issue  #58050

Hi,

a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue #58050

It passed `python x.py test src/tools/tidy`  locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`.

Let me know if anything else is needed.

5 years agoAuto merge of #58741 - varkor:lang-lib-feature-shared-name, r=alexreg
bors [Wed, 27 Feb 2019 12:22:13 +0000 (12:22 +0000)]
Auto merge of #58741 - varkor:lang-lib-feature-shared-name, r=alexreg

Allow lang and lib features to share names

Fixes https://github.com/rust-lang/rust/issues/58715.

I didn't add a test, because there's currently no standard lang test feature and I felt apprehensive about adding a permanently unstable feature. Instead, a shared lang/lib feature will be used in https://github.com/rust-lang/rust/pull/57760 and will essentially provide an immediately test.

5 years agoAuto merge of #58709 - kornelski:book, r=QuietMisdreavus
bors [Wed, 27 Feb 2019 07:53:56 +0000 (07:53 +0000)]
Auto merge of #58709 - kornelski:book, r=QuietMisdreavus

Update book submodule

Updates the book to the latest commit

This is to include [documentation SEO fix](https://github.com/rust-lang/book/pull/1788) ASAP.

5 years agoAuto merge of #58321 - csmoe:substs, r=oli-obk
bors [Wed, 27 Feb 2019 01:22:13 +0000 (01:22 +0000)]
Auto merge of #58321 - csmoe:substs, r=oli-obk

[Step 1] Implement "small substs optimization" for substs of length 1

addresses part of #58310
r?@arielb1

5 years agoAdd tracking issue for the unwind attribute.
Mark Rousskov [Tue, 26 Feb 2019 19:20:38 +0000 (12:20 -0700)]
Add tracking issue for the unwind attribute.

5 years agoAuto merge of #58675 - gnzlbg:usimd, r=alexcrichton
bors [Tue, 26 Feb 2019 18:26:35 +0000 (18:26 +0000)]
Auto merge of #58675 - gnzlbg:usimd, r=alexcrichton

Update stdsimd

This updates stdsimd to a Rust2015 / Rust2018 compatible version. Once this is merged it should be possible to migrate libcore and libstd to Rust2018. Once that happens, we can just require the 2018 edition in stdsimd.

5 years agoChanging error message to reflect changes with the 2018 edition
Adonis [Sat, 2 Feb 2019 11:03:38 +0000 (12:03 +0100)]
Changing error message to reflect changes with the 2018 edition

Signed-off-by: Adonis <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr

Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr

Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Stabilize split_ascii_whitespace

Tracking issue FCP to merge: https://github.com/rust-lang/rust/issues/48656#issuecomment-442372750

fix stabilization order of uniform_paths.

hir: add HirId to main Hir nodes

Fix `std::os::fortanix_sgx::usercalls::raw::UsercallNrs`

Fixes https://github.com/fortanix/rust-sgx/issues/88

Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>
Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit 751f05bd155e2c55d4177fe8211df634faf3a644, reversing
changes made to 545a3e62b0cb473108869a61b271bc589afb49da.

5 years agorename Substs to InternalSubsts
csmoe [Tue, 26 Feb 2019 01:30:34 +0000 (09:30 +0800)]
rename Substs to InternalSubsts

Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18

5 years agoNormalize the type Self resolves to in an impl
Angelos Oikonomopoulos [Tue, 26 Feb 2019 15:48:12 +0000 (16:48 +0100)]
Normalize the type Self resolves to in an impl

This is required at the very least in order to evaluate associated
constants for arrays (see #58212).

5 years agorustc: Update LLVM, remove dead wasm code
Alex Crichton [Tue, 12 Feb 2019 18:20:34 +0000 (10:20 -0800)]
rustc: Update LLVM, remove dead wasm code

This commit updates the LLVM branch to the rebased version of the
upstream release/8.x branch. This includes a wasm patch which means that
the `rewrite_imports` pass in rustc is no longer needed (yay!) and we
can instead rely on `wasm-import-module`, an attribute we're already
emitting, to take care of all the work.

5 years agoClarify `rotate_{left,right}` docs
Tobias Bucher [Tue, 26 Feb 2019 15:10:28 +0000 (16:10 +0100)]
Clarify `rotate_{left,right}` docs

I wondered what the `<<!` operator is although the exclamation mark was
only the end of the sentence.

5 years agoreplace &'tcx Substs with SubstsRef
csmoe [Sat, 9 Feb 2019 14:11:53 +0000 (22:11 +0800)]
replace &'tcx Substs with SubstsRef

5 years agoUpdate string_cache_codegen to 0.4.2
Taiki Endo [Tue, 26 Feb 2019 11:06:31 +0000 (20:06 +0900)]
Update string_cache_codegen to 0.4.2

5 years agoupdate Cargo.lock
Marcel Hellwig [Tue, 26 Feb 2019 10:15:52 +0000 (11:15 +0100)]
update Cargo.lock

5 years agoreduce repetitions of (n << amt) >> amt
kenta7777 [Tue, 26 Feb 2019 08:54:57 +0000 (17:54 +0900)]
reduce repetitions of (n << amt) >> amt

5 years agoupdate scoped_tls to 1.0
Marcel Hellwig [Tue, 26 Feb 2019 08:54:45 +0000 (09:54 +0100)]
update scoped_tls to 1.0

5 years agoAuto merge of #58561 - ljedrz:HirIdify_some_nodes, r=Zoxc
bors [Tue, 26 Feb 2019 06:13:27 +0000 (06:13 +0000)]
Auto merge of #58561 - ljedrz:HirIdify_some_nodes, r=Zoxc

Remove NodeId from some HIR nodes

The next iteration of https://github.com/rust-lang/rust/pull/57578.

Removes `NodeId` from:

- [x] `Lifetime`
- [x] `Ty`
- [x] `GenericParam`
- [x] `WhereClause`
- [x] `WhereEqPredicate`
- [x] `MacroDef`
- [x] `Block`
- [x] `Expr`

r? @Zoxc

5 years agoDisable running several Stdio doctests
Ivan Petkov [Tue, 26 Feb 2019 03:49:49 +0000 (19:49 -0800)]
Disable running several Stdio doctests

* A number of `Stdio` related doc examples include running the "rev"
command to illustrate piping commands. The majority of these tests are
marked as `no_run` except for two tests which were not
* Not running these tests is unlikely to cause any negative impact, and
doing so also allows the test suite to pass in environments where the
"rev" command is unavailable

5 years agoAuto merge of #58357 - sfackler:vectored-io, r=alexcrichton
bors [Tue, 26 Feb 2019 02:48:13 +0000 (02:48 +0000)]
Auto merge of #58357 - sfackler:vectored-io, r=alexcrichton

Add vectored read and write support

This functionality has lived for a while in the tokio ecosystem, where
it can improve performance by minimizing copies.

r? @alexcrichton

5 years agoMake `visit_clobber` panic-safe.
Nicholas Nethercote [Fri, 22 Feb 2019 02:36:04 +0000 (13:36 +1100)]
Make `visit_clobber` panic-safe.

5 years agoUpdate dlmalloc to 0.1.3
Jethro Beekman [Tue, 26 Feb 2019 00:18:22 +0000 (09:18 +0900)]
Update dlmalloc to 0.1.3

5 years agoAuto merge of #57367 - petrochenkov:unrestab, r=Centril
bors [Mon, 25 Feb 2019 23:23:09 +0000 (23:23 +0000)]
Auto merge of #57367 - petrochenkov:unrestab, r=Centril

Stabilize `unrestricted_attribute_tokens`

In accordance with a plan described in https://internals.rust-lang.org/t/unrestricted-attribute-tokens-feature-status/8561/3.

Delimited non-macro non-builtin attributes now support the same syntax as macro attributes:
```
PATH
PATH `(` TOKEN_STREAM `)`
PATH `[` TOKEN_STREAM `]`
PATH `{` TOKEN_STREAM `}`
```
Such attributes mostly serve as inert proc macro helpers or tool attributes.
To some extent these attributes are de-facto stable due to a hole in feature gate checking (feature gating is done too late - after macro expansion.)
So if macro *removes* such helper attributes during expansion (and it must remove them, unless it's a derive macro), then the code will work on stable.

Key-value non-macro non-builtin attributes are now restricted to bare minimum required to support what we support on stable - unsuffixed literals (https://github.com/rust-lang/rust/issues/34981).
```
PATH `=` LITERAL
```
(Key-value macro attributes are not supported at all right now.)
Crater run in https://github.com/rust-lang/rust/pull/57321 found no regressions for this change.
There are multiple possible ways to extend key-value attributes (https://github.com/rust-lang/rust/pull/57321#issuecomment-451574065), but I'd expect an RFC for that and it's not a pressing enough issue to block stabilization of delimited attributes.

Built-in attributes are still restricted to the "classic" meta-item syntax, nothing changes here.
https://github.com/rust-lang/rust/pull/57321 goes further and adds some additional restrictions (more consistent input checking) to built-in attributes.

Closes https://github.com/rust-lang/rust/issues/55208

5 years agoAllow lang and lib features to share names
varkor [Mon, 25 Feb 2019 22:14:18 +0000 (22:14 +0000)]
Allow lang and lib features to share names

5 years agoAuto merge of #58302 - SimonSapin:tryfrom, r=alexcrichton
bors [Mon, 25 Feb 2019 20:24:10 +0000 (20:24 +0000)]
Auto merge of #58302 - SimonSapin:tryfrom, r=alexcrichton

Stabilize TryFrom and TryInto with a convert::Infallible empty enum

This is the plan proposed in https://github.com/rust-lang/rust/issues/33417#issuecomment-423073898

5 years agoStabilize `unrestricted_attribute_tokens`
Vadim Petrochenkov [Mon, 25 Feb 2019 19:40:44 +0000 (22:40 +0300)]
Stabilize `unrestricted_attribute_tokens`

5 years agoRestrict value in key-value attributes to literals
Vadim Petrochenkov [Thu, 3 Jan 2019 23:57:11 +0000 (02:57 +0300)]
Restrict value in key-value attributes to literals

5 years agoFix copy-pasted typo for read_string return value
Jake Goulding [Sun, 24 Feb 2019 15:01:27 +0000 (10:01 -0500)]
Fix copy-pasted typo for read_string return value

5 years agoAuto merge of #58649 - pnkfelix:issue-57464-avoid-ice-when-region-sneaks-into-impl...
bors [Mon, 25 Feb 2019 14:48:29 +0000 (14:48 +0000)]
Auto merge of #58649 - pnkfelix:issue-57464-avoid-ice-when-region-sneaks-into-impl-trait, r=pnkfelix

avoid ICE when region sneaks into impl trait

Addresses non-NLL instances of #57464

5 years agoUpdate book submodule
Kornel [Sun, 24 Feb 2019 17:44:59 +0000 (17:44 +0000)]
Update book submodule

5 years agoAuto merge of #58728 - Centril:rollup, r=Centril
bors [Mon, 25 Feb 2019 11:57:00 +0000 (11:57 +0000)]
Auto merge of #58728 - Centril:rollup, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #55632 (Deny the `overflowing_literals` lint for all editions)
 - #58687 (Reduce Miri Code Repetition like `(n << amt) >> amt`)
 - #58690 (Reduce a Code Repetition like `(n << amt) >> amt`)
 - #58718 (Apply docs convention: Replace # Unsafety with # Safety in docs)
 - #58719 (librustc_codegen_llvm: #![deny(elided_lifetimes_in_paths)])
 - #58720 (librustc_codegen_ssa: #![deny(elided_lifetimes_in_paths)])
 - #58722 (librustc_typeck: deny(elided_lifetimes_in_paths))
 - #58723 (librustc: deny(elided_lifetimes_in_paths))
 - #58725 (Test that binop subtyping in rustc_typeck fixes #27949)
 - #58727 (bootstrap: deny(rust_2018_idioms))

Failed merges:

r? @ghost

5 years agoRollup merge of #58727 - taiki-e:deny-rust_2018_idioms-bootstrap, r=Centril
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:31 +0000 (11:42 +0100)]
Rollup merge of #58727 - taiki-e:deny-rust_2018_idioms-bootstrap, r=Centril

bootstrap: deny(rust_2018_idioms)

As part of the Rust 2018 transition, apply `#![deny(rust_2018_idioms)]` to `bootstrap`.

r? @Centril

5 years agoRollup merge of #58725 - jamwt:fix-27949, r=Centril
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:30 +0000 (11:42 +0100)]
Rollup merge of #58725 - jamwt:fix-27949, r=Centril

Test that binop subtyping in rustc_typeck fixes #27949

5 years agoRollup merge of #58723 - Centril:deny-elided_lifetimes_in_paths-librustc, r=oli-obk
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:28 +0000 (11:42 +0100)]
Rollup merge of #58723 - Centril:deny-elided_lifetimes_in_paths-librustc, r=oli-obk

librustc: deny(elided_lifetimes_in_paths)

As part of the Rust 2018 transition, remove `#![allow(elided_lifetimes_in_paths)]` from `librustc`.

r? @oli-obk

5 years agoRollup merge of #58722 - Centril:deny-elided_lifetimes_in_paths-librustc_typeck,...
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:27 +0000 (11:42 +0100)]
Rollup merge of #58722 - Centril:deny-elided_lifetimes_in_paths-librustc_typeck, r=oli-obk

librustc_typeck: deny(elided_lifetimes_in_paths)

As part of the Rust 2018 transition, remove `#![allow(elided_lifetimes_in_paths)]` from `librustc_typeck`.

r? @oli-obk

5 years agoRollup merge of #58720 - Centril:deny-elided_lifetimes_in_paths-librustc_codegen_ssa...
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:25 +0000 (11:42 +0100)]
Rollup merge of #58720 - Centril:deny-elided_lifetimes_in_paths-librustc_codegen_ssa, r=oli-obk

librustc_codegen_ssa: #![deny(elided_lifetimes_in_paths)]

As part of the Rust 2018 transition, remove `#![allow(elided_lifetimes_in_paths)]` from `librustc_codegen_ssa`.

r? @oli-obk

5 years agoRollup merge of #58719 - Centril:deny-elided_lifetimes_in_paths, r=oli-obk
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:24 +0000 (11:42 +0100)]
Rollup merge of #58719 - Centril:deny-elided_lifetimes_in_paths, r=oli-obk

librustc_codegen_llvm: #![deny(elided_lifetimes_in_paths)]

As part of the Rust 2018 transition, remove `#![allow(elided_lifetimes_in_paths)]` from `librustc_codegen_llvm`.

r? @oli-obk

5 years agoRollup merge of #58718 - Centril:doc-convention-safety, r=RalfJung
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:23 +0000 (11:42 +0100)]
Rollup merge of #58718 - Centril:doc-convention-safety, r=RalfJung

Apply docs convention: Replace # Unsafety with # Safety in docs

As used in RFC 1574: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#using-markdown

"Safety" is used many times more than "Unsafety" is within existing docs.

@bors rollup

r? @RalfJung

5 years agoRollup merge of #58690 - kenta7777:reduce-code-repetition-miri-related, r=oli-obk
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:22 +0000 (11:42 +0100)]
Rollup merge of #58690 - kenta7777:reduce-code-repetition-miri-related, r=oli-obk

Reduce a Code Repetition like `(n << amt) >> amt`

Fixes a part of [#49937](https://github.com/rust-lang/rust/issues/49937).

5 years agoRollup merge of #58687 - kenta7777:reduce-miri-code-repetition, r=oli-obk
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:20 +0000 (11:42 +0100)]
Rollup merge of #58687 - kenta7777:reduce-miri-code-repetition, r=oli-obk

Reduce Miri Code Repetition like `(n << amt) >> amt`

This Pull Request fixes a part of [#49937](https://github.com/rust-lang/rust/issues/49937).

5 years agoRollup merge of #55632 - ollie27:deny_overflowing_literals, r=Centril
Mazdak Farrokhzad [Mon, 25 Feb 2019 10:42:18 +0000 (11:42 +0100)]
Rollup merge of #55632 - ollie27:deny_overflowing_literals, r=Centril

Deny the `overflowing_literals` lint for all editions

The `overflowing_literals` was made deny by default for the 2018 edition by #54507, however I'm not aware of any reason it can't be made deny by default for the 2015 edition as well.

5 years agobootstrap: deny(rust_2018_idioms)
Taiki Endo [Mon, 25 Feb 2019 10:30:32 +0000 (19:30 +0900)]
bootstrap: deny(rust_2018_idioms)

5 years agoupdate clippy
ljedrz [Sun, 24 Feb 2019 18:47:40 +0000 (19:47 +0100)]
update clippy

5 years agoTest that binop subtyping in rustc_typeck fixes #27949
Jamie Turner [Mon, 25 Feb 2019 08:33:44 +0000 (00:33 -0800)]
Test that binop subtyping in rustc_typeck fixes #27949

5 years agolibrustc: deny(elided_lifetimes_in_paths)
Mazdak Farrokhzad [Mon, 25 Feb 2019 08:19:20 +0000 (09:19 +0100)]
librustc: deny(elided_lifetimes_in_paths)

5 years agolibrustc_typeck: deny(elided_lifetimes_in_paths)
Mazdak Farrokhzad [Mon, 25 Feb 2019 08:09:02 +0000 (09:09 +0100)]
librustc_typeck: deny(elided_lifetimes_in_paths)

5 years agolibrustc_codegen_ssa: deny(elided_lifetimes_in_paths)
Mazdak Farrokhzad [Mon, 25 Feb 2019 07:52:46 +0000 (08:52 +0100)]
librustc_codegen_ssa: deny(elided_lifetimes_in_paths)

5 years agolibrustc_codegen_llvm: deny(elided_lifetimes_in_paths)
Mazdak Farrokhzad [Mon, 25 Feb 2019 07:40:18 +0000 (08:40 +0100)]
librustc_codegen_llvm: deny(elided_lifetimes_in_paths)

5 years agoheading # Unsafety => # Safety in stdlib docs.
Mazdak Farrokhzad [Mon, 25 Feb 2019 07:01:35 +0000 (08:01 +0100)]
heading # Unsafety => # Safety in stdlib docs.

5 years agoAuto merge of #57609 - matthewjasper:more-restrictive-match, r=pnkfelix
bors [Mon, 25 Feb 2019 06:27:35 +0000 (06:27 +0000)]
Auto merge of #57609 - matthewjasper:more-restrictive-match, r=pnkfelix

Use normal mutable borrows in matches

`ref mut` borrows are currently two-phase with NLL enabled. This changes them to be proper mutable borrows. To accommodate this, first the position of fake borrows is changed:

```text
[ 1. Pre-match ]
       |
[ (old create fake borrows) ]
[ 2. Discriminant testing -- check discriminants ] <-+
       |                                             |
       | (once a specific arm is chosen)             |
       |                                             |
[ (old read fake borrows) ]                          |
[ 3. Create "guard bindings" for arm ]               |
[ (create fake borrows) ]                            |
       |                                             |
[ 4. Execute guard code ]                            |
[ (read fake borrows) ] --(guard is false)-----------+
       |
       | (guard results in true)
       |
[ 5. Create real bindings and execute arm ]
       |
[ Exit match ]
```

The following additional changes are made to accommodate `ref mut` bindings:

* We no longer create fake `Shared` borrows. These borrows are no longer needed for soundness, just to avoid some arguably strange cases.
* `Shallow` borrows no longer conflict with existing borrows, avoiding conflicting access between the guard borrow access and the `ref mut` borrow.

There is some further clean up done in this PR:

* Avoid the "later used here" note for Shallow borrows (since it's not relevant with the message provided)
* Make any use of a two-phase borrow activate it.
* Simplify the cleanup_post_borrowck passes into a single pass.

cc #56254

r? @nikomatsakis

5 years agoAuto merge of #58714 - Centril:rollup, r=Centril
bors [Mon, 25 Feb 2019 03:48:12 +0000 (03:48 +0000)]
Auto merge of #58714 - Centril:rollup, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #58370 (Relax some Hash bounds on HashMap<K, V, S> and HashSet<T, S>)
 - #58421 (Relax some Ord bounds on BinaryHeap<T>)
 - #58686 (replace deprecated rustfmt_skip with rustfmt::skip)
 - #58697 (Use ? in some macros)
 - #58704 (Remove some unnecessary 'extern crate')

Failed merges:

r? @ghost

5 years agoFix redox
Steven Fackler [Mon, 25 Feb 2019 02:48:44 +0000 (18:48 -0800)]
Fix redox

5 years agoRollup merge of #58704 - taiki-e:extern-crate, r=Centril
Mazdak Farrokhzad [Mon, 25 Feb 2019 02:18:06 +0000 (03:18 +0100)]
Rollup merge of #58704 - taiki-e:extern-crate, r=Centril

Remove some unnecessary 'extern crate'

cc #58099

r? @Centril

5 years agoRollup merge of #58697 - taiki-e:question-in-macros, r=Centril
Mazdak Farrokhzad [Mon, 25 Feb 2019 02:18:04 +0000 (03:18 +0100)]
Rollup merge of #58697 - taiki-e:question-in-macros, r=Centril

Use ? in some macros

5 years agoRollup merge of #58686 - hellow554:rustfmt_depr, r=cramertj
Mazdak Farrokhzad [Mon, 25 Feb 2019 02:18:03 +0000 (03:18 +0100)]
Rollup merge of #58686 - hellow554:rustfmt_depr, r=cramertj

replace deprecated rustfmt_skip with rustfmt::skip

5 years agoRollup merge of #58421 - nox:relax-bounds-binary-heap, r=dtolnay
Mazdak Farrokhzad [Mon, 25 Feb 2019 02:18:01 +0000 (03:18 +0100)]
Rollup merge of #58421 - nox:relax-bounds-binary-heap, r=dtolnay

Relax some Ord bounds on BinaryHeap<T>

Notably, iterators don't require any trait bounds to be iterated.

5 years agoRollup merge of #58370 - nox:relax-bounds, r=dtolnay
Mazdak Farrokhzad [Mon, 25 Feb 2019 02:17:58 +0000 (03:17 +0100)]
Rollup merge of #58370 - nox:relax-bounds, r=dtolnay

Relax some Hash bounds on HashMap<K, V, S> and HashSet<T, S>

Notably, hash iterators don't require any trait bounds to be iterated.

5 years agoFix sgx
Steven Fackler [Sun, 24 Feb 2019 18:49:55 +0000 (10:49 -0800)]
Fix sgx

5 years agoAuto merge of #58706 - matthewjasper:update-miri, r=RalfJung
bors [Sun, 24 Feb 2019 21:40:10 +0000 (21:40 +0000)]
Auto merge of #58706 - matthewjasper:update-miri, r=RalfJung

update miri

cc #57609

r? @RalfJung

5 years agoSimplify exclude_should_panic flag.
memoryruins [Sun, 24 Feb 2019 16:58:08 +0000 (11:58 -0500)]
Simplify exclude_should_panic flag.

5 years agoupdate miri
Matthew Jasper [Sun, 24 Feb 2019 16:45:14 +0000 (16:45 +0000)]
update miri

5 years agoDeny `async fn` in 2015 edition
Nathan Corbyn [Sat, 23 Feb 2019 18:39:27 +0000 (18:39 +0000)]
Deny `async fn` in 2015 edition

Fix style issues and update diagnostic messages

Update src/librustc_passes/diagnostics.rs

Co-Authored-By: doctorn <me@nathancorbyn.com>
Deny nested `async fn` in Rust 2015 edition

Deny nested `async fn` in Rust 2015 edition

Deny nested `async fn` in Rust 2015 edition