]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agocompiletest: support --pass=check and --pass=build for mir-opt tests.
Eduard-Mihai Burtescu [Sat, 11 Apr 2020 10:38:12 +0000 (13:38 +0300)]
compiletest: support --pass=check and --pass=build for mir-opt tests.

4 years agocompiletest: diff direction should be (-)expected -> (+)actual.
Eduard-Mihai Burtescu [Thu, 9 Apr 2020 11:12:07 +0000 (14:12 +0300)]
compiletest: diff direction should be (-)expected -> (+)actual.

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 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 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 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 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 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 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

4 years agoRollup merge of #70914 - tsandstr:typo1, r=Dylan-DPC
Dylan DPC [Wed, 8 Apr 2020 16:37:28 +0000 (18:37 +0200)]
Rollup merge of #70914 - tsandstr:typo1, r=Dylan-DPC

Corrects a typo in rustdoc documentation.

Fixes rust-lang#70856

Sorry, I am just learning git and I think I may have accidentally done some wacky stuff that closed my last PR. Here it is again.

4 years agoRollup merge of #70892 - lcnr:interators_are_nice, r=nikomatsakis
Dylan DPC [Wed, 8 Apr 2020 16:37:27 +0000 (18:37 +0200)]
Rollup merge of #70892 - lcnr:interators_are_nice, r=nikomatsakis

wf: refactor `compute_trait_ref`

moves `extend_cause_with_original_assoc_item_obligation` out of `compute_trait_ref` and
changes `trait_assoc_items` to an iterator. This saves us from building an unnecessary `Vec<_>`

r? @eddyb i guess

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

Clean up E0507 explanation

r? @Dylan-DPC

4 years agoRollup merge of #70876 - nnethercote:smallvec-predecessors, r=estebank
Dylan DPC [Wed, 8 Apr 2020 16:37:24 +0000 (18:37 +0200)]
Rollup merge of #70876 - nnethercote:smallvec-predecessors, r=estebank

Use a `SmallVec` for `Cache::predecessors`.

This is a very small win.

4 years agoRollup merge of #70850 - ssomers:btreemap_first_last, r=Amanieu
Dylan DPC [Wed, 8 Apr 2020 16:37:22 +0000 (18:37 +0200)]
Rollup merge of #70850 - ssomers:btreemap_first_last, r=Amanieu

BTreeMap first last proposal tweaks

Clean-up and following up on a request in #62924.

Trying the reviewer of the original code #65637...
r? @scottmcm

4 years agoRollup merge of #70847 - pietroalbini:ci-move-docker-lib, r=Mark-Simulacrum
Dylan DPC [Wed, 8 Apr 2020 16:37:18 +0000 (18:37 +0200)]
Rollup merge of #70847 - pietroalbini:ci-move-docker-lib, r=Mark-Simulacrum

ci: move /var/lib/docker to /mnt on GHA

There are some builders that are running out of disk space while building the Docker images, such as arm-android. This moves and symlinks `/var/lib/docker` to the `/mnt` partition on Linux GHA.

Example of a build failing because of this: https://github.com/rust-lang-ci/rust/runs/564628621

4 years agoRollup merge of #70789 - lcnr:macros, r=varkor
Dylan DPC [Wed, 8 Apr 2020 16:37:16 +0000 (18:37 +0200)]
Rollup merge of #70789 - lcnr:macros, r=varkor

remove false positives of unused_braces

fixes #70717

We could potentially be more aggressive when linting let bindings by checking if there are any explicit `ref`s.
I have been unable to create a snippet which compiles when using braces but has a borrowck error
without them. The closes I've gotten is [the following (playground)](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=4a1552ebe9648cb13fcb8dd969189a6c).

r? @eddyb

4 years agoadd `VecDeque::make_contiguous` tracking issue
Bastian Kauschke [Wed, 8 Apr 2020 14:53:04 +0000 (16:53 +0200)]
add `VecDeque::make_contiguous` tracking issue

4 years agocomment pessimistic yield and saving/restoring state
Niko Matsakis [Wed, 8 Apr 2020 14:49:57 +0000 (14:49 +0000)]
comment pessimistic yield and saving/restoring state

4 years agoClean up E0510 explanation
Guillaume Gomez [Wed, 8 Apr 2020 13:05:52 +0000 (15:05 +0200)]
Clean up E0510 explanation

