]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #71741 - RalfJung:pointer-print, r=oli-obk
Ralf Jung [Thu, 14 May 2020 08:22:48 +0000 (10:22 +0200)]
Rollup merge of #71741 - RalfJung:pointer-print, r=oli-obk

Pointer printing: do not print 0 offset

r? @eddyb Cc @oli-obk

4 years agoRollup merge of #71525 - ldm0:intosug, r=Mark-Simulacrum
Ralf Jung [Thu, 14 May 2020 08:22:40 +0000 (10:22 +0200)]
Rollup merge of #71525 - ldm0:intosug, r=Mark-Simulacrum

`prefix` should not be mutable.

Change the process from for loop to find, which makes the `prefix` able to be immutable.

4 years agoAuto merge of #72058 - RalfJung:no-dist-lldb, r=Mark-Simulacrum
bors [Thu, 14 May 2020 02:50:34 +0000 (02:50 +0000)]
Auto merge of #72058 - RalfJung:no-dist-lldb, r=Mark-Simulacrum

bootstrap: remove lldb dist packaging

The lldb-preview rustup package is missing on every single target, and has never been shipped beyond x86_64-apple-darwin. It was removed in #62592 which landed around a year ago, and there's not been demand that we re-enable it since, so we're now removing support entirely to cleanup the code a bit.

The hope is that this will also kill the useless "lldb-preview" row on https://rust-lang.github.io/rustup-components-history/.

4 years agoAuto merge of #72118 - flip1995:clippyup, r=oli-obk
bors [Wed, 13 May 2020 21:15:09 +0000 (21:15 +0000)]
Auto merge of #72118 - flip1995:clippyup, r=oli-obk

Update Clippy to 43a1777

Updates Clippy to https://github.com/rust-lang/rust-clippy/commit/43a1777b89cf6791f9e20878b4e5e3ae907867a5

We should establish a process on how often and when to update Clippy. (After X feature PRs? Once per week? Only on bug fixes and in the release week? ...?)

r? @oli-obk

4 years agoAuto merge of #72013 - nnethercote:make-RawVec-grow-mostly-non-generic, r=Amanieu
bors [Wed, 13 May 2020 14:29:56 +0000 (14:29 +0000)]
Auto merge of #72013 - nnethercote:make-RawVec-grow-mostly-non-generic, r=Amanieu

Make `RawVec::grow` mostly non-generic.

`cargo-llvm-lines` shows that, in various benchmarks, `RawVec::grow` is
instantiated 10s or 100s of times and accounts for 1-8% of lines of
generated LLVM IR.

This commit moves most of `RawVec::grow` into a separate function that
isn't parameterized by `T`, which means it doesn't need to be
instantiated many times. This reduces compile time significantly.

r? @ghost

4 years agoAuto merge of #71451 - estebank:suggest-super-trait-constraint, r=nikomatsakis
bors [Wed, 13 May 2020 06:54:15 +0000 (06:54 +0000)]
Auto merge of #71451 - estebank:suggest-super-trait-constraint, r=nikomatsakis

Suggest adding super trait constraints

4 years agoAuto merge of #70416 - mzohreva:mz/sgx-test, r=nikomatsakis
bors [Wed, 13 May 2020 03:29:00 +0000 (03:29 +0000)]
Auto merge of #70416 - mzohreva:mz/sgx-test, r=nikomatsakis

Process termination test for SGX

The issue is described in https://github.com/fortanix/rust-sgx/issues/109

cc @jethrogb

4 years agoreview comments
Esteban Küber [Tue, 12 May 2020 18:56:11 +0000 (11:56 -0700)]
review comments

4 years agofix test output after rebase
Esteban Küber [Thu, 7 May 2020 19:54:05 +0000 (12:54 -0700)]
fix test output after rebase

4 years agoIncrease verbosity of bound restriction suggestions
Esteban Küber [Wed, 22 Apr 2020 23:31:58 +0000 (16:31 -0700)]
Increase verbosity of bound restriction suggestions

- Make the bound restriction suggestion `span_suggestion_verbose`.
- Fix whitespace typo.

4 years agoSuggest adding super trait constraints
Esteban Küber [Wed, 22 Apr 2020 23:03:39 +0000 (16:03 -0700)]
Suggest adding super trait constraints

4 years agoAuto merge of #72091 - RalfJung:miri, r=RalfJung
bors [Tue, 12 May 2020 13:59:16 +0000 (13:59 +0000)]
Auto merge of #72091 - RalfJung:miri, r=RalfJung

update miri

Fixes https://github.com/rust-lang/rust/issues/72037
Cc @rust-lang/miri r? @ghost

4 years agoPointer printing: do not print 0 offset
Ralf Jung [Fri, 1 May 2020 10:10:06 +0000 (12:10 +0200)]
Pointer printing: do not print 0 offset

