]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRequire compiler-rt root at ../src/llvm-project/compiler-rt
Luca Barbieri [Fri, 10 Apr 2020 20:42:19 +0000 (22:42 +0200)]
Require compiler-rt root at ../src/llvm-project/compiler-rt

4 years agoDepend on getopts from crates.io
Luca Barbieri [Fri, 10 Apr 2020 20:42:19 +0000 (22:42 +0200)]
Depend on getopts from crates.io

rustc_session exports it for other crates to avoid mismatching
crate versions.

4 years agoDepend on libc from crates.io
Luca Barbieri [Fri, 10 Apr 2020 20:42:19 +0000 (22:42 +0200)]
Depend on libc from crates.io

4 years agoAuto merge of #69573 - pnkfelix:issue-53114-add-tests, r=Centril
bors [Sat, 11 Apr 2020 06:44:47 +0000 (06:44 +0000)]
Auto merge of #69573 - pnkfelix:issue-53114-add-tests, r=Centril

tests encoding current behavior for various cases of "binding" to _.

The `_` binding form is special, in that it encodes a "no-op": nothing is actually bound, and thus nothing is moved or borrowed in this scenario. Usually we do the "right" thing in all such cases. The exceptions are explicitly pointed out in this test case, so that we keep track of whether they are eventually fixed.

Cc #53114.

(This does not close the aforementioned issue; it just adds the tests encoding the current behavior, which we hope to eventually fix.)

4 years agoAuto merge of #70986 - marmeladema:issue70853/librustc_middle-local-def-id, r=eddyb
bors [Fri, 10 Apr 2020 23:13:13 +0000 (23:13 +0000)]
Auto merge of #70986 - marmeladema:issue70853/librustc_middle-local-def-id, r=eddyb

rustc_middle: return `LocalDefId` where possible in hir::map module

This changes the return type of the following functions to return a `LocalDefId` instead of a `DefId`:
* opt_local_def_id_from_node_id
* opt_local_def_id
* body_owner_def_id
* local_def_id_from_node_id
* get_parent_id

This is another step in the right direction for #70853

This pull request will be followed by another (substantial one) which changes the return type of `local_def_id` function but this change being more invasive, we might want to wait for #70956 or #70961 (or some other form it) to land first.

4 years agoAuto merge of #70994 - Centril:rollup-lftv0a3, r=Centril
bors [Fri, 10 Apr 2020 19:28:38 +0000 (19:28 +0000)]
Auto merge of #70994 - Centril:rollup-lftv0a3, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #69745 (Use `PredicateObligation`s instead of `Predicate`s)
 - #70938 (Add ThreadSanitizer test case)
 - #70973 (Use forward traversal for unconditional recursion lint)
 - #70978 (compiletest: let config flags overwrite -A unused)
 - #70979 (Follow up on BTreeMap comments)
 - #70981 (Rearrange BTreeMap::into_iter to match range_mut.)
 - #70985 (Clean up E0512 explanation)
 - #70988 (Setup the `@rustbot prioritize` command)
 - #70991 (fix rustc-dev-guide's url in src/librustc_codegen_ssa)

Failed merges:

r? @ghost

4 years ago--bless you
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:22:24 +0000 (18:22 +0200)]
--bless you

4 years agoRollup merge of #70991 - longfangsong:master, r=jonas-schievink
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:15:29 +0000 (18:15 +0200)]
Rollup merge of #70991 - longfangsong:master, r=jonas-schievink

fix rustc-dev-guide's url in src/librustc_codegen_ssa

Change the backend-agnostic chapter's url in rustc-dev-guide from [url](https://rustc-dev-guide.rust-lang.org/codegen/backend-agnostic.html), which is 404 now, to [the right one](https://rustc-dev-guide.rust-lang.org/backend/backend-agnostic.html).

Sorry for disturbing.

4 years agoRollup merge of #70988 - LeSeulArtichaut:triagebot-prioritize, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:15:27 +0000 (18:15 +0200)]
Rollup merge of #70988 - LeSeulArtichaut:triagebot-prioritize, r=Mark-Simulacrum

Setup the `@rustbot prioritize` command

See rust-lang/triagebot#453

r? @Mark-Simulacrum can you confirm that the `t-compiler/wg-prioritization` stream ID is `227806`?
cc @spastorino

4 years agoRollup merge of #70985 - GuillaumeGomez:cleanup-e0512, r=Dylan-DPC
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:15:26 +0000 (18:15 +0200)]
Rollup merge of #70985 - GuillaumeGomez:cleanup-e0512, r=Dylan-DPC

Clean up E0512 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70981 - ssomers:btreemap_into_into_iter, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:15:24 +0000 (18:15 +0200)]
Rollup merge of #70981 - ssomers:btreemap_into_into_iter, r=Mark-Simulacrum

Rearrange BTreeMap::into_iter to match range_mut.

r? @Mark-Simulacrum
I wondered why you catered for the optional root differently in `into_iter` than in `range_mut`.

4 years agoRollup merge of #70979 - ssomers:btreemap_the_alice_merton_variations, r=Amanieu
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:15:22 +0000 (18:15 +0200)]
Rollup merge of #70979 - ssomers:btreemap_the_alice_merton_variations, r=Amanieu

