]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #72882 - marmeladema:save-analysis-hir-tree, r=Xanewok
bors [Thu, 4 Jun 2020 14:16:13 +0000 (14:16 +0000)]
Auto merge of #72882 - marmeladema:save-analysis-hir-tree, r=Xanewok

save_analysis: work on HIR tree instead of AST

In order to reduce the uses of `NodeId`s in the compiler, `save_analysis` crate has been reworked to operate on the HIR tree instead of the AST.

cc #50928

4 years agoAuto merge of #72975 - Dylan-DPC:rollup-6zvco5x, r=Dylan-DPC
bors [Thu, 4 Jun 2020 10:17:38 +0000 (10:17 +0000)]
Auto merge of #72975 - Dylan-DPC:rollup-6zvco5x, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #72718 (Add regression test for #72554)
 - #72782 (rustc_target: Remove `pre_link_args_crt`)
 - #72923 (Improve E0433, so that it suggests missing imports)
 - #72950 (fix `AdtDef` docs)
 - #72951 (Add Camelid per request)
 - #72964 (Bump libc dependency to latest version (0.2.71))

Failed merges:

r? @ghost

4 years agoRollup merge of #72964 - sajattack:libc-0.2.71-bump, r=Mark-Simulacrum
Dylan DPC [Thu, 4 Jun 2020 10:12:52 +0000 (12:12 +0200)]
Rollup merge of #72964 - sajattack:libc-0.2.71-bump, r=Mark-Simulacrum

Bump libc dependency to latest version (0.2.71)

Hello,

Just a quick version bump PR. The rust-psp group had some changes merged to libc recently but they haven't made it into the compiler. We're looking to remove our forked version from our Xargo.toml. Thanks.

4 years agoRollup merge of #72951 - rust-lang:Camelid-RustThanks, r=Mark-Simulacrum
Dylan DPC [Thu, 4 Jun 2020 10:12:51 +0000 (12:12 +0200)]
Rollup merge of #72951 - rust-lang:Camelid-RustThanks, r=Mark-Simulacrum

Add Camelid per request

Email from @camelid:

> HI there,
>
> I’m a new contributor and I just looked at Rust Thanks and noticed that my contributions are listed under two different capitalizations of my name: “Camelid" and “camelid". Could you make them both “Camelid"?
>
> Thanks!
>
> Camelid

4 years agoRollup merge of #72950 - lcnr:fix_doc, r=davidtwco
Dylan DPC [Thu, 4 Jun 2020 10:12:49 +0000 (12:12 +0200)]
Rollup merge of #72950 - lcnr:fix_doc, r=davidtwco

fix `AdtDef` docs

4 years agoRollup merge of #72923 - Patryk27:fix/52468, r=estebank
Dylan DPC [Thu, 4 Jun 2020 10:12:47 +0000 (12:12 +0200)]
Rollup merge of #72923 - Patryk27:fix/52468, r=estebank

Improve E0433, so that it suggests missing imports

Closes #52468

4 years agoRollup merge of #72782 - petrochenkov:crtargs, r=varkor
Dylan DPC [Thu, 4 Jun 2020 10:12:45 +0000 (12:12 +0200)]
Rollup merge of #72782 - petrochenkov:crtargs, r=varkor

rustc_target: Remove `pre_link_args_crt`