4 years agoAuto merge of #72134 - Dylan-DPC:rollup-h3shfz5, r=Dylan-DPC
bors [Tue, 12 May 2020 10:28:08 +0000 (10:28 +0000)]
Auto merge of #72134 - Dylan-DPC:rollup-h3shfz5, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71737 (Miri: run liballoc tests with threads)
 - #71928 (Add strikethrough support to rustdoc)
 - #72048 (Visit move out of `_0` when visiting `return`)
 - #72096 (Make MIR typeck use `LocalDefId` and fix docs)
 - #72128 (strings do not have to be valid UTF-8 any more)

Failed merges:

r? @ghost

4 years agoRollup merge of #72128 - RalfJung:str-validity, r=oli-obk
Dylan DPC [Tue, 12 May 2020 09:41:15 +0000 (11:41 +0200)]
Rollup merge of #72128 - RalfJung:str-validity, r=oli-obk

strings do not have to be valid UTF-8 any more

Cc https://github.com/rust-lang/reference/pull/792
r? @oli-obk

4 years agoRollup merge of #72096 - jonas-schievink:mirck-docs, r=matthewjasper
Dylan DPC [Tue, 12 May 2020 09:41:13 +0000 (11:41 +0200)]
Rollup merge of #72096 - jonas-schievink:mirck-docs, r=matthewjasper

Make MIR typeck use `LocalDefId` and fix docs

The docs on `fn type_check` were not in sync with the arguments it takes.

r? @matthewjasper

4 years agoRollup merge of #72048 - jonas-schievink:visit-return, r=oli-obk
Dylan DPC [Tue, 12 May 2020 09:41:12 +0000 (11:41 +0200)]
Rollup merge of #72048 - jonas-schievink:visit-return, r=oli-obk

Visit move out of `_0` when visiting `return`

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

4 years agoRollup merge of #71928 - mibac138:strikethrough, r=GuillaumeGomez
Dylan DPC [Tue, 12 May 2020 09:41:10 +0000 (11:41 +0200)]
Rollup merge of #71928 - mibac138:strikethrough, r=GuillaumeGomez

Add strikethrough support to rustdoc

Implements uncontroversial part of #71183.
r? @GuillaumeGomez

4 years agoRollup merge of #71737 - RalfJung:miri-test-threads, r=shepmaster
Dylan DPC [Tue, 12 May 2020 09:41:05 +0000 (11:41 +0200)]
Rollup merge of #71737 - RalfJung:miri-test-threads, r=shepmaster

Miri: run liballoc tests with threads

Miri now supports threads, so we can run these tests. :)

4 years agostrings do not have to be valid UTF-8 any more
Ralf Jung [Tue, 12 May 2020 07:46:41 +0000 (09:46 +0200)]
strings do not have to be valid UTF-8 any more

4 years agoSplit `RawVec::grow` up.
Nicholas Nethercote [Mon, 11 May 2020 03:17:28 +0000 (13:17 +1000)]
Split `RawVec::grow` up.

The amortized case is much more common than the exact case, and it is
typically instantiated many times.

Also, we can put a chunk of the code into a function that isn't generic
over T, which reduces the amount of LLVM IR generated quite a lot,
improving compile times.

4 years agoRemove `RawVec::double`.
Nicholas Nethercote [Mon, 11 May 2020 02:26:59 +0000 (12:26 +1000)]
Remove `RawVec::double`.

It's only used once, for `VecDeque`, and can easily be replaced by
something else. The commit changes `grow_if_necessary` to `grow` to
avoid some small regressions caused by changed inlining.

The commit also removes `Strategy::Double`, and streamlines the
remaining variants of `Strategy`.

It's a compile time win on some benchmarks because the many
instantations of `RawVec::grow` are a little smaller.

4 years agoAuto merge of #72120 - Dylan-DPC:rollup-ca0tur2, r=Dylan-DPC
bors [Mon, 11 May 2020 23:14:06 +0000 (23:14 +0000)]
Auto merge of #72120 - Dylan-DPC:rollup-ca0tur2, r=Dylan-DPC

Rollup of 10 pull requests

Successful merges:

 - #72014 (Deprecated emoji)
 - #72019 (Fix debug assertion in error code)
 - #72027 (Use CDN for ci-caches on download)
 - #72044 (use min_specialization for some rustc crates where it requires no changes)
 - #72052 (display `ConstKind::Param`)
 - #72067 (Emit a warning when optimization fuel runs out)
 - #72072 (doc: minus (U+2212) instead of dash (U+002D) for negative infinity)
 - #72077 (Improve E0571 wording)
 - #72107 (Clean up E0579 explanation)
 - #72109 (Fix clippy warnings)

Failed merges:

r? @ghost