Follow up on BTreeMap comments

r? @Amanieu (for the first commit)

4 years agoRollup merge of #70978 - RalfJung:compiletest-flags, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:15:21 +0000 (18:15 +0200)]
Rollup merge of #70978 - RalfJung:compiletest-flags, r=Mark-Simulacrum

compiletest: let config flags overwrite -A unused

Cc https://github.com/laumann/compiletest-rs/issues/216

4 years agoRollup merge of #70973 - ecstatic-morse:recursion-lint, r=jonas-schievink
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:15:19 +0000 (18:15 +0200)]
Rollup merge of #70973 - ecstatic-morse:recursion-lint, r=jonas-schievink

Use forward traversal for unconditional recursion lint

While reviewing #70822, I noted that #54444 could be solved without requiring the predecessor graph and without allocating a `Vec<Span>` for every basic block. The unconditional recursion lint is not a performance bottleneck however, so I approved #70822 as it was.

Nevertheless, I wanted to try implementing my idea using `TriColorDepthFirstSearch`, which is a DFS that can differentiate between [forward/tree edges and backward ones](https://en.wikipedia.org/wiki/Depth-first_search#Output_of_a_depth-first_search). I found this approach more straightforward than the existing one, so I'm opening this PR to see if it is desirable.

The pass is now just a DFS across the control-flow graph. We ignore false edges and false unwinds, as well as the successors of recursive calls, just like existing pass does. If we see a back-edge (loop) or a terminator that would cause us to yield control-flow back to the caller (`Return`, `Resume`, etc.), we know that the function does not unconditionally recurse.

r? @jonas-schievink

4 years agoRollup merge of #70938 - tmiasko:thread-test-case, r=hanna-kruppe
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:15:18 +0000 (18:15 +0200)]
Rollup merge of #70938 - tmiasko:thread-test-case, r=hanna-kruppe

Add ThreadSanitizer test case

4 years agoRollup merge of #69745 - estebank:predicate-obligations-3, r=nikomatsakis,eddyb
Mazdak Farrokhzad [Fri, 10 Apr 2020 16:15:16 +0000 (18:15 +0200)]
Rollup merge of #69745 - estebank:predicate-obligations-3, r=nikomatsakis,eddyb

Use `PredicateObligation`s instead of `Predicate`s

Keep more information about trait binding failures. Use more specific spans by pointing at bindings that introduce obligations.

Subset of #69709.

r? @eddyb

4 years agoAuto merge of #66605 - GuillaumeGomez:drop-python2, r=Mark-Simulacrum
bors [Fri, 10 Apr 2020 16:13:20 +0000 (16:13 +0000)]
Auto merge of #66605 - GuillaumeGomez:drop-python2, r=Mark-Simulacrum

Stop explicitly depending on python 2

This PR revises our previous policy of officially only supporting and testing with python 2 in the CI environment to instead test with python 3. It also changes the defaults to python 3 in our various scripts (usually, by way of `python` rather than `python3` to preserve compatibility with systems that do not have a python 3 available).

The effect of this is that we expect all new patches to support python 3 (and will test as such). We explicitly also expect that patches support python 2.7 as well -- and test as such, though only on one builder. This is intended as a temporary, though likely long-lived, measure to preserve compatibility while looking towards the future which is likely to be a python 3 only world. We do not at this point set a timeline for when we'll drop support for python 2.7; it's plausible that this is months or years into the future, depending on how quickly the ecosystem drops support and how painful it is for us to maintain that support over time.

Closes #65063 (as far as I can tell; please file explicit and separate issues or PRs if not).

4 years agocopy test cases to `if let` as well.
Felix S. Klock II [Thu, 5 Mar 2020 19:06:40 +0000 (14:06 -0500)]
copy test cases to `if let` as well.

4 years agoUpdate src/test/ui/binding/issue-53114-safety-checks.rs
Felix S Klock II [Thu, 5 Mar 2020 18:52:10 +0000 (13:52 -0500)]
Update src/test/ui/binding/issue-53114-safety-checks.rs

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoUpdate src/test/ui/binding/issue-53114-borrow-checks.rs
Felix S Klock II [Thu, 5 Mar 2020 18:51:48 +0000 (13:51 -0500)]
Update src/test/ui/binding/issue-53114-borrow-checks.rs

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agotests encoding current behavior for various cases of "binding" to _.
Felix S. Klock II [Sat, 29 Feb 2020 03:56:37 +0000 (22:56 -0500)]
tests encoding current behavior for various cases of "binding" to _.

The `_` binding form is special, in that it encodes a "no-op": nothing is
actually bound, and thus nothing is moved or borrowed in this scenario. Usually
we do the "right" thing in all such cases. The exceptions are explicitly pointed
out in this test case, so that we keep track of whether they are eventually
fixed.

4 years agofix rustc-dev-guide url in src/librustc_codegen_ssa
longfangsong [Fri, 10 Apr 2020 14:48:34 +0000 (22:48 +0800)]
fix rustc-dev-guide url in src/librustc_codegen_ssa