To regain some more control over the definition of `+crt-static` (https://github.com/rust-lang/rust/pull/71586).

After https://github.com/rust-lang/rust/pull/71769 this target option wasn't used anywhere except for VxWorks, and I suspect that for VxWorks its use may be redundant as well.

4 years agoRollup merge of #72718 - estebank:impl-trait-obligation-failure, r=matthewjasper
Dylan DPC [Thu, 4 Jun 2020 10:12:40 +0000 (12:12 +0200)]
Rollup merge of #72718 - estebank:impl-trait-obligation-failure, r=matthewjasper

Add regression test for #72554

Fix #72554.

4 years agoUpdate `rls` submodule
marmeladema [Wed, 3 Jun 2020 14:03:37 +0000 (15:03 +0100)]
Update `rls` submodule

4 years agosave_analysis: work on HIR tree instead of AST
marmeladema [Sat, 30 May 2020 17:30:34 +0000 (18:30 +0100)]
save_analysis: work on HIR tree instead of AST

4 years agoAuto merge of #72618 - Aaron1011:feature/early-sourcemap, r=petrochenkov
bors [Thu, 4 Jun 2020 04:38:48 +0000 (04:38 +0000)]
Auto merge of #72618 - Aaron1011:feature/early-sourcemap, r=petrochenkov

Make `SourceMap` available for early debug-printing of `Span`s

Normally, we debug-print `Spans` using the `SourceMap` retrieved from
the global `TyCtxt`. However, we fall back to printing out the `Span`'s
raw fields (instead of a file and line number) when we try to print a
`Span` before a `TyCtxt` is available. This makes debugging early phases
of the compile, such as parsing, much more difficult.

This commit stores a `SourceMap` in `rustc_span::GlOBALS` as a fallback.
When a `TyCtxt` is not available, we try to retrieve one from `GLOBALS`
- only if this is not available do we fall back to the raw field output.

I'm not sure how to write a test for this - however, this can be
verified locally by setting `RUSTC_LOG="rustc_parse=debug"`, and
verifying that the output contains filenames and line numbers.

4 years agoBump libc dependency to latest version (0.2.71)
Paul Sajna [Wed, 3 Jun 2020 23:21:16 +0000 (16:21 -0700)]
Bump libc dependency to latest version (0.2.71)

4 years agoAuto merge of #72754 - lcnr:predicate-fold, r=nikomatsakis
bors [Wed, 3 Jun 2020 20:12:40 +0000 (20:12 +0000)]
Auto merge of #72754 - lcnr:predicate-fold, r=nikomatsakis

remove trivial `mk_predicate`s

r? @nikomatsakis

4 years agoAdd Camelid
Kyle J Strand [Wed, 3 Jun 2020 17:44:41 +0000 (11:44 -0600)]
Add Camelid

Email from @camelid:

> HI there,
>
> I’m a new contributor and I just looked at Rust Thanks and noticed that my contributions are listed under two different capitalizations of my name: “Camelid" and “camelid". Could you make them both “Camelid"?
>
> Thanks!
>
> Camelid

4 years agofix `AdtDef` docs
Bastian Kauschke [Wed, 3 Jun 2020 17:24:58 +0000 (19:24 +0200)]
fix `AdtDef` docs

4 years agorustc_target: Remove `pre_link_args_crt`
Vadim Petrochenkov [Sat, 30 May 2020 14:03:50 +0000 (17:03 +0300)]
rustc_target: Remove `pre_link_args_crt`

4 years agoAuto merge of #72948 - Dylan-DPC:rollup-fazhw00, r=Dylan-DPC
bors [Wed, 3 Jun 2020 16:06:30 +0000 (16:06 +0000)]
Auto merge of #72948 - Dylan-DPC:rollup-fazhw00, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #72586 (split select into submodules)
 - #72900 (Don't count pathless --extern for unused-crate-dependencies warnings)
 - #72924 (Stabilize `std::io::Buf{Reader, Writer}::capacity`)
 - #72942 (clean up E0641 explanation)
 - #72945 (Updated documentation for Control Flow Guard)

Failed merges:

r? @ghost

4 years agoRollup merge of #72945 - ajpaverd:cfguard-docs, r=Mark-Simulacrum
Dylan DPC [Wed, 3 Jun 2020 16:05:44 +0000 (18:05 +0200)]
Rollup merge of #72945 - ajpaverd:cfguard-docs, r=Mark-Simulacrum

Updated documentation for Control Flow Guard

Update user-facing documentation for the Control Flow Guard (CFG) exploit mitigation in the unstable book, as requested in #68793.

4 years agoRollup merge of #72942 - GuillaumeGomez:cleanup-e0641, r=Dylan-DPC
Dylan DPC [Wed, 3 Jun 2020 16:05:42 +0000 (18:05 +0200)]
Rollup merge of #72942 - GuillaumeGomez:cleanup-e0641, r=Dylan-DPC

clean up E0641 explanation

r? @Dylan-DPC

4 years agoRollup merge of #72924 - JohnTitor:stabilize-buf-capacity, r=shepmaster
Dylan DPC [Wed, 3 Jun 2020 16:05:41 +0000 (18:05 +0200)]
Rollup merge of #72924 - JohnTitor:stabilize-buf-capacity, r=shepmaster

Stabilize `std::io::Buf{Reader, Writer}::capacity`

Closes #68833
FCP is done here: https://github.com/rust-lang/rust/issues/68833#issuecomment-637596083

4 years agoRollup merge of #72900 - jsgf:no-unused-pathless, r=petrochenkov
Dylan DPC [Wed, 3 Jun 2020 16:05:39 +0000 (18:05 +0200)]
Rollup merge of #72900 - jsgf:no-unused-pathless, r=petrochenkov

Don't count pathless --extern for unused-crate-dependencies warnings

`--extern proc_macro` is used to add the proc_macro crate to the extern
prelude for all procmacros. In general pathless `--extern` only references
sysroot/standard libraries and so should be exempt from
unused-crate-dependencies warnings.

r? @petrochenkov

4 years agoRollup merge of #72586 - lcnr:winner-winnowing, r=nikomatsakis
Dylan DPC [Wed, 3 Jun 2020 16:05:37 +0000 (18:05 +0200)]
Rollup merge of #72586 - lcnr:winner-winnowing, r=nikomatsakis

split select into submodules

https://github.com/rust-lang/rust/blob/a0f06d11ae7fe29c8e263e2a5d8cd41b372f0283/src/librustc_trait_selection/traits/select.rs#L1

I extracted two submodules:

- confirmation: apart from `pub(super) fn confirm_candidate`, everything else is private
- candidate_assembly: exports `pub(super) fn candidate_from_obligation` and `pub(super) fn assemble_candidates`

I tried to change as little as possible while doing this and hopefully split this into well reviewable commits.

4 years agoUpdated documentation for Control Flow Guard
Andrew Paverd [Wed, 3 Jun 2020 13:25:58 +0000 (14:25 +0100)]
Updated documentation for Control Flow Guard

4 years agoremove ignore-tidy-filelength
Bastian Kauschke [Mon, 25 May 2020 20:28:11 +0000 (22:28 +0200)]
remove ignore-tidy-filelength

4 years agomove confirmation into submodule
Bastian Kauschke [Mon, 25 May 2020 20:33:21 +0000 (22:33 +0200)]
move confirmation into submodule

4 years agomove candidate assembly into a submodule
Bastian Kauschke [Mon, 25 May 2020 20:08:30 +0000 (22:08 +0200)]
move candidate assembly into a submodule

4 years agomove select into subfolder
Bastian Kauschke [Mon, 25 May 2020 18:38:19 +0000 (20:38 +0200)]
move select into subfolder

4 years agoAuto merge of #72746 - petrhosek:libunwind-hermetic, r=tmandry
bors [Wed, 3 Jun 2020 12:20:45 +0000 (12:20 +0000)]
Auto merge of #72746 - petrhosek:libunwind-hermetic, r=tmandry

Make libunwind build hermetic

We want to avoid exporting any symbols from Rust's version of libunwind,
and to do so we need to disable visibility annotations to make sure that
the -fvisibility=hidden has effect, and also hide global new/delete.

This matches the CMake build of libunwind.

4 years agoclean up E0641 explanation
Guillaume Gomez [Wed, 3 Jun 2020 11:52:09 +0000 (13:52 +0200)]
clean up E0641 explanation

4 years agoAuto merge of #70107 - lcnr:issue68977, r=eddyb
bors [Wed, 3 Jun 2020 08:43:11 +0000 (08:43 +0000)]
Auto merge of #70107 - lcnr:issue68977, r=eddyb

WF-check all ty::Const's, not just array lengths.

fixes #68977

This PR removes the special case for array length in `wf::compute` and
checks the well formedness of all consts.

Changes `PredicateKind::WellFormed` to take a `GenericArg` and updates `wf::obligations`.

4 years agoFix a typo in `late.rs`
Patryk Wychowaniec [Wed, 3 Jun 2020 06:38:10 +0000 (08:38 +0200)]
Fix a typo in `late.rs`

Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
4 years agoAuto merge of #72935 - Dylan-DPC:rollup-60g3ab6, r=Dylan-DPC
bors [Wed, 3 Jun 2020 01:00:39 +0000 (01:00 +0000)]
Auto merge of #72935 - Dylan-DPC:rollup-60g3ab6, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #72704 (Remote testing fixes)
 - #72820 (InstCombine: Don't optimize `&mut *x` into `x`)
 - #72848 (Correct generic parameter ordering in error note for E0747)
 - #72902 (Add a test to ensure Fuse stays covariant)
 - #72921 (Add assert to Vec with_capacity docs)

Failed merges:

r? @ghost

4 years agoRollup merge of #72921 - pickfire:vec-assert, r=Mark-Simulacrum
Dylan DPC [Wed, 3 Jun 2020 00:39:09 +0000 (02:39 +0200)]
Rollup merge of #72921 - pickfire:vec-assert, r=Mark-Simulacrum

Add assert to Vec with_capacity docs

4 years agoRollup merge of #72902 - cuviper:fuse-covariant, r=nikomatsakis
Dylan DPC [Wed, 3 Jun 2020 00:39:07 +0000 (02:39 +0200)]
Rollup merge of #72902 - cuviper:fuse-covariant, r=nikomatsakis

Add a test to ensure Fuse stays covariant

When #70502 attempted to specialize the data types in `Fuse`, one of the problems we found was that it broke variance. This was also realized when `Fuse` was first added, https://github.com/rust-lang/rust/pull/35656#discussion-diff-74995079, but now this PR adds a test so we don't forget again.

4 years agoRollup merge of #72848 - camelid:fix-72815, r=varkor
Dylan DPC [Wed, 3 Jun 2020 00:39:05 +0000 (02:39 +0200)]
Rollup merge of #72848 - camelid:fix-72815, r=varkor

Correct generic parameter ordering in error note for E0747

Fixes #72815.

r? @varkor

4 years agoRollup merge of #72820 - jonas-schievink:instcombine-uninit, r=oli-obk
Dylan DPC [Wed, 3 Jun 2020 00:39:03 +0000 (02:39 +0200)]
Rollup merge of #72820 - jonas-schievink:instcombine-uninit, r=oli-obk

InstCombine: Don't optimize `&mut *x` into `x`

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

4 years agoRollup merge of #72704 - tblah:remote-testing-fixes, r=Mark-Simulacrum
Dylan DPC [Wed, 3 Jun 2020 00:38:59 +0000 (02:38 +0200)]
Rollup merge of #72704 - tblah:remote-testing-fixes, r=Mark-Simulacrum

Remote testing fixes

Improvements for remote testing

- Create a `RUST_TEST_TMPDIR` directory on the remote testing host
- Verbose mode for remote-test-server
- Skip tests which don't support remote testing using `// ignore-remote`

To test:
- Build `remote-test-server` for the target machine and copy it over
- On the target:
``` sh
remote-test-server remote
```
- On the build machine
``` sh
export TEST_DEVICE_ADDR="1.2.3.4:12345"
./x.py test
```

4 years agoStabilize `std::io::Buf{Reader, Writer}::capacity`
Yuki Okushi [Tue, 2 Jun 2020 19:23:01 +0000 (04:23 +0900)]
Stabilize `std::io::Buf{Reader, Writer}::capacity`

4 years agoImprove E0433, so that it suggests missing imports
Patryk Wychowaniec [Tue, 2 Jun 2020 18:16:23 +0000 (20:16 +0200)]
Improve E0433, so that it suggests missing imports

4 years agoAdd assert to Vec with_capacity docs
Ivan Tham [Tue, 2 Jun 2020 17:29:02 +0000 (01:29 +0800)]
Add assert to Vec with_capacity docs

4 years agoAuto merge of #72918 - Dylan-DPC:rollup-pnvj62b, r=Dylan-DPC
bors [Tue, 2 Jun 2020 16:30:44 +0000 (16:30 +0000)]
Auto merge of #72918 - Dylan-DPC:rollup-pnvj62b, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #72884 (RawString error reporting cleanup )
 - #72888 (Add a warning about infinite reading in read_(until|line))
 - #72914 (Minor: off-by-one error in RELEASES.md)
 - #72916 (Update README.md)

Failed merges:

r? @ghost

4 years agoRollup merge of #72916 - DutchGhost:patch-1, r=jonas-schievink
Dylan DPC [Tue, 2 Jun 2020 16:30:05 +0000 (18:30 +0200)]
Rollup merge of #72916 - DutchGhost:patch-1, r=jonas-schievink

Update README.md

https://github.com/rust-lang/rust/pull/72827 changed it from `*.nix` to `Unix-like system`, but actually it should be `a Unix-like system`

4 years agoRollup merge of #72914 - petertodd:2020-minor-at-most-32, r=jonas-schievink
Dylan DPC [Tue, 2 Jun 2020 16:30:03 +0000 (18:30 +0200)]
Rollup merge of #72914 - petertodd:2020-minor-at-most-32, r=jonas-schievink

Minor: off-by-one error in RELEASES.md

4 years agoRollup merge of #72888 - poliorcetics:improve-read_line-read_until-doc, r=Dylan-DPC
Dylan DPC [Tue, 2 Jun 2020 16:29:59 +0000 (18:29 +0200)]
Rollup merge of #72888 - poliorcetics:improve-read_line-read_until-doc, r=Dylan-DPC

Add a warning about infinite reading in read_(until|line)

Fix for #48788.

This PR adds a warning to [`BufRead::read_line`](https://doc.rust-lang.org/stable/std/io/trait.BufRead.html#method.read_line) and [`BufRead::read_until`](https://doc.rust-lang.org/stable/std/io/trait.BufRead.html#method.read_until) about the possibility of an attack using the behaviour of these functions.

I did not mention a possible fix (using [`Read::take`](https://doc.rust-lang.org/stable/std/io/trait.Read.html#method.take), should I ?

4 years agoRollup merge of #72884 - Julian-Wollersberger:raw_str_error_cleanup, r=petrochenkov
Dylan DPC [Tue, 2 Jun 2020 16:29:57 +0000 (18:29 +0200)]
Rollup merge of #72884 - Julian-Wollersberger:raw_str_error_cleanup, r=petrochenkov

RawString error reporting cleanup

I simplified how errors with raw string are represented in the lexer and reportet in the parser, by using one enum instead of two structs with impls. This makes 70 code lines obsolete.

I also noticed some other things (2nd commit) and added a missing test for the `too many '#' symbols' error.

My original intent was to improve performance, but the only thing I found was to inline some functions in `cursor.rs`. It's effect is barely measurable, though.

There is one open question. Before, the compiler aborts when encountering the `too many '#' symbols` error. Now the lexer says in this case that there are 0 hashes, and then later the parser aborts on the error.
I'm worrying that the parser may be changed to recover and continue, and then later stages will see the wrong numer of hashes and act strange. (eg. the `format!` macro expansion).
Is that possibility important enough today to worry about it?

4 years agoUpdate README.md
DutchGhost [Tue, 2 Jun 2020 14:12:36 +0000 (16:12 +0200)]
Update README.md

https://github.com/rust-lang/rust/pull/72827 changed it from `*.nix` to `Unix-like system`, but actually it should be `a Unix-like system`

4 years agoMinor: off-by-one error in RELEASES.md
Peter Todd [Tue, 2 Jun 2020 13:47:33 +0000 (09:47 -0400)]
Minor: off-by-one error in RELEASES.md

4 years agoupdate tests
Bastian Kauschke [Tue, 26 May 2020 21:13:18 +0000 (23:13 +0200)]
update tests

4 years agochange WellFormed predicate to GenericArg
Bastian Kauschke [Tue, 26 May 2020 21:12:01 +0000 (23:12 +0200)]
change WellFormed predicate to GenericArg

4 years agoadd WellFormedConst predicate
Bastian Kauschke [Sat, 23 May 2020 16:28:50 +0000 (18:28 +0200)]
add WellFormedConst predicate

4 years agoimplement wf checking for constants
Bastian Kauschke [Sat, 23 May 2020 13:29:51 +0000 (15:29 +0200)]
implement wf checking for constants

4 years agocompiletest: Add name directive for remote runners
Tom Eccles [Thu, 28 May 2020 16:32:12 +0000 (17:32 +0100)]
compiletest: Add name directive for remote runners

Allow tests to use
// ignore-remote
to ignore the test when using remote-test-{client,server}. In most
situations this would be covered by
// ignore-cross-compile
but I see no reason that a non-cross compiled remote test runner
shouldn't work.

4 years agotools/remote-test-server: make use of verbose option
Tom Eccles [Thu, 28 May 2020 16:53:29 +0000 (17:53 +0100)]
tools/remote-test-server: make use of verbose option

There was an unused verbose command line argument. Add some prints if
verbose is set.

4 years agotools/remote-test-{server,client}: support RUST_TEST_TMPDIR
Tom Eccles [Thu, 28 May 2020 15:27:56 +0000 (16:27 +0100)]
tools/remote-test-{server,client}: support RUST_TEST_TMPDIR

Some tests (e.g. ui-fulldeps/create-dir-all-bare.rs) assume that
RUST_TEST_TMPDIR exists on the system running the test. Expand
remote-test-{server,client} such that a tmp directory is created on the
remote runner and this environment variable will point at it.

4 years agoAuto merge of #72672 - seritools:remote-test-windows, r=Mark-Simulacrum
bors [Tue, 2 Jun 2020 07:54:38 +0000 (07:54 +0000)]
Auto merge of #72672 - seritools:remote-test-windows, r=Mark-Simulacrum

Make remote-test-client and remote-test-server compatible with windows

`compiletest` and `remote-test-client`:

The command line for `remote-test-client` was changed slightly to allow cross-platform compatible paths. The old way of supplying the support libs was by joining their paths with the executable path
with `:`. This caused Windows-style paths to be split after the directory letter. Now, the number of support libs is provided as a parameter as well, and the support lib paths are split off from the regular args in the client.

`remote-test-server`:

- Marked Unix-only parts as such and implemented Windows alternatives
- On Windows `LD_LIBRARY_PATH` doesn't exist. Libraries are loaded from `PATH` though, so that's the way around it.
- Tiny cleanup: `Command::args`/`envs` instead of manually looping over them
- The temp path for Windows has to be set via environment variable, since there isn't a global temp directory that would work on every machine (as a static string)

4 years agoAuto merge of #72905 - JohnTitor:rollup-phtyo5i, r=JohnTitor
bors [Tue, 2 Jun 2020 04:10:49 +0000 (04:10 +0000)]
Auto merge of #72905 - JohnTitor:rollup-phtyo5i, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #72775 (Return early to avoid ICE)
 - #72795 (Add a test for `$:ident` in proc macro input)
 - #72822 (remove trivial calls to mk_const)
 - #72825 (Clarify errors and warnings about the transition to the new asm!)
 - #72827 (changed *nix to Unix-like)
 - #72880 (Clean up E0637 explanation)
 - #72886 (Remove allow missing_debug_implementations for MaybeUninit)
 - #72889 (rustc: Remove the `--passive-segments` LLD flag on wasm)
 - #72891 (Add associated consts MIN/MAX for Wrapping<Int>)
 - #72893 (test miri-unleash TLS accesses)

Failed merges:

r? @ghost

4 years agoRollup merge of #72893 - RalfJung:unleash-tls, r=ecstatic-morse
Yuki Okushi [Tue, 2 Jun 2020 04:07:27 +0000 (13:07 +0900)]
Rollup merge of #72893 - RalfJung:unleash-tls, r=ecstatic-morse

test miri-unleash TLS accesses

Finally gets rid of `IS_SUPPORTED_IN_MIRI`. :-)

I also added a test for the new `asm!` while I am at it.

r? @ecstatic-morse Cc @rust-lang/wg-const-eval

4 years agoRollup merge of #72891 - lzutao:wrapping_int-max, r=sfackler
Yuki Okushi [Tue, 2 Jun 2020 04:07:25 +0000 (13:07 +0900)]
Rollup merge of #72891 - lzutao:wrapping_int-max, r=sfackler

Add associated consts MIN/MAX for Wrapping<Int>

4 years agoRollup merge of #72889 - alexcrichton:update-wasm-threads, r=nikomatsakis
Yuki Okushi [Tue, 2 Jun 2020 04:07:24 +0000 (13:07 +0900)]
Rollup merge of #72889 - alexcrichton:update-wasm-threads, r=nikomatsakis

rustc: Remove the `--passive-segments` LLD flag on wasm

This flag looks like it's been removed in LLVM 10, so this removes rustc
unconditionally passing the flag.

4 years agoRollup merge of #72886 - xfix:patch-21, r=jonas-schievink
Yuki Okushi [Tue, 2 Jun 2020 04:07:22 +0000 (13:07 +0900)]
Rollup merge of #72886 - xfix:patch-21, r=jonas-schievink

Remove allow missing_debug_implementations for MaybeUninit

It already has a Debug implementation.

4 years agoRollup merge of #72880 - GuillaumeGomez:cleanup-e0637, r=Dylan-DPC
Yuki Okushi [Tue, 2 Jun 2020 04:07:20 +0000 (13:07 +0900)]
Rollup merge of #72880 - GuillaumeGomez:cleanup-e0637, r=Dylan-DPC

Clean up E0637 explanation

r? @Dylan-DPC

4 years agoRollup merge of #72827 - milrope:patch-1, r=nikomatsakis
Yuki Okushi [Tue, 2 Jun 2020 04:07:18 +0000 (13:07 +0900)]
Rollup merge of #72827 - milrope:patch-1, r=nikomatsakis

changed *nix to Unix-like

4 years agoRollup merge of #72825 - Amanieu:asm-warning, r=davidtwco
Yuki Okushi [Tue, 2 Jun 2020 04:07:17 +0000 (13:07 +0900)]
Rollup merge of #72825 - Amanieu:asm-warning, r=davidtwco

Clarify errors and warnings about the transition to the new asm!

Hopefully addresses the concerns from https://github.com/rust-lang/rust/pull/71007#issuecomment-636412905.

4 years agoRollup merge of #72822 - lcnr:intern-me, r=estebank
Yuki Okushi [Tue, 2 Jun 2020 04:07:15 +0000 (13:07 +0900)]
Rollup merge of #72822 - lcnr:intern-me, r=estebank

remove trivial calls to mk_const

similar to #72754

4 years agoRollup merge of #72795 - petrochenkov:identgroup, r=nikomatsakis
Yuki Okushi [Tue, 2 Jun 2020 04:07:13 +0000 (13:07 +0900)]
Rollup merge of #72795 - petrochenkov:identgroup, r=nikomatsakis

Add a test for `$:ident` in proc macro input

cc https://github.com/rust-lang/rust/issues/72545#issuecomment-636388019

4 years agoRollup merge of #72775 - JohnTitor:await-sugg, r=estebank
Yuki Okushi [Tue, 2 Jun 2020 04:07:12 +0000 (13:07 +0900)]
Rollup merge of #72775 - JohnTitor:await-sugg, r=estebank

Return early to avoid ICE

Fixes #72766

4 years agoAdd a test to ensure Fuse stays covariant
Josh Stone [Tue, 2 Jun 2020 00:47:26 +0000 (17:47 -0700)]
Add a test to ensure Fuse stays covariant

4 years agoDon't count pathless --extern options for unused-crate-dependencies warnings
Jeremy Fitzhardinge [Mon, 1 Jun 2020 23:21:27 +0000 (16:21 -0700)]
Don't count pathless --extern options for unused-crate-dependencies warnings

`--extern proc_macro` is used to add the proc_macro crate to the extern
prelude for all procmacros. In general pathless `--extern` only references
sysroot/standard libraries and so should be exempt from
unused-crate-dependencies warnings.

4 years agoFix comment
Ralf Jung [Mon, 1 Jun 2020 22:55:11 +0000 (00:55 +0200)]
Fix comment

Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
4 years agoCleanup: Inline `struct_span_fatal()`, which is only called once, and remove an outda...
Julian Wollersberger [Mon, 1 Jun 2020 11:25:41 +0000 (13:25 +0200)]
Cleanup: Inline `struct_span_fatal()`, which is only called once, and remove an outdated FIXME.

4 years agoSimplify raw string error reporting.
Julian Wollersberger [Fri, 29 May 2020 15:37:16 +0000 (17:37 +0200)]
Simplify raw string error reporting.
This makes `UnvalidatedRawStr` and `ValidatedRawStr` unnecessary and removes 70 lines.

4 years agoInclude kind in `bug!`
Camelid [Mon, 1 Jun 2020 20:01:01 +0000 (13:01 -0700)]
Include kind in `bug!`

Co-authored-by: hafiz <20735482+ayazhafiz@users.noreply.github.com>
4 years agoAuto merge of #72779 - RalfJung:miri, r=oli-obk
bors [Mon, 1 Jun 2020 19:03:23 +0000 (19:03 +0000)]
Auto merge of #72779 - RalfJung:miri, r=oli-obk

bump Miri, update for cargo-miri being a separate project

r? @oli-obk

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

4 years agotest miri-unleash TLS accesses
Ralf Jung [Mon, 1 Jun 2020 18:53:45 +0000 (20:53 +0200)]
test miri-unleash TLS accesses

4 years agobump Miri, update for cargo-miri being a separate project
Ralf Jung [Mon, 1 Jun 2020 18:17:20 +0000 (20:17 +0200)]
bump Miri, update for cargo-miri being a separate project

4 years agoUse `bug!` instead of `panic!`
Camelid [Mon, 1 Jun 2020 17:52:07 +0000 (10:52 -0700)]
Use `bug!` instead of `panic!`

Co-authored-by: varkor <github@varkor.com>
4 years agoAdd associated consts MIN/MAX for Wrapping<Int>
Lzu Tao [Mon, 1 Jun 2020 17:03:47 +0000 (17:03 +0000)]
Add associated consts MIN/MAX for Wrapping<Int>

4 years agoAdd test for #72554.
Esteban Küber [Fri, 29 May 2020 01:20:37 +0000 (18:20 -0700)]
Add test for #72554.

4 years agorustc: Remove the `--passive-segments` LLD flag on wasm
Alex Crichton [Mon, 1 Jun 2020 15:33:07 +0000 (08:33 -0700)]
rustc: Remove the `--passive-segments` LLD flag on wasm

This flag looks like it's been removed in LLVM 10, so this removes rustc
unconditionally passing the flag.

4 years agoAdd a warning about infinite reading in read_(until|line)
Alexis Bourget [Mon, 1 Jun 2020 14:19:10 +0000 (16:19 +0200)]
Add a warning about infinite reading in read_(until|line)

4 years agoRemove allow missing_debug_implementations for MaybeUninit
Konrad Borowski [Mon, 1 Jun 2020 13:36:45 +0000 (15:36 +0200)]
Remove allow missing_debug_implementations for MaybeUninit

It already has a Debug implementation.

4 years agoAuto merge of #71192 - oli-obk:eager_alloc_id_canonicalization, r=wesleywiser
bors [Mon, 1 Jun 2020 11:44:51 +0000 (11:44 +0000)]
Auto merge of #71192 - oli-obk:eager_alloc_id_canonicalization, r=wesleywiser

Make TLS accesses explicit in MIR

r? @rust-lang/wg-mir-opt

cc @RalfJung @vakaras for miri thread locals

cc @bjorn3 for cranelift

fixes #70685

4 years agoClean up E0637 explanation
Guillaume Gomez [Mon, 1 Jun 2020 11:07:29 +0000 (13:07 +0200)]
Clean up E0637 explanation

4 years agoAuto merge of #72844 - Dylan-DPC:rollup-i51qv5z, r=Dylan-DPC
bors [Mon, 1 Jun 2020 05:21:50 +0000 (05:21 +0000)]
Auto merge of #72844 - Dylan-DPC:rollup-i51qv5z, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #72776 (fulfill: try using SmallVec or Box for stalled_on)
 - #72818 (Clean up E0622 explanation)
 - #72823 (Add descriptions for all queries)
 - #72832 (RELEASES.md: Expand `cargo tree` note to mention `cargo tree -d`)
 - #72834 (Rephrase term 'non-pointer type')

Failed merges:

r? @ghost

4 years agoCorrect generic parameter ordering in error note
camelid [Mon, 1 Jun 2020 03:45:08 +0000 (20:45 -0700)]
Correct generic parameter ordering in error note

4 years agoRollup merge of #72834 - JOE1994:correct_confusing_term, r=sfackler
Dylan DPC [Mon, 1 Jun 2020 01:14:16 +0000 (03:14 +0200)]
Rollup merge of #72834 - JOE1994:correct_confusing_term, r=sfackler

Rephrase term 'non-pointer type'

Hello :cat2: ,

If the reader assumes that 'pointer type's include 'smart pointer's,
the term 'non-pointer type' could mislead the reader to assume that
x should not be a smart pointer type. I tried to rephrase the term
'non-pointer type' to remove ambiguity in the doc comments.

closes #72335

Thank you for reviewing this PR! :superhero_woman:

4 years agoRollup merge of #72832 - joshtriplett:cargo-tree-d, r=Mark-Simulacrum
Dylan DPC [Mon, 1 Jun 2020 01:14:14 +0000 (03:14 +0200)]
Rollup merge of #72832 - joshtriplett:cargo-tree-d, r=Mark-Simulacrum

RELEASES.md: Expand `cargo tree` note to mention `cargo tree -d`

Useful feature that people might not automatically associate with `cargo
tree`.

4 years agoRollup merge of #72823 - matthewjasper:describe-queries, r=eddyb
Dylan DPC [Mon, 1 Jun 2020 01:14:12 +0000 (03:14 +0200)]
Rollup merge of #72823 - matthewjasper:describe-queries, r=eddyb

Add descriptions for all queries

This also removes the default description for queries with DefId keys and makes the macro validate that a description is provided.

cc  #72730
r? @eddyb

4 years agoRollup merge of #72818 - GuillaumeGomez:cleanup-e0622, r=Dylan-DPC
Dylan DPC [Mon, 1 Jun 2020 01:14:10 +0000 (03:14 +0200)]
Rollup merge of #72818 - GuillaumeGomez:cleanup-e0622, r=Dylan-DPC

Clean up E0622 explanation

r? @Dylan-DPC

4 years agoRollup merge of #72776 - lcnr:stalled_on-smallvec, r=nnethercote
Dylan DPC [Mon, 1 Jun 2020 01:14:05 +0000 (03:14 +0200)]
Rollup merge of #72776 - lcnr:stalled_on-smallvec, r=nnethercote

fulfill: try using SmallVec or Box for stalled_on

Tested both `Box` and `SmallVec` for `stalled_on`, with both resulting in a perf loss.
Adds a comment mentioning this and removes an now outdated FIXME.

Logging the length of `stalled_on` resulted in the following distribution while building a part of stage 1 libs:
```
22627647 counts:
(  1) 20983696 (92.7%, 92.7%): process_obligation_len: 1
(  2)   959711 ( 4.2%, 97.0%): process_obligation_len: 2
(  3)   682326 ( 3.0%,100.0%): process_obligation_len: 0
(  4)     1914 ( 0.0%,100.0%): process_obligation_len: 3
```
cc @eddyb
r? @nnethercote

4 years agoMake `SourceMap` available for early debug-printing of `Span`s
Aaron Hill [Tue, 26 May 2020 17:21:58 +0000 (13:21 -0400)]
Make `SourceMap` available for early debug-printing of `Span`s

Normally, we debug-print `Spans` using the `SourceMap` retrieved from
the global `TyCtxt`. However, we fall back to printing out the `Span`'s
raw fields (instead of a file and line number) when we try to print a
`Span` before a `TyCtxt` is available. This makes debugging early phases
of the compile, such as parsing, much more difficult.

This commit stores a `SourceMap` in `rustc_span::GlOBALS` as a fallback.
When a `TyCtxt` is not available, we try to retrieve one from `GLOBALS`
- only if this is not available do we fall back to the raw field output.

I'm not sure how to write a test for this - however, this can be
verified locally by setting `RUSTC_LOG="rustc_parse=debug"`, and
verifying that the output contains filenames and line numbers.

4 years agoAuto merge of #72831 - Dylan-DPC:rollup-6rxjwt9, r=Dylan-DPC
bors [Sun, 31 May 2020 20:58:56 +0000 (20:58 +0000)]
Auto merge of #72831 - Dylan-DPC:rollup-6rxjwt9, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #72691 (Fix escape key handling)
 - #72807 (Avoid setting wrong obligation cause span of associated type mismatch)
 - #72812 (Miri tests: skip parts of test_char_range)
 - #72829 (Clarify terms in doc comments)
 - #72830 (Fix release notes for niche initialization change)

Failed merges:

r? @ghost

4 years agoRephrase term 'non-pointer type'
JOE1994 [Sun, 31 May 2020 19:58:06 +0000 (15:58 -0400)]
Rephrase term 'non-pointer type'
If the reader assumes that 'pointer type's include 'smart pointer's,
the term 'non-pointer type' could mislead the reader to assume that
x should not be a smart pointer type. I tried to rephrase the term
'non-pointer type' to remove ambiguity in the doc comments.

closes #72335

Thank you for reviewing this PR! :)

4 years agoRELEASES.md: Expand `cargo tree` note to mention `cargo tree -d`
Josh Triplett [Sun, 31 May 2020 19:39:28 +0000 (12:39 -0700)]
RELEASES.md: Expand `cargo tree` note to mention `cargo tree -d`

Useful feature that people might not automatically associate with `cargo
tree`.

4 years agoRollup merge of #72830 - rust-lang:sfackler-patch-1, r=Mark-Simulacrum
Dylan DPC [Sun, 31 May 2020 19:30:06 +0000 (21:30 +0200)]
Rollup merge of #72830 - rust-lang:sfackler-patch-1, r=Mark-Simulacrum

Fix release notes for niche initialization change

MaybeUninit is not affected by the linked PR.

4 years agoRollup merge of #72829 - JOE1994:clarify_terms, r=jonas-schievink
Dylan DPC [Sun, 31 May 2020 19:30:05 +0000 (21:30 +0200)]
Rollup merge of #72829 - JOE1994:clarify_terms, r=jonas-schievink

Clarify terms in doc comments

Doc comments of `copy_from_slice` say that people should use `clone_from_slice`
when 'src' doesn't implement `Copy`. However, 'src' is a reference and
it always implements `Copy`. The term 'src' should be fixed to `T`(element type of slice 'src') in
the doc comments.

Thank you for reviewing this PR :)  :smiley_cat:

4 years agoRollup merge of #72812 - RalfJung:miri-char-test, r=jonas-schievink
Dylan DPC [Sun, 31 May 2020 19:30:03 +0000 (21:30 +0200)]
Rollup merge of #72812 - RalfJung:miri-char-test, r=jonas-schievink

Miri tests: skip parts of test_char_range

The new `test_char_range` test takes forever in Miri as it loops over all values of `char`. This makes it skip most of them when being run in Miri.

4 years agoRollup merge of #72807 - xiaotianrandom:fix-assoc-type-diagnostics, r=estebank
Dylan DPC [Sun, 31 May 2020 19:30:01 +0000 (21:30 +0200)]
Rollup merge of #72807 - xiaotianrandom:fix-assoc-type-diagnostics, r=estebank

Avoid setting wrong obligation cause span of associated type mismatch

Removes code that sets wrong obligation cause span of associated type mismatch. See the linked issue for details.

Closes #72806.

4 years agoRollup merge of #72691 - GuillaumeGomez:escape-key-handling, r=kinnison
Dylan DPC [Sun, 31 May 2020 19:30:00 +0000 (21:30 +0200)]
Rollup merge of #72691 - GuillaumeGomez:escape-key-handling, r=kinnison

Fix escape key handling

Fixes #72647.

The problem was that you could have a timeout just after the moment you press "escape", putting back the results.

r? @kinnison

4 years agoAdd descriptions for all queries
Matthew Jasper [Sun, 31 May 2020 15:11:51 +0000 (16:11 +0100)]
Add descriptions for all queries