4 years agoRemove `RawVec::double_in_place`.
Nicholas Nethercote [Mon, 11 May 2020 01:46:13 +0000 (11:46 +1000)]
Remove `RawVec::double_in_place`.

It's unused.

4 years agoRollup merge of #72109 - matthiaskrgr:cl8ppy, r=Dylan-DPC
Dylan DPC [Mon, 11 May 2020 20:21:08 +0000 (22:21 +0200)]
Rollup merge of #72109 - matthiaskrgr:cl8ppy, r=Dylan-DPC

Fix clippy warnings

Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}

r? @Dylan-DPC

4 years agoRollup merge of #72107 - GuillaumeGomez:cleanup-e0579, r=Dylan-DPC
Dylan DPC [Mon, 11 May 2020 20:21:07 +0000 (22:21 +0200)]
Rollup merge of #72107 - GuillaumeGomez:cleanup-e0579, r=Dylan-DPC

Clean up E0579 explanation

r? @Dylan-DPC

4 years agoRollup merge of #72077 - GuillaumeGomez:cleanup-E0571, r=Dylan-DPC
Dylan DPC [Mon, 11 May 2020 20:21:05 +0000 (22:21 +0200)]
Rollup merge of #72077 - GuillaumeGomez:cleanup-E0571, r=Dylan-DPC

Improve E0571 wording

r? @Dylan-DPC

4 years agoRollup merge of #72072 - tspiteri:minus-inf, r=Dylan-DPC
Dylan DPC [Mon, 11 May 2020 20:21:03 +0000 (22:21 +0200)]
Rollup merge of #72072 - tspiteri:minus-inf, r=Dylan-DPC

doc: minus (U+2212) instead of dash (U+002D) for negative infinity

Like #67430, for the new associated constants.

4 years agoRollup merge of #72067 - jonas-schievink:fuel-warn, r=varkor
Dylan DPC [Mon, 11 May 2020 20:21:01 +0000 (22:21 +0200)]
Rollup merge of #72067 - jonas-schievink:fuel-warn, r=varkor

Emit a warning when optimization fuel runs out

`eprintln!` gets swallowed by Cargo too easily.

4 years agoRollup merge of #72052 - lcnr:const_pprint, r=ecstatic-morse
Dylan DPC [Mon, 11 May 2020 20:20:59 +0000 (22:20 +0200)]
Rollup merge of #72052 - lcnr:const_pprint, r=ecstatic-morse

display `ConstKind::Param`

4 years agoRollup merge of #72044 - RalfJung:min-spec, r=matthewjasper
Dylan DPC [Mon, 11 May 2020 20:20:57 +0000 (22:20 +0200)]
Rollup merge of #72044 - RalfJung:min-spec, r=matthewjasper

use min_specialization for some rustc crates where it requires no changes

and add FIXME for the rest

Cc @matthewjasper

4 years agoRollup merge of #72027 - Mark-Simulacrum:ci-caches, r=pietroalbini
Dylan DPC [Mon, 11 May 2020 20:20:55 +0000 (22:20 +0200)]
Rollup merge of #72027 - Mark-Simulacrum:ci-caches, r=pietroalbini

Use CDN for ci-caches on download

This will reduce costs, as well as lays the groundwork for developers to be able
to locally pull the published docker images without needing AWS credentials.

r? @pietroalbini

4 years agoRollup merge of #72019 - matthewjasper:dont-skip-binder, r=davidtwco
Dylan DPC [Mon, 11 May 2020 20:20:54 +0000 (22:20 +0200)]
Rollup merge of #72019 - matthewjasper:dont-skip-binder, r=davidtwco

Fix debug assertion in error code

Closes #70813

4 years agoRollup merge of #72014 - GuillaumeGomez:deprecated-emoji, r=kinnison,ollie27
Dylan DPC [Mon, 11 May 2020 20:20:51 +0000 (22:20 +0200)]
Rollup merge of #72014 - GuillaumeGomez:deprecated-emoji, r=kinnison,ollie27

Deprecated emoji

Fixes #67872.

r? @kinnison

cc @rust-lang/rustdoc

4 years agoUpdate Cargo.lock
flip1995 [Mon, 11 May 2020 19:18:42 +0000 (21:18 +0200)]
Update Cargo.lock

4 years agoMerge commit '43a1777b89cf6791f9e20878b4e5e3ae907867a5' into clippyup
flip1995 [Mon, 11 May 2020 18:23:47 +0000 (20:23 +0200)]
Merge commit '43a1777b89cf6791f9e20878b4e5e3ae907867a5' into clippyup

4 years agoAuto merge of #72089 - Mark-Simulacrum:error-is-really-an-error, r=pietroalbini
bors [Mon, 11 May 2020 16:33:26 +0000 (16:33 +0000)]
Auto merge of #72089 - Mark-Simulacrum:error-is-really-an-error, r=pietroalbini