4 years agoSuggest move for closures and async blocks in more cases.
Alex Aktsipetrov [Tue, 7 Apr 2020 21:57:26 +0000 (23:57 +0200)]
Suggest move for closures and async blocks in more cases.

4 years agolibrustc_resolve: fixup nit in previous commit
marmeladema [Wed, 8 Apr 2020 08:23:58 +0000 (09:23 +0100)]
librustc_resolve: fixup nit in previous commit

4 years agorustc_session: forbid lints override regardless of position
Tobias Thiel [Wed, 8 Apr 2020 04:41:54 +0000 (21:41 -0700)]
rustc_session: forbid lints override regardless of position

4 years agofix another ICE
mark [Tue, 7 Apr 2020 17:36:10 +0000 (12:36 -0500)]
fix another ICE

4 years agofix ice with trait obj dummy self
mark [Tue, 7 Apr 2020 02:22:36 +0000 (21:22 -0500)]
fix ice with trait obj dummy self

4 years agofix abuses of tykind::err
mark [Tue, 7 Apr 2020 00:03:54 +0000 (19:03 -0500)]
fix abuses of tykind::err

4 years agoRemove unnecessary TypeFlags::NOMINAL_FLAGS
Theo Sandstrom [Wed, 8 Apr 2020 01:57:31 +0000 (21:57 -0400)]
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

4 years agotrack_caller: harden naked interactions
Mazdak Farrokhzad [Wed, 8 Apr 2020 01:49:53 +0000 (03:49 +0200)]
track_caller: harden  naked interactions

4 years agoDo not suggest adding type param when `use` is already suggested
Esteban Küber [Wed, 8 Apr 2020 01:07:26 +0000 (18:07 -0700)]
Do not suggest adding type param when `use` is already suggested

Fix #70365, cc #70572.

4 years agoAvoid extra &mut in Chain::fold and try_fold
Josh Stone [Tue, 7 Apr 2020 23:58:52 +0000 (16:58 -0700)]
Avoid extra &mut in Chain::fold and try_fold

4 years agoReduce callsites in Chain::last()
Josh Stone [Tue, 7 Apr 2020 23:50:26 +0000 (16:50 -0700)]
Reduce callsites in Chain::last()

4 years agoReduce callsites in Chain::count()
Josh Stone [Tue, 7 Apr 2020 23:50:16 +0000 (16:50 -0700)]
Reduce callsites in Chain::count()

4 years agolibrustc_hir: return LocalDefId instead of DefId in local_def_id
marmeladema [Tue, 7 Apr 2020 23:29:50 +0000 (00:29 +0100)]
librustc_hir: return LocalDefId instead of DefId in local_def_id

4 years agoCorrects a typo in rustdoc documentation.
Theo Sandstrom [Tue, 7 Apr 2020 22:23:49 +0000 (18:23 -0400)]
Corrects a typo in rustdoc documentation.

Fixes rust-lang#70856

4 years agoUpdate Clippy
flip1995 [Tue, 7 Apr 2020 20:50:58 +0000 (22:50 +0200)]
Update Clippy

4 years agoUpdate cargo
Eric Huss [Tue, 7 Apr 2020 20:29:15 +0000 (13:29 -0700)]
Update cargo

4 years agobump Miri
Ralf Jung [Tue, 7 Apr 2020 18:23:43 +0000 (20:23 +0200)]
bump Miri

4 years agoRemove old mir-opt test format.
Ana-Maria Mihalache [Tue, 7 Apr 2020 17:47:58 +0000 (17:47 +0000)]
Remove old mir-opt test format.