4 years agoAdd ThreadSanitizer test case
Tomasz Miąsko [Thu, 9 Apr 2020 00:00:00 +0000 (00:00 +0000)]
Add ThreadSanitizer test case

4 years agoSetup the `@rustbot prioritize` command
LeSeulArtichaut [Fri, 10 Apr 2020 13:22:40 +0000 (15:22 +0200)]
Setup the `@rustbot prioritize` command

4 years agoEnforce Python 3 as much as possible
Guillaume Gomez [Thu, 21 Nov 2019 12:57:40 +0000 (13:57 +0100)]
Enforce Python 3 as much as possible

4 years agoAuto merge of #70983 - Centril:rollup-npabk7c, r=Centril
bors [Fri, 10 Apr 2020 13:05:05 +0000 (13:05 +0000)]
Auto merge of #70983 - Centril:rollup-npabk7c, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #70784 (Consider methods on fundamental `impl` when method is not found on numeric type)
 - #70843 (Remove the Ord bound that was plaguing drain_filter)
 - #70913 (Replace "rc"/"arc" lang items with Rc/Arc diagnostic items.)
 - #70932 (De-abuse TyKind::Error in pattern type checking)
 - #70952 (Clean up E0511 explanation)
 - #70964 (rustc_session CLI lint parsing: mark a temporary hack as such)
 - #70969 (Fix JSON file_name documentation for macros.)
 - #70975 (Fix internal doc comment nits.)

Failed merges:

r? @ghost

4 years agoClean up E0512 explanation
Guillaume Gomez [Fri, 10 Apr 2020 11:19:49 +0000 (13:19 +0200)]
Clean up E0512 explanation

4 years agolibrustc_middle: return LocalDefId instead of DefId in get_parent_did
marmeladema [Wed, 8 Apr 2020 14:42:53 +0000 (15:42 +0100)]
librustc_middle: return LocalDefId instead of DefId in get_parent_did

4 years agolibrustc_middle: return LocalDefId instead of DefId in local_def_id_from_node_id
marmeladema [Wed, 8 Apr 2020 14:09:38 +0000 (15:09 +0100)]
librustc_middle: return LocalDefId instead of DefId in local_def_id_from_node_id

4 years agolibrustc_middle: return LocalDefId instead of DefId in body_owner_def_id
marmeladema [Wed, 8 Apr 2020 13:53:06 +0000 (14:53 +0100)]
librustc_middle: return LocalDefId instead of DefId in body_owner_def_id

4 years agolibrustc_middle: return LocalDefId instead of DefId in opt_local_def_id
marmeladema [Wed, 8 Apr 2020 11:33:38 +0000 (12:33 +0100)]
librustc_middle: return LocalDefId instead of DefId in opt_local_def_id

4 years agolibrustc_middle: return LocalDefId instead of DefId in opt_local_def_id_from_node_id
marmeladema [Wed, 8 Apr 2020 11:22:19 +0000 (12:22 +0100)]
librustc_middle: return LocalDefId instead of DefId in opt_local_def_id_from_node_id

4 years agoRollup merge of #70975 - lcnr:ok, r=petrochenkov
Mazdak Farrokhzad [Fri, 10 Apr 2020 10:48:53 +0000 (12:48 +0200)]
Rollup merge of #70975 - lcnr:ok, r=petrochenkov

Fix internal doc comment nits.

4 years agoRollup merge of #70969 - ehuss:json-filename-macros, r=eddyb
Mazdak Farrokhzad [Fri, 10 Apr 2020 10:48:51 +0000 (12:48 +0200)]
Rollup merge of #70969 - ehuss:json-filename-macros, r=eddyb

Fix JSON file_name documentation for macros.

JSON `file_name` paths were changed in #66364 for macros to point to actual source files instead of using `<MACRONAME macros>`.

Closes #70396

4 years agoRollup merge of #70964 - RalfJung:mark-cli-lint-hack, r=petrochenkov
Mazdak Farrokhzad [Fri, 10 Apr 2020 10:48:50 +0000 (12:48 +0200)]
Rollup merge of #70964 - RalfJung:mark-cli-lint-hack, r=petrochenkov

rustc_session CLI lint parsing: mark a temporary hack as such

This code was added in https://github.com/rust-lang/rust/pull/70918, but it should not be necessary any more once `forbid` works as expected for in-code attributes.

Cc @tobithiel @davidtwco

4 years agoRollup merge of #70952 - GuillaumeGomez:cleanup-e0511, r=Dylan-DPC
Mazdak Farrokhzad [Fri, 10 Apr 2020 10:48:48 +0000 (12:48 +0200)]
Rollup merge of #70952 - GuillaumeGomez:cleanup-e0511, r=Dylan-DPC

Clean up E0511 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70932 - mark-i-m:de-abuse-err-2, r=Centril
Mazdak Farrokhzad [Fri, 10 Apr 2020 10:48:47 +0000 (12:48 +0200)]
Rollup merge of #70932 - mark-i-m:de-abuse-err-2, r=Centril

De-abuse TyKind::Error in pattern type checking

r? @eddyb

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

In particular, I would appreciate extra scrutiny over the soundness of these changes.