Fail if I/O error occurs during testing

First known case of this is in https://github.com/rust-lang/rust/pull/72053#issuecomment-626364402 but may have happened before then.

r? @pietroalbini

4 years agoFix clippy warnings
Matthias Krüger [Mon, 11 May 2020 11:01:37 +0000 (13:01 +0200)]
Fix clippy warnings

Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}

4 years agoConfigure cache domain for GHA
Mark Rousskov [Mon, 11 May 2020 14:50:53 +0000 (10:50 -0400)]
Configure cache domain for GHA

4 years agofix test_weak_count_locked for Miri
Ralf Jung [Sun, 3 May 2020 10:34:53 +0000 (12:34 +0200)]
fix test_weak_count_locked for Miri

4 years agoClean up E0579 explanation
Guillaume Gomez [Mon, 11 May 2020 11:22:56 +0000 (13:22 +0200)]
Clean up E0579 explanation

4 years agoupdate miri some more
Ralf Jung [Mon, 11 May 2020 10:13:53 +0000 (12:13 +0200)]
update miri some more

4 years agoAuto merge of #71953 - oli-obk:const_prop_deaggregates, r=wesleywiser
bors [Mon, 11 May 2020 07:23:31 +0000 (07:23 +0000)]
Auto merge of #71953 - oli-obk:const_prop_deaggregates, r=wesleywiser

Const prop aggregates even if partially or fully modified

r? @wesleywiser

cc @rust-lang/wg-mir-opt I'm moderately scared of this change, but I'm confident in having reviewed all the cases.

4 years agoMake MIR typeck use `LocalDefId` and fix docs
Jonas Schievink [Mon, 11 May 2020 00:10:25 +0000 (02:10 +0200)]
Make MIR typeck use `LocalDefId` and fix docs

4 years agoupdate miri
Ralf Jung [Sun, 10 May 2020 21:55:41 +0000 (23:55 +0200)]
update miri

4 years agoFail if I/O error occurs during testing
Mark Rousskov [Sun, 10 May 2020 20:53:48 +0000 (16:53 -0400)]
Fail if I/O error occurs during testing

4 years agoAuto merge of #71825 - contrun:cg-option-strip, r=petrochenkov
bors [Sun, 10 May 2020 20:48:40 +0000 (20:48 +0000)]
Auto merge of #71825 - contrun:cg-option-strip, r=petrochenkov

add codegen option strip

closes https://github.com/rust-lang/rust/issues/71757

I don't know if the flags added here works for all linkers. I only tested on my Linux pc. I also don't know what is the best for emlinker, PtxLinker, MsvcLinker. The option for WasmLd is copied from https://aransentin.github.io/cwasm/.

4 years agoremove lldb package from bootstrap, config and build-manifest
Ralf Jung [Sat, 9 May 2020 17:53:48 +0000 (19:53 +0200)]
remove lldb package from bootstrap, config and build-manifest

it's not been built since a long time ago

4 years agoEmit a warning when optimization fuel runs out
Jonas Schievink [Sat, 9 May 2020 22:33:08 +0000 (00:33 +0200)]
Emit a warning when optimization fuel runs out

`eprintln!` gets swallowed by Cargo too easily.

4 years agoAuto merge of #72074 - RalfJung:rollup-1ns58no, r=RalfJung
bors [Sun, 10 May 2020 12:07:34 +0000 (12:07 +0000)]
Auto merge of #72074 - RalfJung:rollup-1ns58no, r=RalfJung

Rollup of 4 pull requests

Successful merges:

 - #71840 (Rework MIR drop tree lowering)
 - #71882 (Update the `cc` crate)
 - #71945 (Sort "implementations on foreign types" section in the sidebar)
 - #72043 (Add missing backtick in E0569 explanation)

Failed merges:

r? @ghost

4 years agoImprove E0571 wording
Guillaume Gomez [Sun, 10 May 2020 10:40:11 +0000 (12:40 +0200)]
Improve E0571 wording

4 years agoRollup merge of #72043 - GuillaumeGomez:clean-up-e0569, r=Dylan-DPC
Ralf Jung [Sun, 10 May 2020 09:34:36 +0000 (11:34 +0200)]
Rollup merge of #72043 - GuillaumeGomez:clean-up-e0569, r=Dylan-DPC

Add missing backtick in E0569 explanation

r? @Dylan-DPC

4 years agoRollup merge of #71945 - GuillaumeGomez:sort-impl-on-foreign-types-section, r=kinniso...
Ralf Jung [Sun, 10 May 2020 09:34:34 +0000 (11:34 +0200)]
Rollup merge of #71945 - GuillaumeGomez:sort-impl-on-foreign-types-section, r=kinnison,ollie27