4 years agoImplement Chain with Option fuses
Josh Stone [Tue, 7 Apr 2020 17:55:00 +0000 (10:55 -0700)]
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`.

4 years agoNormalize away pairs of line:col numbers.
Ana-Maria Mihalache [Tue, 7 Apr 2020 16:36:52 +0000 (16:36 +0000)]
Normalize away pairs of line:col numbers.

4 years agoAdd EMIT_MIR_FOR_EACH_BIT_WIDTH to tests that need it.
Ana-Maria Mihalache [Sat, 4 Apr 2020 20:25:54 +0000 (20:25 +0000)]
Add EMIT_MIR_FOR_EACH_BIT_WIDTH to tests that need it.

4 years ago--bless more mir-opt tests.
Ana-Maria Mihalache [Sat, 4 Apr 2020 17:15:01 +0000 (17:15 +0000)]
--bless more mir-opt tests.

4 years agoFurther improve comments
Jonas Schievink [Tue, 7 Apr 2020 17:30:16 +0000 (19:30 +0200)]
Further improve comments

4 years agoremove false positives of unused_braces
Bastian Kauschke [Sat, 4 Apr 2020 20:40:31 +0000 (22:40 +0200)]
remove false positives of unused_braces

4 years agowf: refactor `compute_trait_ref`
Bastian Kauschke [Tue, 7 Apr 2020 15:49:02 +0000 (17:49 +0200)]
wf: refactor `compute_trait_ref`

4 years ago--bless all mir-opt tests.
Ana-Maria Mihalache [Thu, 2 Apr 2020 21:09:01 +0000 (21:09 +0000)]
--bless all mir-opt tests.

4 years agoAuto merge of #70884 - Dylan-DPC:rollup-r3raqdf, r=jonas-schievink
bors [Tue, 7 Apr 2020 13:43:30 +0000 (13:43 +0000)]
Auto merge of #70884 - Dylan-DPC:rollup-r3raqdf, r=jonas-schievink

Rollup of 5 pull requests

Successful merges:

 - #70201 (Small tweaks in ToOwned::clone_into)
 - #70762 (Miri leak check: memory reachable through globals is not leaked)
 - #70846 (Keep codegen units unmerged when building compiler builtins)
 - #70854 (Use assoc int submodules)
 - #70857 (Don't import integer and float modules, use assoc consts 2)

Failed merges:

r? @ghost

4 years agoRollup merge of #70857 - faern:use-assoc-int-float-consts, r=dtolnay
Dylan DPC [Tue, 7 Apr 2020 12:46:59 +0000 (14:46 +0200)]
Rollup merge of #70857 - faern:use-assoc-int-float-consts, r=dtolnay

Don't import integer and float modules, use assoc consts 2

Follow up to #70777. I missed quite a lot of places. Partially because I wanted to keep the size of the last PR down, and partially because my regexes were not good enough :)

r? @dtolnay

4 years agoRollup merge of #70854 - faern:use-assoc-int-submodules, r=dtolnay
Dylan DPC [Tue, 7 Apr 2020 12:46:58 +0000 (14:46 +0200)]
Rollup merge of #70854 - faern:use-assoc-int-submodules, r=dtolnay

Use assoc int submodules

Bumping some submodules to the commits their masters currently point at. The main point of this is to get the associated integer/float constant documentation updates that were recently merged to them:

* https://github.com/rust-lang/nomicon/pull/207
* https://github.com/rust-lang/rust-by-example/pull/1327
* https://github.com/rust-lang/stdarch/pull/848

But for some, a few more changes slipped by that happened to be in the master branch of these submodules.

r? @dtolnay

4 years agoRollup merge of #70846 - tmiasko:compiler-builtins-codegen-units, r=alexcrichton
Dylan DPC [Tue, 7 Apr 2020 12:46:56 +0000 (14:46 +0200)]
Rollup merge of #70846 - tmiasko:compiler-builtins-codegen-units, r=alexcrichton

Keep codegen units unmerged when building compiler builtins

Make it possible to control how mono items are partitioned into code generation
units, when compiling the compiler builtins, by retaining the original partitioning.

Helps with #48625, #61063, #67960, #70489.

r? @alexcrichton

4 years agoRollup merge of #70762 - RalfJung:miri-leak-check, r=oli-obk
Dylan DPC [Tue, 7 Apr 2020 12:46:55 +0000 (14:46 +0200)]
Rollup merge of #70762 - RalfJung:miri-leak-check, r=oli-obk

Miri leak check: memory reachable through globals is not leaked

Also make Miri memory dump prettier by sharing more code with MIR dumping, and fix a bug where the Miri memory dump would print some allocations twice.

r? @oli-obk

Miri PR: https://github.com/rust-lang/miri/pull/1301

4 years agoRollup merge of #70201 - cuviper:clone_into, r=dtolnay
Dylan DPC [Tue, 7 Apr 2020 12:46:53 +0000 (14:46 +0200)]
Rollup merge of #70201 - cuviper:clone_into, r=dtolnay

Small tweaks in ToOwned::clone_into

- `<[T]>::clone_into` is slightly more optimized.
- `CStr::clone_into` is new, letting it reuse its allocation.
- `OsStr::clone_into` now forwards to the underlying slice/`Vec`.

4 years agoClean up E0507 explanation
Guillaume Gomez [Tue, 7 Apr 2020 12:07:57 +0000 (14:07 +0200)]
Clean up E0507 explanation

4 years agoAuto merge of #70837 - nnethercote:speed-up-find_library_crate, r=petrochenkov
bors [Tue, 7 Apr 2020 07:12:51 +0000 (07:12 +0000)]
Auto merge of #70837 - nnethercote:speed-up-find_library_crate, r=petrochenkov

Speed up path searching with `find_library_crate`.

By doing prefix and suffix checking on a `String` copy of each relevant
`PathBuf`, rather than the `PathBuf` itself.

4 years agoUse a `SmallVec` for `Cache::predecessors`.
Nicholas Nethercote [Tue, 7 Apr 2020 05:12:50 +0000 (15:12 +1000)]
Use a `SmallVec` for `Cache::predecessors`.

This is a very small win.

4 years agoAuto merge of #70164 - eddyb:walk-generic-arg, r=nikomatsakis
bors [Tue, 7 Apr 2020 04:01:26 +0000 (04:01 +0000)]
Auto merge of #70164 - eddyb:walk-generic-arg, r=nikomatsakis

ty/walk: iterate `GenericArg`s instead of `Ty`s.

Before this PR, `Ty::walk` only iterated over `Ty`s, but that's becoming an increasing problem with `const` generics, as `ty::Const`s in `Substs` are missed by it.

By working with `GenericArg` instead, we can handle both `Ty`s and `ty::Const`s, but also `ty::Region`s, which used to require ad-hoc mechanisms such as `push_regions`.

I've also removed `TraitRef::input_types`, as it's both long obsolete, and easy to misuse.

4 years agoForward OsStr::clone_into to the inner Vec
Josh Stone [Fri, 20 Mar 2020 22:46:40 +0000 (15:46 -0700)]
Forward OsStr::clone_into to the inner Vec

Despite OS differences, they're all just `Vec<u8>` inside, so we can
just forward `clone_into` calls to that optimized implementation.

4 years agoImplement ToOwned::clone_into for CStr
Josh Stone [Fri, 20 Mar 2020 22:42:56 +0000 (15:42 -0700)]
Implement ToOwned::clone_into for CStr

It can try to keep its allocation by converting the inner `Box` to
`Vec`, using `clone_into` on the bytes, then convert back to `Box`.

4 years agoAuto merge of #70865 - Dylan-DPC:rollup-jje2cuv, r=Dylan-DPC
bors [Tue, 7 Apr 2020 00:56:00 +0000 (00:56 +0000)]
Auto merge of #70865 - Dylan-DPC:rollup-jje2cuv, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #70612 (Add io::Write::write_all_vectored)
 - #70690 (Clean up E0501 explanation)
 - #70821 (expose suggestions::InferCtxtExt for clippy)
 - #70839 (clean up E0506 explanation)
 - #70859 (Move sanitize-inline-always test to sanitize directory)

Failed merges:

r? @ghost

4 years agolinker: Some minor code cleanup
Vadim Petrochenkov [Mon, 6 Apr 2020 22:48:30 +0000 (01:48 +0300)]
linker: Some minor code cleanup

4 years agoSpeed up path searching with `find_library_crate`.
Nicholas Nethercote [Mon, 6 Apr 2020 07:44:30 +0000 (17:44 +1000)]
Speed up path searching with `find_library_crate`.

By doing prefix and suffix checking on a `String` copy of each relevant
`PathBuf`, rather than the `PathBuf` itself.

4 years agoAdd some more comments
Jonas Schievink [Mon, 6 Apr 2020 23:10:49 +0000 (01:10 +0200)]
Add some more comments

4 years agoUse split_at in slice's ToOwned::clone_into
Josh Stone [Fri, 20 Mar 2020 22:28:26 +0000 (15:28 -0700)]
Use split_at in slice's ToOwned::clone_into

It appears to codegen slightly more efficiently with `split_at` taking
two slices at once, rather than slicing across different calls.

4 years agoUse assoc integer constants in librustc_*
Linus Färnstrand [Mon, 6 Apr 2020 21:09:56 +0000 (23:09 +0200)]
Use assoc integer constants in librustc_*