Also, this will go a bit slowly because I'm going to use my other PR (#70551) to check if I missed anything.

4 years agoRollup merge of #70913 - eddyb:rc-arc-diagnostic-items, r=matthewjasper
Mazdak Farrokhzad [Fri, 10 Apr 2020 10:48:45 +0000 (12:48 +0200)]
Rollup merge of #70913 - eddyb:rc-arc-diagnostic-items, r=matthewjasper

Replace "rc"/"arc" lang items with Rc/Arc diagnostic items.

`Rc`/`Arc` should have no special semantics, so it seems appropriate for them to not be lang items.

r? @matthewjasper

4 years agoRollup merge of #70843 - ssomers:btree_drain_filter_epilogue, r=Amanieu
Mazdak Farrokhzad [Fri, 10 Apr 2020 10:48:44 +0000 (12:48 +0200)]
Rollup merge of #70843 - ssomers:btree_drain_filter_epilogue, r=Amanieu

Remove the Ord bound that was plaguing drain_filter

Now that  #70795 made it superfluous. Also removes superfluous lifetime specifiers (at least I think they are).

4 years agoRollup merge of #70784 - estebank:suggest-type-fundamental-method, r=matthewjasper
Mazdak Farrokhzad [Fri, 10 Apr 2020 10:48:42 +0000 (12:48 +0200)]
Rollup merge of #70784 - estebank:suggest-type-fundamental-method, r=matthewjasper

Consider methods on fundamental `impl` when method is not found on numeric type

Fix #47759.

4 years agoAuto merge of #70619 - etherealist:musl_lld, r=Mark-Simulacrum
bors [Fri, 10 Apr 2020 09:51:27 +0000 (09:51 +0000)]
Auto merge of #70619 - etherealist:musl_lld, r=Mark-Simulacrum

Enable rust-lld on dist-x86_64-musl

Add rust-lld to rustup llvm-tools-preview on nightly for musl

I am using a musl distro on my workstation, with `RUSTFLAGS="-C target-feature=-crt-static"` this works fine. I know that `x86_64-unknown-linux-musl` was originally only meant as a target and not as a host. But most problems have been fixed, and I have fewer problems with `unknown` (rustup) than when I am using `x86_64-alpine-linux-musl` (rust installed by the distro). The only thing I am missing is rust-lld in llvm-tools-preview on nightly.