Sort "implementations on foreign types" section in the sidebar

Fixes #71926.

We were sorting by the ID instead of sorting by the name. They're not in the same order as the implementations but I think it makes more sense this way considering this is what we do for the methods as well.

r? @kinnison

cc @rust-lang/rustdoc

4 years agoRollup merge of #71882 - alexcrichton:update-cc, r=Mark-Simulacrum
Ralf Jung [Sun, 10 May 2020 09:34:32 +0000 (11:34 +0200)]
Rollup merge of #71882 - alexcrichton:update-cc, r=Mark-Simulacrum

Update the `cc` crate

Pulls in updated MSVC detection logic landed in alexcrichton/cc-rs#488

4 years agoRollup merge of #71840 - matthewjasper:drop-trees, r=oli-obk
Ralf Jung [Sun, 10 May 2020 09:34:30 +0000 (11:34 +0200)]
Rollup merge of #71840 - matthewjasper:drop-trees, r=oli-obk

Rework MIR drop tree lowering

This PR changes how drops are generated in MIR construction. This is the first half of the fix for #47949.

Rather than generating the drops for a given unwind/break/continue/return/generator drop path as soon as they are needed, the required drops are recorded and get generated later.

The motivation for this is
* It simplifies the caching scheme, because it's now possible to walk up the currently scheduled drop tree to recover state.
* The basic block order for MIR more closely resembles execution order.

This PR also:
* Highlights cleanup blocks in the graphviz MIR output.
* Removes some unnecessary drop flag assignments.

4 years agouse min_specialization for some rustc crates where it requires no changes
Ralf Jung [Sat, 9 May 2020 11:59:21 +0000 (13:59 +0200)]
use min_specialization for some rustc crates where it requires no changes

4 years agodoc: minus (U+2212) instead of dash (U+002D) for negative infinity
Trevor Spiteri [Sun, 10 May 2020 09:24:06 +0000 (11:24 +0200)]
doc: minus (U+2212) instead of dash (U+002D) for negative infinity

4 years agoadd linking option strip
YI [Sun, 3 May 2020 04:36:12 +0000 (12:36 +0800)]
add linking option strip

move strip option to "Z"

add more strip options, remove strip-debuginfo-if-disabled

merge strip and debuginfo

4 years agoAuto merge of #71775 - petrochenkov:crtcfg, r=matthewjasper
bors [Sun, 10 May 2020 08:25:32 +0000 (08:25 +0000)]
Auto merge of #71775 - petrochenkov:crtcfg, r=matthewjasper

Enable `cfg` predicate for `target_feature = "crt-static"` only if the target supports it

That's what all other `target_feature`s do.

4 years agoAuto merge of #72020 - alexcrichton:fix-incremental-linker-plugin-lto, r=oli-obk
bors [Sun, 10 May 2020 04:41:01 +0000 (04:41 +0000)]
Auto merge of #72020 - alexcrichton:fix-incremental-linker-plugin-lto, r=oli-obk

Fix disagreeement about CGU reuse and LTO

This commit fixes an issue where the codegen backend's selection of LTO
disagreed with what the codegen later thought was being done. Discovered
in #72006 we have a longstanding issue where if `-Clinker-plugin-lto` in
optimized mode is compiled incrementally it will always panic on the
second compilation. The underlying issue turned out to be that the
production of the original artifact determined that LTO should not be
done (because it's being postponed to the linker) but the CGU reuse
selection thought that LTO was done so it was trying to load pre-LTO
artifacts which were never generated.

The fix here is to ensure that the logic when generating code which
determines what kind of LTO is being done is shared amongst the CGU
reuse decision and the backend actually doing LTO. This means that
they'll both be in agreement about whether the previous compilation did
indeed produce incremental pre-LTO artifacts.

Closes #72006

4 years agoFix disagreeement about CGU reuse and LTO
Alex Crichton [Fri, 8 May 2020 16:27:59 +0000 (09:27 -0700)]
Fix disagreeement about CGU reuse and LTO

This commit fixes an issue where the codegen backend's selection of LTO
disagreed with what the codegen later thought was being done. Discovered
in #72006 we have a longstanding issue where if `-Clinker-plugin-lto` in
optimized mode is compiled incrementally it will always panic on the
second compilation. The underlying issue turned out to be that the
production of the original artifact determined that LTO should not be
done (because it's being postponed to the linker) but the CGU reuse
selection thought that LTO was done so it was trying to load pre-LTO
artifacts which were never generated.

The fix here is to ensure that the logic when generating code which
determines what kind of LTO is being done is shared amongst the CGU
reuse decision and the backend actually doing LTO. This means that
they'll both be in agreement about whether the previous compilation did
indeed produce incremental pre-LTO artifacts.

Closes #72006

4 years agoAuto merge of #71557 - matthewjasper:mir-asymmetric-or-pattern, r=oli-obk
bors [Sun, 10 May 2020 01:12:21 +0000 (01:12 +0000)]
Auto merge of #71557 - matthewjasper:mir-asymmetric-or-pattern, r=oli-obk

Fix ICE for broken or-pattern in async fn

closes #71297

4 years agoAuto merge of #69530 - Aaron1011:perf/skip-coerce-var, r=nikomatsakis
bors [Sat, 9 May 2020 21:01:19 +0000 (21:01 +0000)]
Auto merge of #69530 - Aaron1011:perf/skip-coerce-var, r=nikomatsakis

[perf] Skip attempting to run coerce_unsized on an inference variable

See the included comment for a detailed explanation of why this is
sound.

4 years agoAuto merge of #5564 - MrAwesome:master, r=flip1995
bors [Sat, 9 May 2020 18:43:28 +0000 (18:43 +0000)]
Auto merge of #5564 - MrAwesome:master, r=flip1995

Allow `use super::*;` glob imports

changelog: Allow super::* glob imports

fixes #5554
fixes #5569

A first pass at #5554 - this allows all `use super::*` to pass, which may or may not be desirable. The original issue was around allowing test modules to import their entire parent modules - I'm happy to modify this to do that instead, may just need some guidance on how to implement that (I played around a bit with #[cfg(test)] but from what I can gather, clippy itself isn't in test mode when running, even if the code in question is being checked for the test target).

4 years agoMove is_test_module check to top of function
Glenn Hope [Sat, 9 May 2020 17:16:47 +0000 (10:16 -0700)]
Move is_test_module check to top of function

4 years agoCheck is_macro inside check_exceptions, update references to fix test
Glenn Hope [Sat, 9 May 2020 17:14:29 +0000 (10:14 -0700)]
Check is_macro inside check_exceptions, update references to fix test

4 years agoFix test from auto-formatter fix
Glenn Hope [Sat, 9 May 2020 15:33:35 +0000 (08:33 -0700)]
Fix test from auto-formatter fix

4 years agoRemove check for Fn, reflect this in test cases, make test cases more robust/explicit
Glenn Hope [Sat, 9 May 2020 15:04:07 +0000 (08:04 -0700)]
Remove check for Fn, reflect this in test cases, make test cases more robust/explicit

4 years agoRemove unnecessary field, check for Mod/Fn ItemKind
Glenn Hope [Sat, 9 May 2020 01:22:27 +0000 (18:22 -0700)]
Remove unnecessary field, check for Mod/Fn ItemKind

4 years agoAlso have flag disable macro check
Glenn Hope [Thu, 7 May 2020 21:48:27 +0000 (14:48 -0700)]
Also have flag disable macro check

4 years agoAdd check for "test" in parent name. Include flag for disabling wildcard import excep...
Glenn Hope [Thu, 7 May 2020 21:41:54 +0000 (14:41 -0700)]
Add check for "test" in parent name. Include flag for disabling wildcard import exceptions

4 years agoCheck if the parent module name contains "test"
Glenn Hope [Thu, 7 May 2020 15:06:30 +0000 (08:06 -0700)]
Check if the parent module name contains "test"

4 years agoRun `cargo dev fmt`
Glenn Hope [Sun, 3 May 2020 18:18:10 +0000 (11:18 -0700)]
Run `cargo dev fmt`

4 years agoAllow 'use super::*;' imports
Glenn Hope [Sun, 3 May 2020 17:56:25 +0000 (10:56 -0700)]
Allow 'use super::*;' imports

4 years agoAuto merge of #72041 - RalfJung:rollup-xivrvy2, r=RalfJung
bors [Sat, 9 May 2020 17:31:08 +0000 (17:31 +0000)]
Auto merge of #72041 - RalfJung:rollup-xivrvy2, r=RalfJung

Rollup of 5 pull requests

Successful merges:

 - #69406 (upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir)
 - #71185 (Move tests from `test/run-fail` to UI)
 - #71234 (rustllvm: Use .init_array rather than .ctors)
 - #71508 (Simplify the `tcx.alloc_map` API)
 - #71555 (Remove ast::{Ident, Name} reexports.)

Failed merges:

r? @ghost

4 years agodisplay `ConstKind::Param`
Bastian Kauschke [Sat, 9 May 2020 15:10:40 +0000 (17:10 +0200)]
display `ConstKind::Param`

4 years agoVisit move out of `_0` when visiting `return`
Jonas Schievink [Sat, 9 May 2020 14:08:04 +0000 (16:08 +0200)]
Visit move out of `_0` when visiting `return`

4 years agoAuto merge of #5580 - matthiaskrgr:regex_dep, r=flip1995
bors [Sat, 9 May 2020 12:41:19 +0000 (12:41 +0000)]
Auto merge of #5580 - matthiaskrgr:regex_dep, r=flip1995

deps: remove unused regex dependency from root crate

changelog: none

4 years agoAdd missing backtick in E0569 explanation
Guillaume Gomez [Sat, 9 May 2020 11:48:11 +0000 (13:48 +0200)]
Add missing backtick in E0569 explanation

4 years agoSort "implementations on foreign types" section in the sidebar
Guillaume Gomez [Wed, 6 May 2020 09:13:00 +0000 (11:13 +0200)]
Sort "implementations on foreign types" section in the sidebar

4 years agoRollup merge of #71555 - cjgillot:nameless, r=matthewjasper
Ralf Jung [Sat, 9 May 2020 11:36:39 +0000 (13:36 +0200)]
Rollup merge of #71555 - cjgillot:nameless, r=matthewjasper

Remove ast::{Ident, Name} reexports.

The reexport of `Symbol` into `Name` confused me.

4 years agoRollup merge of #71508 - oli-obk:alloc_map_unlock, r=RalfJung
Ralf Jung [Sat, 9 May 2020 11:36:37 +0000 (13:36 +0200)]
Rollup merge of #71508 - oli-obk:alloc_map_unlock, r=RalfJung

Simplify the `tcx.alloc_map` API

This PR changes all functions that require manually locking the `alloc_map` to functions on `TyCtxt` that lock the map internally. In the same step we make the `TyCtxt::alloc_map` field private.

r? @RalfJung

4 years agoRollup merge of #71234 - maurer:init-array, r=cuviper
Ralf Jung [Sat, 9 May 2020 11:36:32 +0000 (13:36 +0200)]
Rollup merge of #71234 - maurer:init-array, r=cuviper

rustllvm: Use .init_array rather than .ctors

LLVM TargetMachines default to using the (now-legacy) .ctors
representation of init functions. Mixing .ctors and .init_array
representations can cause issues when linking with lld.

This happens in practice for:

* Our profiling runtime which is currently implicitly built with
  .init_array since it is built by clang, which sets this field.
* External C/C++ code that may be linked into the same process.

Fixes: #71233
4 years agoRollup merge of #71185 - JohnTitor:run-fail, r=petrochenkov
Ralf Jung [Sat, 9 May 2020 11:36:30 +0000 (13:36 +0200)]
Rollup merge of #71185 - JohnTitor:run-fail, r=petrochenkov

Move tests from `test/run-fail` to UI

Fixes #65440
cc #65865 #65506
r? @nikomatsakis

4 years agoRollup merge of #69406 - jackh726:chalk-upgrade, r=nikomatsakis
Ralf Jung [Sat, 9 May 2020 11:36:29 +0000 (13:36 +0200)]
Rollup merge of #69406 - jackh726:chalk-upgrade, r=nikomatsakis

upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir

Reintegrate chalk into rustc.

r? @nikomatsakis
cc. @rust-lang/wg-traits

4 years agoAddress review comments
Matthew Jasper [Fri, 8 May 2020 19:00:32 +0000 (20:00 +0100)]
Address review comments

4 years agoBless mir-opt tests
Matthew Jasper [Sat, 2 May 2020 18:59:05 +0000 (19:59 +0100)]
Bless mir-opt tests

4 years agoAdd some more comments
Matthew Jasper [Sat, 29 Feb 2020 17:48:09 +0000 (17:48 +0000)]
Add some more comments

4 years agoAuto merge of #72030 - matthiaskrgr:submodule_upd, r=Mark-Simulacrum
bors [Sat, 9 May 2020 09:50:58 +0000 (09:50 +0000)]
Auto merge of #72030 - matthiaskrgr:submodule_upd, r=Mark-Simulacrum

submodules: update cargo from f534844c2 to cb06cb269

Changes:
````
more clippy fixes
Document that bench is unstable in the man page.
Update assertions in LTO calculations
Updated comments in resolve.rs to reflect actual data strcture used.
Try to remove secrets from http.debug.
Revert always computing filename Metadata.
clean -p: call `get_many` once.
Implement new `clean -p` using globs.
Rework how Cargo computes the rustc file outputs.
Add CrateType to replace LibKind.
````

I'd like to get the fix for https://github.com/rust-lang/cargo/issues/8223 into nightly asap.

r? @ehuss

4 years agoReduce the number of drop-flag assignments in unwind paths
Matthew Jasper [Sun, 17 Nov 2019 11:30:48 +0000 (11:30 +0000)]
Reduce the number of drop-flag assignments in unwind paths

4 years agoDefer creating drop trees in MIR lowering until leaving that scope
Matthew Jasper [Sat, 16 Nov 2019 13:23:31 +0000 (13:23 +0000)]
Defer creating drop trees in MIR lowering until leaving that scope

4 years agoAuto merge of #71994 - jyn514:path-independent, r=Mark-Simulacrum
bors [Sat, 9 May 2020 06:26:57 +0000 (06:26 +0000)]
Auto merge of #71994 - jyn514:path-independent, r=Mark-Simulacrum

x.py: allow configuring the build directory

This allows configuring the directory for build artifacts, instead of having it always be `./build`. This means you can set it to a constant location, letting you reuse the same cache while working in several different directories.

The configuration lives in `config.toml` under `build.build-dir`. By default, it keeps the existing default of `./build`, but it can be configured to any relative or absolute path. Additionally, it allows making outputs relative to the root of the git repository using `$ROOT`.

r? @Mark-Simulacrum

4 years agoAuto merge of #72036 - Dylan-DPC:rollup-ca8b0ql, r=Dylan-DPC
bors [Sat, 9 May 2020 03:07:54 +0000 (03:07 +0000)]
Auto merge of #72036 - Dylan-DPC:rollup-ca8b0ql, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #70834 (Add core::future::{pending,ready})
 - #71839 (Make BTreeMap::new and BTreeSet::new const)
 - #71890 (Simplify the error Registry methods a little)
 - #71942 (Shrink `LocalDecl`)
 - #71947 (Dead-code pass highlights too much of impl functions)
 - #71981 (Fix `strip-priv-imports` pass name in the rustdoc documentation)
 - #72018 (Fix canonicalization links)
 - #72031 (Better documentation for io::Read::read() return value)

Failed merges:

r? @ghost

4 years agoRollup merge of #72031 - Elinvynia:master, r=Mark-Simulacrum
Dylan DPC [Sat, 9 May 2020 01:10:16 +0000 (03:10 +0200)]
Rollup merge of #72031 - Elinvynia:master, r=Mark-Simulacrum

Better documentation for io::Read::read() return value

Aims to provide the clarity requested in #70360

4 years agoRollup merge of #72018 - mark-i-m:canon-chalk, r=mark-i-m
Dylan DPC [Sat, 9 May 2020 01:10:14 +0000 (03:10 +0200)]
Rollup merge of #72018 - mark-i-m:canon-chalk, r=mark-i-m

Fix canonicalization links

4 years agoRollup merge of #71981 - DarkEld3r:patch-1, r=ollie27
Dylan DPC [Sat, 9 May 2020 01:10:12 +0000 (03:10 +0200)]
Rollup merge of #71981 - DarkEld3r:patch-1, r=ollie27

Fix `strip-priv-imports` pass name in the rustdoc documentation

4 years agoRollup merge of #71947 - mibac138:dead-code, r=cramertj
Dylan DPC [Sat, 9 May 2020 01:10:11 +0000 (03:10 +0200)]
Rollup merge of #71947 - mibac138:dead-code, r=cramertj

Dead-code pass highlights too much of impl functions

Fixes #66627.
Previous diagnostic:
```
error: method is never used: `unused_impl_fn_3`
  --> src/main.rs:28:5
   |
28 | /     fn unused_impl_fn_3(
29 | |         var: i32,
30 | |     ) {
31 | |         println!("bar {}", var);
32 | |     }
   | |_____^
```
New diagnostic:
```
error: associated function is never used: `unused_impl_fn_3`
  --> $DIR/lint-dead-code-6.rs:13:8
   |
LL |     fn unused_impl_fn_3(
   |        ^^^^^^^^^^^^^^^^
```

This makes associated functions in line with free-standing functions.

4 years agoRollup merge of #71942 - nnethercote:shrink-LocalDecl, r=matthewjasper
Dylan DPC [Sat, 9 May 2020 01:10:09 +0000 (03:10 +0200)]
Rollup merge of #71942 - nnethercote:shrink-LocalDecl, r=matthewjasper

Shrink `LocalDecl`

`LocalDecl` contributes 4-8% of peak heap memory usage on a range of benchmarks. This PR reduces its size from 128 bytes to 56 bytes on 64-bit, and does some clean-ups as well.

r? @matthewjasper

4 years agoRollup merge of #71890 - cuviper:simple-error-Registry, r=cramertj
Dylan DPC [Sat, 9 May 2020 01:10:07 +0000 (03:10 +0200)]
Rollup merge of #71890 - cuviper:simple-error-Registry, r=cramertj

Simplify the error Registry methods a little

4 years agoRollup merge of #71839 - LG3696:master, r=cramertj
Dylan DPC [Sat, 9 May 2020 01:10:05 +0000 (03:10 +0200)]
Rollup merge of #71839 - LG3696:master, r=cramertj

Make BTreeMap::new and BTreeSet::new const