I needed rust-lld for a wasm tutorial. I built rust-lld and tested it with that tutorial, and it worked well. I asked [here](https://users.rust-lang.org/t/enable-rust-lld-on-x86-64-unknown-linux-musl/39851) where to request to enable lld and ended up doing this PR.

I compared llvm-tools-preview `nightly-x86_64-unknown-linux-musl` and `nightly-x86_64-unknown-linux-gnu`: only rust-lld is missing in musl.

I tested the change using:

```bash
./src/ci/docker/run.sh dist-x86_64-musl
```

And I checked that the resulting rust-lld binary runs.

4 years agoRearrange BTreeMap::into_iter to match range_mut.
Stein Somers [Fri, 10 Apr 2020 08:05:47 +0000 (10:05 +0200)]
Rearrange BTreeMap::into_iter to match range_mut.

4 years agocompiletest: let config flags overwrite -A unused
Ralf Jung [Fri, 10 Apr 2020 08:30:04 +0000 (10:30 +0200)]
compiletest: let config flags overwrite -A unused

4 years agoAuto merge of #70447 - ecstatic-morse:storage-live-always, r=tmandry
bors [Fri, 10 Apr 2020 06:14:47 +0000 (06:14 +0000)]
Auto merge of #70447 - ecstatic-morse:storage-live-always, r=tmandry

Add utility to find locals that don't use `StorageLive` annotations and use it for `MaybeStorageLive`

Addresses https://github.com/rust-lang/rust/pull/70004#issuecomment-599271717 (cc @RalfJung).

The only dataflow analysis that is incorrect in this case is `MaybeStorageLive`. `transform/generator.rs` implemented custom handling for this class of locals, but other consumers of this analysis (there's one in [clippy](https://github.com/rust-lang/rust-clippy/blob/513b46793e98ce5b412d388a91f6371d6a9b290b/clippy_lints/src/redundant_clone.rs#L402)) would be incorrect.

r? @tmandry

4 years agowords
Bastian Kauschke [Fri, 10 Apr 2020 05:04:11 +0000 (07:04 +0200)]
words

4 years agoUse tri-color search for unconditional recursion lint
Dylan MacKenzie [Fri, 10 Apr 2020 02:24:09 +0000 (19:24 -0700)]
Use tri-color search for unconditional recursion lint

4 years agoFix JSON file_name documentation for macros.
Eric Huss [Fri, 10 Apr 2020 01:54:53 +0000 (18:54 -0700)]
Fix JSON file_name documentation for macros.

4 years agoConsider methods on fundamental `impl` when method is not found on numeric type
Esteban Küber [Sat, 4 Apr 2020 18:38:22 +0000 (11:38 -0700)]
Consider methods on fundamental `impl` when method is not found on numeric type

Fix #47759.

4 years agoAuto merge of #70909 - marmeladema:issue70853/librustc_hir-local-def-id, r=eddyb
bors [Thu, 9 Apr 2020 23:22:23 +0000 (23:22 +0000)]
Auto merge of #70909 - marmeladema:issue70853/librustc_hir-local-def-id, r=eddyb

librustc_hir: return LocalDefId instead of DefId in local_def_id

Its a first try to remove a few calls to `expect_local` and use `LocalDefId` instead of `DefId` where possible for #70853

This adds some calls to `.to_def_id()` to get a `DefId` back when needed. I don't know if I should push `LocalDefId` even further and change, for example, `Res::Def` to accept a `LocalDefId` instead of a `DefId` as second argument.

cc @ecstatic-morse

4 years agomark a temporary hack as such
Ralf Jung [Thu, 9 Apr 2020 21:02:13 +0000 (23:02 +0200)]
mark a temporary hack as such

4 years agoUse `Visitor` for `AlwaysLiveLocals`
Dylan MacKenzie [Thu, 9 Apr 2020 20:02:23 +0000 (13:02 -0700)]
Use `Visitor` for `AlwaysLiveLocals`

4 years agoAuto merge of #70960 - Centril:rollup-9vmokvw, r=Centril
bors [Thu, 9 Apr 2020 20:03:54 +0000 (20:03 +0000)]
Auto merge of #70960 - Centril:rollup-9vmokvw, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #70897 (bump Miri)
 - #70900 (Update cargo)
 - #70902 (Update Clippy)
 - #70939 (Add two const generics regression tests)
 - #70958 (Disable try_reserve tests on Android)

Failed merges:

r? @ghost

4 years agoExplain why we remove `self` from storage live locals
Dylan MacKenzie [Thu, 9 Apr 2020 20:01:59 +0000 (13:01 -0700)]
Explain why we remove `self` from storage live locals

4 years agoUse new utility in `transform/generator.rs`
Dylan MacKenzie [Sun, 29 Mar 2020 21:17:53 +0000 (14:17 -0700)]
Use new utility in `transform/generator.rs`

4 years agoUse new utility in `eval_context`
Dylan MacKenzie [Sun, 29 Mar 2020 21:17:27 +0000 (14:17 -0700)]
Use new utility in `eval_context`

4 years agoMake `MaybeStorageLive` correct for all kinds of MIR bodies
Dylan MacKenzie [Sun, 29 Mar 2020 21:16:29 +0000 (14:16 -0700)]
Make `MaybeStorageLive` correct for all kinds of MIR bodies

Before, it ignored the first argument and marked all variables without
`Storage*` annotations as dead.

4 years agoAdd utility to find locals that don't use `Storage*` annotations
Dylan MacKenzie [Sun, 29 Mar 2020 21:15:41 +0000 (14:15 -0700)]
Add utility to find locals that don't use `Storage*` annotations

4 years agoRespect the comment: no root unless the borrow type is `Mut`
Stein Somers [Thu, 9 Apr 2020 18:19:18 +0000 (20:19 +0200)]
Respect the comment: no root unless the borrow type is `Mut`

4 years agoKill comment left behind by a last minute change in #70795
Stein Somers [Thu, 9 Apr 2020 18:16:30 +0000 (20:16 +0200)]
Kill comment left behind by a last minute change in #70795

4 years agoRollup merge of #70958 - Amanieu:android_try_reserve, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 9 Apr 2020 16:17:22 +0000 (18:17 +0200)]
Rollup merge of #70958 - Amanieu:android_try_reserve, r=Mark-Simulacrum

Disable try_reserve tests on Android

Calling `realloc` with large sizes seems to be broken on older Android versions that use dlmalloc as the default allocator. This is not an issue for modern Android versions that use jemalloc.

Fixes #55861

4 years agoRollup merge of #70939 - varkor:const-generics-regression-tests, r=Centril
Mazdak Farrokhzad [Thu, 9 Apr 2020 16:17:20 +0000 (18:17 +0200)]
Rollup merge of #70939 - varkor:const-generics-regression-tests, r=Centril

Add two const generics regression tests

Closes https://github.com/rust-lang/rust/issues/66596.
Closes https://github.com/rust-lang/rust/issues/61522.

4 years agoRollup merge of #70902 - flip1995:clippyup, r=eddyb
Mazdak Farrokhzad [Thu, 9 Apr 2020 16:17:19 +0000 (18:17 +0200)]
Rollup merge of #70902 - flip1995:clippyup, r=eddyb

Update Clippy

Closes #70875

4 years agoRollup merge of #70900 - ehuss:update-cargo, r=ehuss
Mazdak Farrokhzad [Thu, 9 Apr 2020 16:17:17 +0000 (18:17 +0200)]
Rollup merge of #70900 - ehuss:update-cargo, r=ehuss

Update cargo

4 commits in 6e07d2dfb7fc87b1c9489de41da4dafa239daf03..390e8f245ef2cd7ac698b8a76abf029f9abcab0d
2020-03-31 03:22:39 +0000 to 2020-04-07 17:46:45 +0000
- Compatibility for rust-lang/rust#69926 (rust-lang/cargo#8080)
- Add note about converting triple case in environment variables (rust-lang/cargo#8079)
- Add support for `-Cembed-bitcode=no` (rust-lang/cargo#8066)
- Add triagebot configuration (rust-lang/cargo#8059)

4 years agoRollup merge of #70897 - RalfJung:miri, r=RalfJung
Mazdak Farrokhzad [Thu, 9 Apr 2020 16:17:15 +0000 (18:17 +0200)]
Rollup merge of #70897 - RalfJung:miri, r=RalfJung

bump Miri

r? @ghost Cc @rust-lang/miri

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

4 years agoDisable try_reserve tests on Android
Amanieu d'Antras [Thu, 9 Apr 2020 14:55:12 +0000 (15:55 +0100)]
Disable try_reserve tests on Android

4 years agoimprove comments
mark [Thu, 9 Apr 2020 14:31:52 +0000 (09:31 -0500)]
improve comments

4 years agoClean up E0511 explanation
Guillaume Gomez [Thu, 9 Apr 2020 11:48:11 +0000 (13:48 +0200)]
Clean up E0511 explanation

4 years agoAdd regression test for #61522
varkor [Wed, 8 Apr 2020 23:57:41 +0000 (00:57 +0100)]
Add regression test for #61522

4 years agoAdd regression test for #66596
varkor [Wed, 8 Apr 2020 23:57:27 +0000 (00:57 +0100)]
Add regression test for #66596

4 years agoAuto merge of #70943 - Centril:rollup-eowm2h3, r=Centril
bors [Thu, 9 Apr 2020 09:57:17 +0000 (09:57 +0000)]
Auto merge of #70943 - Centril:rollup-eowm2h3, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #67705 (Use unrolled loop for searching NULL in [u16] on Windows)
 - #70367 (save/restore `pessimistic_yield` when entering bodies)
 - #70822 (Don't lint for self-recursion when the function can diverge)
 - #70868 (rustc_codegen_ssa: Refactor construction of linker arguments)
 - #70896 (Implement Chain with Option fuses)
 - #70916 (Support `#[track_caller]` on functions in `extern "Rust" { ... }`)
 - #70918 (rustc_session: forbid lints override regardless of position)

Failed merges:

r? @ghost

4 years agode-abuse TyKind::Error: ice on missing slice type
mark [Wed, 8 Apr 2020 21:02:31 +0000 (16:02 -0500)]
de-abuse TyKind::Error: ice on missing slice type

4 years agode-abuse TyKind::Error: handle empty slices in array patterns
mark [Wed, 8 Apr 2020 17:43:43 +0000 (12:43 -0500)]
de-abuse TyKind::Error: handle empty slices in array patterns

4 years agoRollup merge of #70918 - tobithiel:fix_forbid_override, r=davidtwco
Mazdak Farrokhzad [Thu, 9 Apr 2020 03:29:47 +0000 (05:29 +0200)]
Rollup merge of #70918 - tobithiel:fix_forbid_override, r=davidtwco

rustc_session: forbid lints override regardless of position

Addresses the regression reported in #70819 for command line arguments, but does not address the source code flag regression.

4 years agoRollup merge of #70916 - Centril:track-caller-ffi, r=eddyb
Mazdak Farrokhzad [Thu, 9 Apr 2020 03:29:45 +0000 (05:29 +0200)]
Rollup merge of #70916 - Centril:track-caller-ffi, r=eddyb

Support `#[track_caller]` on functions in `extern "Rust" { ... }`

Fixes https://github.com/rust-lang/rust/issues/70830 which is the follow-up to @eddyb's suggestion in https://github.com/rust-lang/rust/pull/69251#discussion_r380791634 to allow `#[track_caller]` on `fn`s in FFI imports, that is, on functions in `extern "Rust" { ... }` blocks.

This requires that the other side, the FFI export, also have the `#[track_caller]` attribute. Otherwise, undefined behavior is triggered and the blame lies, as usual, with the `unsafe { ... }` block which called the FFI imported function.

After this PR, all forms of `fn` items with the right ABI (`"Rust"`) support `#[track_caller]`.

As a drive-by, the PR also hardens the check rejecting `#[naked] #[track_caller]` such that methods and other forms of `fn` items are also considered.

r? @eddyb
cc @rust-lang/lang

4 years agoRollup merge of #70896 - cuviper:optional-chain, r=scottmcm
Mazdak Farrokhzad [Thu, 9 Apr 2020 03:29:43 +0000 (05:29 +0200)]
Rollup merge of #70896 - cuviper:optional-chain, r=scottmcm

Implement Chain with Option fuses

The iterators are now "fused" with `Option` so we don't need separate state to track which part is already exhausted, and we may also get niche layout for `None`. We don't use the real `Fuse` adapter because its specialization for `FusedIterator` unconditionally descends into the iterator, and that could be expensive to keep revisiting stuff like nested chains. It also hurts compiler performance to add more iterator layers to `Chain`.

This change was inspired by the [proposal](https://internals.rust-lang.org/t/proposal-implement-iter-chain-using-fuse/12006) on the internals forum. This is an alternate to #70332, directly employing some of the same `Fuse` optimizations as #70366 and #70750.

r? @scottmcm

4 years agoRollup merge of #70868 - petrochenkov:linkorder, r=nagisa,mati865
Mazdak Farrokhzad [Thu, 9 Apr 2020 03:29:42 +0000 (05:29 +0200)]
Rollup merge of #70868 - petrochenkov:linkorder, r=nagisa,mati865

rustc_codegen_ssa: Refactor construction of linker arguments

And add comments.

This PR doesn't reorder any linker arguments and therefore shouldn't contain any observable changes.

The next goal here is to
- Factor out order-independent linker arguments in the compiler code and in target specifications and pass them together. Such arguments generally apply to the whole linking session or the produced linking result rather to individual object files or libraries.
- Figure out where exactly among the remaining order-dependent arguments we should place customization points like `-C link-args` and `-Z pre-link-args`.
- Possibly provide command line opt-outs for options that are currently passed unconditionally (like CRT objects or arguments defined by the target spec).
- Document and stabilize the customization points that are not yet stable (https://github.com/rust-lang/rust/pull/70505).

4 years agoRollup merge of #70822 - jonas-schievink:curse-of-the-recursion, r=ecstatic-morse
Mazdak Farrokhzad [Thu, 9 Apr 2020 03:29:40 +0000 (05:29 +0200)]
Rollup merge of #70822 - jonas-schievink:curse-of-the-recursion, r=ecstatic-morse

Don't lint for self-recursion when the function can diverge

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

4 years agoRollup merge of #70367 - nikomatsakis:issue-69307, r=Aaron1011
Mazdak Farrokhzad [Thu, 9 Apr 2020 03:29:38 +0000 (05:29 +0200)]
Rollup merge of #70367 - nikomatsakis:issue-69307, r=Aaron1011

save/restore `pessimistic_yield` when entering bodies

This flag is used to make the execution order around `+=` operators
pessimistic. Failure to save/restore the flag was causing independent
async blocks to effect one another, leading to strange ICEs and failed
assumptions.

Fixes #69307

r? @Zoxc

4 years agoRollup merge of #67705 - lzutao:wmemchr, r=wesleywiser
Mazdak Farrokhzad [Thu, 9 Apr 2020 03:29:36 +0000 (05:29 +0200)]
Rollup merge of #67705 - lzutao:wmemchr, r=wesleywiser

Use unrolled loop for searching NULL in [u16] on Windows

4 years agoAuto merge of #70860 - lcnr:has_local_value, r=nikomatsakis
bors [Thu, 9 Apr 2020 03:28:16 +0000 (03:28 +0000)]
Auto merge of #70860 - lcnr:has_local_value, r=nikomatsakis

remove `KEEP_IN_LOCAL_TCX` flag

closes #70285

I did not rename `needs_infer` here as this complex enough as is.
Will probably open a followup for that.

r? @eddyb

4 years agotrack_caller: support on FFI imports
Mazdak Farrokhzad [Wed, 8 Apr 2020 02:35:51 +0000 (04:35 +0200)]
track_caller: support on FFI imports

4 years agoAuto merge of #70936 - Dylan-DPC:rollup-2ng3e5h, r=Dylan-DPC
bors [Thu, 9 Apr 2020 00:11:27 +0000 (00:11 +0000)]
Auto merge of #70936 - Dylan-DPC:rollup-2ng3e5h, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #70134 (add basic support of OsStrExt for HermitCore)
 - #70565 (Add inline attributes for functions used in the query system)
 - #70828 (rustdoc: Don't try to load source files from external crates)
 - #70870 (Fix abuses of tykind::err)
 - #70906 (Suggest move for closures and async blocks in more cases.)
 - #70912 (Do not suggest adding type param when `use` is already suggested)
 - #70930 (add tracking issue to `VecDeque::make_contiguous`)

Failed merges:

r? @ghost

4 years agoSmall tweaks to required bound span
Esteban Küber [Mon, 6 Apr 2020 05:15:06 +0000 (22:15 -0700)]
Small tweaks to required bound span

4 years agoUse `PredicateObligation`s instead of `Predicate`s
Esteban Küber [Tue, 3 Mar 2020 23:07:04 +0000 (15:07 -0800)]
Use `PredicateObligation`s instead of `Predicate`s

Keep more information about trait binding failures.

4 years agodo_normalize_predicates: add delay_span_bug
Bastian Kauschke [Mon, 6 Apr 2020 22:19:36 +0000 (00:19 +0200)]
do_normalize_predicates: add delay_span_bug

4 years agoreplace `has_local_value` with `needs_infer`
Bastian Kauschke [Mon, 6 Apr 2020 20:29:18 +0000 (22:29 +0200)]
replace  `has_local_value` with `needs_infer`

4 years agoRollup merge of #70930 - lcnr:patch-1, r=Dylan-DPC
Dylan DPC [Wed, 8 Apr 2020 21:33:48 +0000 (23:33 +0200)]
Rollup merge of #70930 - lcnr:patch-1, r=Dylan-DPC

add tracking issue to `VecDeque::make_contiguous`

The tracking issue is https://github.com/rust-lang/rust/issues/70929

4 years agoRollup merge of #70912 - estebank:reduce-type-param-sugg-verbosity, r=davidtwco
Dylan DPC [Wed, 8 Apr 2020 21:33:46 +0000 (23:33 +0200)]
Rollup merge of #70912 - estebank:reduce-type-param-sugg-verbosity, r=davidtwco

Do not suggest adding type param when `use` is already suggested

Fix #70365, cc #70572.

4 years agoRollup merge of #70906 - gizmondo:66107, r=estebank
Dylan DPC [Wed, 8 Apr 2020 21:33:45 +0000 (23:33 +0200)]
Rollup merge of #70906 - gizmondo:66107, r=estebank

Suggest move for closures and async blocks in more cases.

Fixes #66107, also improves #67577
Related PR https://github.com/rust-lang/rust/pull/65166

4 years agoRollup merge of #70870 - mark-i-m:de-abuse-err, r=eddyb
Dylan DPC [Wed, 8 Apr 2020 21:33:43 +0000 (23:33 +0200)]
Rollup merge of #70870 - mark-i-m:de-abuse-err, r=eddyb

Fix abuses of tykind::err

r? @eddyb

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

4 years agoRollup merge of #70828 - ollie27:rustdoc_external_macro_src, r=eddyb
Dylan DPC [Wed, 8 Apr 2020 21:33:42 +0000 (23:33 +0200)]
Rollup merge of #70828 - ollie27:rustdoc_external_macro_src, r=eddyb

rustdoc: Don't try to load source files from external crates

Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead.

Part of #70757

r? @GuillaumeGomez
cc @eddyb

4 years agoRollup merge of #70565 - Zoxc:inlines-query-system, r=davidtwco
Dylan DPC [Wed, 8 Apr 2020 21:33:40 +0000 (23:33 +0200)]
Rollup merge of #70565 - Zoxc:inlines-query-system, r=davidtwco

Add inline attributes for functions used in the query system

4 years agoRollup merge of #70134 - hermitcore:osstrext, r=dtolnay
Dylan DPC [Wed, 8 Apr 2020 21:33:38 +0000 (23:33 +0200)]
Rollup merge of #70134 - hermitcore:osstrext, r=dtolnay

add basic support of OsStrExt for HermitCore

- this patch increases the compatibility to other operating systems
- in principle `ffi.rs` is derived from `src/libstd/sys/unix/ext/ffi.rs`

4 years agodon't set `HAS_INFER` for fresh types
Bastian Kauschke [Mon, 6 Apr 2020 19:32:08 +0000 (21:32 +0200)]
don't set `HAS_INFER` for fresh types

4 years agoAuto merge of #70721 - anyska:bless-all-mir-opt, r=oli-obk
bors [Wed, 8 Apr 2020 21:06:49 +0000 (21:06 +0000)]
Auto merge of #70721 - anyska:bless-all-mir-opt, r=oli-obk

--bless all mir-opt tests.

r? @oli-obk

4 years agoAdd ignore-wasm32-bare to mir-opt tests that need it.
Ana-Maria Mihalache [Wed, 8 Apr 2020 18:58:49 +0000 (18:58 +0000)]
Add ignore-wasm32-bare to mir-opt tests that need it.

4 years agoAuto merge of #70931 - Dylan-DPC:rollup-f8orcao, r=Dylan-DPC
bors [Wed, 8 Apr 2020 17:55:45 +0000 (17:55 +0000)]
Auto merge of #70931 - Dylan-DPC:rollup-f8orcao, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #70789 (remove false positives of unused_braces)
 - #70847 (ci: move /var/lib/docker to /mnt on GHA)
 - #70850 (BTreeMap first last proposal tweaks)
 - #70876 (Use a `SmallVec` for `Cache::predecessors`.)
 - #70883 (Clean up E0507 explanation)
 - #70892 (wf: refactor `compute_trait_ref`)
 - #70914 (Corrects a typo in rustdoc documentation.)
 - #70915 (Remove unnecessary TypeFlags::NOMINAL_FLAGS)
 - #70927 (Clean up E0510 explanation)

Failed merges:

r? @ghost

4 years agorustdoc: Don't try to load source files from external crates
Oliver Middleton [Sun, 5 Apr 2020 21:37:06 +0000 (22:37 +0100)]
rustdoc: Don't try to load source files from external crates

Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead.

4 years agoRollup merge of #70927 - GuillaumeGomez:cleanup-e0510, r=Dylan-DPC
Dylan DPC [Wed, 8 Apr 2020 16:37:31 +0000 (18:37 +0200)]
Rollup merge of #70927 - GuillaumeGomez:cleanup-e0510, r=Dylan-DPC

Clean up E0510 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70915 - tsandstr:remove-nominal-flags, r=eddyb
Dylan DPC [Wed, 8 Apr 2020 16:37:30 +0000 (18:37 +0200)]
Rollup merge of #70915 - tsandstr:remove-nominal-flags, r=eddyb

Remove unnecessary TypeFlags::NOMINAL_FLAGS

This was a relic from when we had "nominal flags" and "cached
properties." The latter no longer exists, so nominal flags are no
longer necessary. In fact, every flag is considered a nominal flag. I
went ahead and removed all references to NOMINAL_FLAGS.

Fixes rust-lang#70836