]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoApply suggestions from code review
Tim Diekmann [Mon, 3 Aug 2020 22:21:05 +0000 (00:21 +0200)]
Apply suggestions from code review

Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
3 years agoMerge branch 'master' into remove-in-place-alloc
Tim Diekmann [Mon, 3 Aug 2020 00:18:20 +0000 (02:18 +0200)]
Merge branch 'master' into remove-in-place-alloc

3 years agoAuto merge of #75070 - Manishearth:rollup-2kgcaw5, r=Manishearth
bors [Sun, 2 Aug 2020 22:07:32 +0000 (22:07 +0000)]
Auto merge of #75070 - Manishearth:rollup-2kgcaw5, r=Manishearth

Rollup of 5 pull requests

Successful merges:

 - #74980 (pprust: adjust mixed comment printing and add regression test for #74745)
 - #75009 (Document the discrepancy in the mask type for _mm_shuffle_ps)
 - #75031 (Do not trigger `unused_{braces,parens}` lints with `yield`)
 - #75059 (fix typos)
 - #75064 (compiletest: Support ignoring tests requiring missing LLVM components)

Failed merges:

r? @ghost

3 years agoRollup merge of #75064 - petrochenkov:llvmtarg, r=Mark-Simulacrum
Manish Goregaokar [Sun, 2 Aug 2020 20:08:48 +0000 (13:08 -0700)]
Rollup merge of #75064 - petrochenkov:llvmtarg, r=Mark-Simulacrum

compiletest: Support ignoring tests requiring missing LLVM components

This PR implements a more principled solution to the problem described in https://github.com/rust-lang/rust/pull/66084.

Builds of LLVM backends take a lot of time and disk space.
So it usually makes sense to build rustc with
```toml
[llvm]
targets = "X86"
experimental-targets = ""
```
unless you are working on some target-specific tasks.

A few tests, however, require non-x86 backends to be built.
A new test directive `// needs-llvm-components: component1 component2 component3` makes such tests to be automatically ignored if one of the listed components is missing in the provided LLVM (this is determined through `llvm-config --components`).

As a result, the test suite now fully passes with LLVM built only with the x86 backend. The component list in this case is
```
aggressiveinstcombine all all-targets analysis asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcerror orcjit passes profiledata remarks runtimedyld scalaropts selectiondag support symbolize tablegen target textapi transformutils vectorize windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray
```

(With the default target list it's much larger.)
```
aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray
```

https://github.com/rust-lang/rust/pull/66084 is also reverted now.

r? @Mark-Simulacrum

3 years agoRollup merge of #75059 - shengsheng:typos, r=Dylan-DPC
Manish Goregaokar [Sun, 2 Aug 2020 20:08:47 +0000 (13:08 -0700)]
Rollup merge of #75059 - shengsheng:typos, r=Dylan-DPC

fix typos

Fix common misspellings with https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines

3 years agoRollup merge of #75031 - JohnTitor:unused-parens-braces-yield, r=lcnr
Manish Goregaokar [Sun, 2 Aug 2020 20:08:45 +0000 (13:08 -0700)]
Rollup merge of #75031 - JohnTitor:unused-parens-braces-yield, r=lcnr

Do not trigger `unused_{braces,parens}` lints with `yield`

Fixes #74883
r? @lcnr

3 years agoRollup merge of #75009 - georgio:master, r=kennytm
Manish Goregaokar [Sun, 2 Aug 2020 20:08:43 +0000 (13:08 -0700)]
Rollup merge of #75009 - georgio:master, r=kennytm

Document the discrepancy in the mask type for _mm_shuffle_ps

This Pull Request updates the `stdarch` submodule in order to resolve #62490

3 years agoRollup merge of #74980 - davidtwco:issue-74745-pprust-regression-test, r=petrochenkov
Manish Goregaokar [Sun, 2 Aug 2020 20:08:42 +0000 (13:08 -0700)]
Rollup merge of #74980 - davidtwco:issue-74745-pprust-regression-test, r=petrochenkov

pprust: adjust mixed comment printing and add regression test for #74745

Fixes #74745.

This PR adds a regression test for #74745. While a `ignore-tidy-trailing-lines` header is required, this doesn't stop the test from reproducing, so long as there is no newline at the end of the file.

However, adding the header comments made the test fail due to a bug in pprust - so this PR also  adjusts the pretty printing of mixed comments so that the initial zero-break isn't emitted at the beginning of the line. Through this, the `block-comment-wchar` test can have the `pp-exact` file removed, as it no longer converges from pretty printing of the source.

3 years agoAuto merge of #74826 - matklad:mbe-fragment, r=petrochenkov
bors [Sun, 2 Aug 2020 19:48:44 +0000 (19:48 +0000)]
Auto merge of #74826 - matklad:mbe-fragment, r=petrochenkov

Introduce NonterminalKind for more type-safe mbe parsing

It encapsulate the (part of) the interface between the parser and
macro by example (macro_rules) parser.

The second bit is somewhat more general `parse_ast_fragment`, which is
the reason why we keep some `parse_xxx` functions as public.

3 years agoAuto merge of #74963 - JohnTitor:ptn-ice, r=petrochenkov
bors [Sun, 2 Aug 2020 18:01:27 +0000 (18:01 +0000)]
Auto merge of #74963 - JohnTitor:ptn-ice, r=petrochenkov

Fix ICEs with `@ ..` binding

This reverts #74557 and introduces an alternative fix while ensuring that #74954 is not broken.
The diagnostics are verbose though, it fixes three related issues.
cc #74954, #74539, and #74702

3 years agocompiletest: Support ignoring tests requiring missing LLVM components
Vadim Petrochenkov [Sun, 2 Aug 2020 15:23:49 +0000 (18:23 +0300)]
compiletest: Support ignoring tests requiring missing LLVM components

3 years agoRecover strictness for `yield`
Yuki Okushi [Sun, 2 Aug 2020 16:31:21 +0000 (01:31 +0900)]
Recover strictness for `yield`

3 years agoAuto merge of #75060 - JohnTitor:rollup-aq8sfxf, r=JohnTitor
bors [Sun, 2 Aug 2020 16:06:54 +0000 (16:06 +0000)]
Auto merge of #75060 - JohnTitor:rollup-aq8sfxf, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #74686 (BTreeMap: remove into_slices and its unsafe block)
 - #74762 (BTreeMap::drain_filter should not touch the root during iteration)
 - #74781 (Clean up E0733 explanation)
 - #74874 (BTreeMap: define forget_type only when relevant)
 - #74974 (Make tests faster in Miri)
 - #75010 (Update elasticlunr-rs and ammonia transitive deps)
 - #75041 (Replaced log with tracing crate)
 - #75044 (Clean up E0744 explanation)
 - #75054 (Rename rustc_middle::cstore::DepKind to CrateDepKind)
 - #75057 (Avoid dumping rustc invocations to stdout)

Failed merges:

 - #74827 (Move bulk of BTreeMap::insert method down to new method on handle)

r? @ghost

3 years agoRollup merge of #75057 - Mark-Simulacrum:avoid-long-print, r=alexcrichton
Yuki Okushi [Sun, 2 Aug 2020 16:05:28 +0000 (01:05 +0900)]
Rollup merge of #75057 - Mark-Simulacrum:avoid-long-print, r=alexcrichton

Avoid dumping rustc invocations to stdout

These are quite long, usually, and in most cases not interesting. On smaller
terminals they can take up more than a full page of output, hiding the error
diagnostics emitted.

3 years agoRollup merge of #75054 - cjgillot:rename-depkind, r=petrochenkov
Yuki Okushi [Sun, 2 Aug 2020 16:05:27 +0000 (01:05 +0900)]
Rollup merge of #75054 - cjgillot:rename-depkind, r=petrochenkov

Rename rustc_middle::cstore::DepKind to CrateDepKind

It is ambiguous with DepGraph's own DepKind.

3 years agoRollup merge of #75044 - GuillaumeGomez:cleanup-e0744, r=pickfire
Yuki Okushi [Sun, 2 Aug 2020 16:05:25 +0000 (01:05 +0900)]
Rollup merge of #75044 - GuillaumeGomez:cleanup-e0744, r=pickfire

Clean up E0744 explanation

r? @Dylan-DPC

3 years agoRollup merge of #75041 - pawanbisht62:feature/replace-log-with-tracing, r=oli-obk
Yuki Okushi [Sun, 2 Aug 2020 16:05:23 +0000 (01:05 +0900)]
Rollup merge of #75041 - pawanbisht62:feature/replace-log-with-tracing, r=oli-obk

Replaced log with tracing crate

Issue #74747

3 years agoRollup merge of #75010 - Aaron1011:feature/remove-old-deps, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:22 +0000 (01:05 +0900)]
Rollup merge of #75010 - Aaron1011:feature/remove-old-deps, r=Mark-Simulacrum

Update elasticlunr-rs and ammonia transitive deps

This removes all dependencies on pre-1.0 proc-macro ecosystem crates
(syn, quote, and proc-macro2)

3 years agoRollup merge of #74974 - RalfJung:miri-tests, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:20 +0000 (01:05 +0900)]
Rollup merge of #74974 - RalfJung:miri-tests, r=Mark-Simulacrum

Make tests faster in Miri

Reduce some test iteration counts in Miri.

3 years agoRollup merge of #74874 - ssomers:btree_cleanup_8, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:18 +0000 (01:05 +0900)]
Rollup merge of #74874 - ssomers:btree_cleanup_8, r=Mark-Simulacrum

BTreeMap: define forget_type only when relevant

Similar to `forget_node_type` for handles.
No effect on generated code, apart maybe from the superfluous calls that might not have been optimized away.

r? @Mark-Simulacrum

3 years agoRollup merge of #74781 - GuillaumeGomez:cleanup-e0733, r=jyn514
Yuki Okushi [Sun, 2 Aug 2020 16:05:15 +0000 (01:05 +0900)]
Rollup merge of #74781 - GuillaumeGomez:cleanup-e0733, r=jyn514

Clean up E0733 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74762 - ssomers:btree_no_root_in_remove_kv_tracking, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:13 +0000 (01:05 +0900)]
Rollup merge of #74762 - ssomers:btree_no_root_in_remove_kv_tracking, r=Mark-Simulacrum

BTreeMap::drain_filter should not touch the root during iteration

Although Miri doesn't point it out, I believe there is undefined behaviour using `drain_filter` when draining the 11th-last element from a tree that was larger. When this happens, the last remaining child nodes are merged, the root becomes empty and is popped from the tree. That last step establishes a mutable reference to the node elected root and writes a pointer in `node::Root`, while iteration continues to visit the same node.

This is mostly code from #74437, slightly adapted.

3 years agoRollup merge of #74686 - ssomers:btree_cleanup_3, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:12 +0000 (01:05 +0900)]
Rollup merge of #74686 - ssomers:btree_cleanup_3, r=Mark-Simulacrum

BTreeMap: remove into_slices and its unsafe block

A small tweak to make BTreeMap code shorter and less unsafe.

r? @Mark-Simulacrum

3 years agoDocument the discrepancy in the mask type for _mm_shuffle_ps
Georgio Nicolas [Sun, 2 Aug 2020 15:22:26 +0000 (18:22 +0300)]
Document the discrepancy in the mask type for _mm_shuffle_ps

3 years agofix typos
liuzhenyu [Sun, 2 Aug 2020 15:20:00 +0000 (23:20 +0800)]
fix typos

3 years agoAvoid dumping rustc invocations to stdout
Mark Rousskov [Sun, 2 Aug 2020 14:54:13 +0000 (10:54 -0400)]
Avoid dumping rustc invocations to stdout

These are quite long, usually, and in most cases not interesting. On smaller
terminals they can take up more than a full page of output, hiding the error
diagnostics emitted.

3 years agocompiletest: print diff for pretty tests
David Wood [Sun, 2 Aug 2020 14:31:06 +0000 (15:31 +0100)]
compiletest: print diff for pretty tests

This commit modifies compiletest so that a diff of actual and expected
output is shown for pretty tests. This makes it far easier to work out
what has changed.

Signed-off-by: David Wood <david@davidtw.co>
3 years agotests: add regression test for #74745
David Wood [Fri, 31 Jul 2020 13:53:44 +0000 (14:53 +0100)]
tests: add regression test for #74745

This commit adds a regression test for #74745. While a
`ignore-tidy-trailing-lines` header is required, this doesn't stop the
test from reproducing, so long as there is no newline at the end of the
file.

However, adding the header comments made the test fail due to a bug in
pprust, fixed in the previous commit.

Signed-off-by: David Wood <david@davidtw.co>
3 years agopprust: adjust mixed comment printing
David Wood [Sun, 2 Aug 2020 14:27:03 +0000 (15:27 +0100)]
pprust: adjust mixed comment printing

This commit adjusts the pretty printing of mixed comments so that the
initial zero-break isn't emitted at the beginning of the line. Through
this, the `block-comment-wchar` test can have the `pp-exact` file
removed, as it no longer converges from pretty printing of the source.

Signed-off-by: David Wood <david@davidtw.co>
3 years agoRename rustc_middle::cstore::DepKind to DependencyKind.
Camille GILLOT [Sun, 2 Aug 2020 12:24:22 +0000 (14:24 +0200)]
Rename rustc_middle::cstore::DepKind to DependencyKind.

3 years agoAuto merge of #74675 - pietroalbini:aarch64-ci-fallible, r=Mark-Simulacrum
bors [Sun, 2 Aug 2020 14:08:48 +0000 (14:08 +0000)]
Auto merge of #74675 - pietroalbini:aarch64-ci-fallible, r=Mark-Simulacrum

Add fallible AArch64 CI builder

This adds the `aarch64-gnu` CI builder to the `auto-fallible` job, as a first step in the process of actually gating on it.

r? @Mark-Simulacrum

3 years agoAuto merge of #74210 - estebank:type-ascriptomatic, r=petrochenkov
bors [Sun, 2 Aug 2020 12:20:09 +0000 (12:20 +0000)]
Auto merge of #74210 - estebank:type-ascriptomatic, r=petrochenkov

Deduplicate `::` -> `:` typo errors

Deduplicate errors caused by the same type ascription typo, including
ones suggested during parsing that would get reported again during
resolve. Fix #70382.

3 years agoFormatting: don't mix mod and use
Aleksey Kladov [Sun, 2 Aug 2020 12:05:19 +0000 (14:05 +0200)]
Formatting: don't mix mod and use

Seems to be a fallout from rustfmt transition

3 years agoUse NonterminalKind for MetaVarDecl
Aleksey Kladov [Sat, 1 Aug 2020 15:45:17 +0000 (17:45 +0200)]
Use NonterminalKind for MetaVarDecl

This is more type safe and allows us to remove a few dead branches

3 years agoIntroduce NonterminalKind
Aleksey Kladov [Mon, 27 Jul 2020 12:04:54 +0000 (14:04 +0200)]
Introduce NonterminalKind

It encapsulate the (part of) the interface between the parser and
macro by example (macro_rules) parser.

The second bit is somewhat more general `parse_ast_fragment`, which is
the reason why we keep some `parse_xxx` functions as public.

3 years agoClean up E0744 explanation
Guillaume Gomez [Sun, 2 Aug 2020 11:26:02 +0000 (13:26 +0200)]
Clean up E0744 explanation

3 years agoClean up E0733 explanation
Guillaume Gomez [Sun, 26 Jul 2020 15:38:47 +0000 (17:38 +0200)]
Clean up E0733 explanation

3 years agoAuto merge of #74972 - second-state:wasi-right-fix, r=KodrAus
bors [Sun, 2 Aug 2020 09:41:17 +0000 (09:41 +0000)]
Auto merge of #74972 - second-state:wasi-right-fix, r=KodrAus

Fix std::fs::File::metadata permission on WASI target

Previously `std::fs::File::metadata` on wasm32-wasi would call `fd_filestat_get`
to get metadata associated with fd, but that fd is opened without
RIGHTS_FD_FILESTAT_GET right, so it will failed on correctly implemented WASI
environment.

This change instead to add the missing rights when opening an fd.

3 years agoReplace from log to tracing
bishtpawan [Sun, 2 Aug 2020 07:54:08 +0000 (13:24 +0530)]
Replace from log to tracing

3 years agoAuto merge of #74899 - sajattack:libc_0.2.74_bump, r=jonas-schievink
bors [Sun, 2 Aug 2020 07:23:14 +0000 (07:23 +0000)]
Auto merge of #74899 - sajattack:libc_0.2.74_bump, r=jonas-schievink

bump libc version to 0.2.74

3 years agoReplace from log to tracing in libsrustrustc_ast_lowering, librustc_ast_passes, libru...
bishtpawan [Sun, 2 Aug 2020 06:51:39 +0000 (12:21 +0530)]
Replace from log to tracing in libsrustrustc_ast_lowering, librustc_ast_passes, librustc_ast_pretty

3 years agoAuto merge of #75004 - Aaron1011:move-probably-equal, r=petrochenkov
bors [Sun, 2 Aug 2020 05:34:40 +0000 (05:34 +0000)]
Auto merge of #75004 - Aaron1011:move-probably-equal, r=petrochenkov

Move 'probably equal' methods to librustc_parse

This is preparation for PR #73084

3 years agoAuto merge of #74785 - euclio:deprecation-kinds, r=petrochenkov
bors [Sun, 2 Aug 2020 03:47:29 +0000 (03:47 +0000)]
Auto merge of #74785 - euclio:deprecation-kinds, r=petrochenkov

report kind of deprecated item in message

This is important for fields, which are incorrectly referred to as
"items".

3 years agoUpdate elasticlunr-rs and ammonia transitive deps
Aaron Hill [Sat, 1 Aug 2020 14:11:15 +0000 (10:11 -0400)]
Update elasticlunr-rs and ammonia transitive deps

This removes all dependencies on pre-1.0 proc-macro ecosystem crates
(syn, quote, and proc-macro2)

3 years agoMove 'probably equal' methods to librustc_parse
Aaron Hill [Sat, 1 Aug 2020 11:59:02 +0000 (07:59 -0400)]
Move 'probably equal' methods to librustc_parse

This is preparation for PR #73084

3 years agoAuto merge of #75033 - Manishearth:rollup-d8afil1, r=Manishearth
bors [Sun, 2 Aug 2020 01:04:54 +0000 (01:04 +0000)]
Auto merge of #75033 - Manishearth:rollup-d8afil1, r=Manishearth

Rollup of 5 pull requests

Successful merges:

 - #74602 (Clarify the doc for MaybeUninit::zeroed on incorrect use)
 - #74720 (Clean up E0728 explanation)
 - #74992 (fix rustdoc generic param order)
 - #75015 (Add Vec::spare_capacity_mut)
 - #75022 (Use a slice pattern instead of rchunks_exact(_).next())

Failed merges:

r? @ghost

3 years agoRollup merge of #75022 - cuviper:sliced-rchunk, r=lcnr
Manish Goregaokar [Sun, 2 Aug 2020 00:42:18 +0000 (17:42 -0700)]
Rollup merge of #75022 - cuviper:sliced-rchunk, r=lcnr

Use a slice pattern instead of rchunks_exact(_).next()

This is a minor cleanup, but trying a single-use `rchunks` iterator can
be more directly matched with a slice pattern, `[.., a, b]`.

3 years agoRollup merge of #75015 - Amanieu:vec_spare, r=sfackler
Manish Goregaokar [Sun, 2 Aug 2020 00:42:16 +0000 (17:42 -0700)]
Rollup merge of #75015 - Amanieu:vec_spare, r=sfackler

Add Vec::spare_capacity_mut

Returns the remaining spare capacity of the vector as a slice of `MaybeUninit<T>`.

As suggested by @sfackler in https://github.com/rust-lang/rust/pull/70967#issuecomment-612659006.

r? @sfackler

3 years agoRollup merge of #74992 - lcnr:fix-generic-param-order, r=GuillaumeGomez
Manish Goregaokar [Sun, 2 Aug 2020 00:42:15 +0000 (17:42 -0700)]
Rollup merge of #74992 - lcnr:fix-generic-param-order, r=GuillaumeGomez

fix rustdoc generic param order

fixes #61292

r? @varkor cc @GuillaumeGomez

3 years agoRollup merge of #74720 - GuillaumeGomez:cleanup-e0728, r=jyn514
Manish Goregaokar [Sun, 2 Aug 2020 00:42:13 +0000 (17:42 -0700)]
Rollup merge of #74720 - GuillaumeGomez:cleanup-e0728, r=jyn514

Clean up E0728 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74602 - poliorcetics:maybe-uninit-zeroed-doc-clarification, r=jyn514
Manish Goregaokar [Sun, 2 Aug 2020 00:42:11 +0000 (17:42 -0700)]
Rollup merge of #74602 - poliorcetics:maybe-uninit-zeroed-doc-clarification, r=jyn514

Clarify the doc for MaybeUninit::zeroed on incorrect use

Fixes #74343.

@rustbot modify labels: C-enhancement, T-doc

3 years agoAuto merge of #74605 - rust-lang:vec-leak, r=Amanieu
bors [Sat, 1 Aug 2020 22:29:30 +0000 (22:29 +0000)]
Auto merge of #74605 - rust-lang:vec-leak, r=Amanieu

Stabilize Vec::leak as a method

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

The signature is changed to a method rather than an associated function:

```diff
-pub fn leak<'a>(vec: Vec<T>) -> &'a mut [T]
+pub fn leak<'a>(self) -> &'a mut [T]
```

The reason for `Box::leak` not to be a method (`Deref` to an arbitrary `T` which might have its own, different `leak` method) does not apply.

3 years agoDo not trigger `unused_{braces,parens}` lints with `yield`
Yuki Okushi [Sat, 1 Aug 2020 22:20:28 +0000 (07:20 +0900)]
Do not trigger `unused_{braces,parens}` lints with `yield`

3 years agoBTreeMap::drain_filter no longer touches the root during iteration
Stein Somers [Tue, 14 Jul 2020 09:32:50 +0000 (11:32 +0200)]
BTreeMap::drain_filter no longer touches the root during iteration

3 years agoAuto merge of #74726 - oli-obk:tracing, r=Mark-Simulacrum
bors [Sat, 1 Aug 2020 20:43:12 +0000 (20:43 +0000)]
Auto merge of #74726 - oli-obk:tracing, r=Mark-Simulacrum

Move from `log` to `tracing`

The only visible change is that we now get timestamps in our logs:

```
Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: skipping replace of Rvalue::Use(const () because it is already a const
Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: propagated into _2
Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: visit_constant: const ()
```

This PR was explicitly designed to be as low-impact as possible. We can now move to using the name `tracing` insteads of `log` on a crate-by-crate basis and use any of the other tracing features where desirable.

As far as I can tell this will allow tools to seamlessly keep working (since they are using `rustc_driver::init_log...`).

This is the first half of step 1 of the accepted `tracing` MCP (https://github.com/rust-lang/compiler-team/issues/331)

3 years agoRemove a trailing whitespace
Tim Diekmann [Sat, 1 Aug 2020 19:53:00 +0000 (21:53 +0200)]
Remove a trailing whitespace

3 years agoUpdate doc-comment for grow_zeroed
Tim Diekmann [Sat, 1 Aug 2020 19:51:50 +0000 (21:51 +0200)]
Update doc-comment for grow_zeroed

3 years agoAuto merge of #75016 - Manishearth:rollup-x553g7j, r=Manishearth
bors [Sat, 1 Aug 2020 18:52:30 +0000 (18:52 +0000)]
Auto merge of #75016 - Manishearth:rollup-x553g7j, r=Manishearth

Rollup of 6 pull requests

Successful merges:

 - #74977 (Clean up E0741 error explanation)
 - #74981 (Some fixes for `plugin.md` in unstable-book)
 - #74983 (Replace a recursive algorithm with an iterative one and a stack.)
 - #74995 (Update the WASI libc build to LLVM 10.)
 - #74996 (submodules: update cargo from 974eb438d to 2d5c2381e)
 - #75007 (Clean up E0743 explanation)

Failed merges:

r? @ghost

3 years agoUse a slice pattern instead of rchunks_exact(_).next()
Josh Stone [Sat, 1 Aug 2020 18:41:59 +0000 (11:41 -0700)]
Use a slice pattern instead of rchunks_exact(_).next()

This is a minor cleanup, but trying a single-use `rchunks` iterator can
be more directly matched with a slice pattern, `[.., a, b]`.

3 years agoMore benchmarks of BTreeMap mutation
Stein Somers [Sat, 1 Aug 2020 11:10:12 +0000 (13:10 +0200)]
More benchmarks of BTreeMap mutation

3 years agoReword incorrect use of zeroed()
Alexis Bourget [Sat, 1 Aug 2020 17:28:19 +0000 (19:28 +0200)]
Reword incorrect use of zeroed()

3 years agoAdd Vec::spare_capacity_mut
Amanieu d'Antras [Sat, 1 Aug 2020 16:03:04 +0000 (17:03 +0100)]
Add Vec::spare_capacity_mut

3 years agoRollup merge of #75007 - GuillaumeGomez:cleanup-e0743, r=pickfire
Manish Goregaokar [Sat, 1 Aug 2020 16:30:19 +0000 (09:30 -0700)]
Rollup merge of #75007 - GuillaumeGomez:cleanup-e0743, r=pickfire

Clean up E0743 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74996 - matthiaskrgr:submodule_upd, r=ehuss
Manish Goregaokar [Sat, 1 Aug 2020 16:30:18 +0000 (09:30 -0700)]
Rollup merge of #74996 - matthiaskrgr:submodule_upd, r=ehuss

submodules: update cargo from 974eb438d to 2d5c2381e

Changes:
````
Use the same index location on nightly as beta
relax deprecated diagnostic message check
Don't print to raw stderr in test
Emit the `test` field in cargo metadata
````

r? @ehuss

Trying to get the fix to the registry-index-hash upstream soonish.

3 years agoRollup merge of #74995 - sunfishcode:update-llvm, r=alexcrichton
Manish Goregaokar [Sat, 1 Aug 2020 16:30:16 +0000 (09:30 -0700)]
Rollup merge of #74995 - sunfishcode:update-llvm, r=alexcrichton

Update the WASI libc build to LLVM 10.

Among other things, this brings in [the `__main_argc_argv`] patch,
which simplifies the interaction between the compiler and WASI libc's
startup code, which will help work on reactor support.

[the `__main_argc_argv` patch]: https://github.com/llvm/llvm-project/commit/00072c08c75050ae2c835b7bb0e505475dbcd7b9

r? @alexcrichton

3 years agoRollup merge of #74983 - oli-obk:mir_opt_goto_chain, r=ecstatic-morse
Manish Goregaokar [Sat, 1 Aug 2020 16:30:14 +0000 (09:30 -0700)]
Rollup merge of #74983 - oli-obk:mir_opt_goto_chain, r=ecstatic-morse

Replace a recursive algorithm with an iterative one and a stack.

fixes #74931

3 years agoRollup merge of #74981 - giraffate:fix_sample_codes_in_unstable_book_plugin, r=Guilli...
Manish Goregaokar [Sat, 1 Aug 2020 16:30:13 +0000 (09:30 -0700)]
Rollup merge of #74981 - giraffate:fix_sample_codes_in_unstable_book_plugin, r=GuilliameGomez

Some fixes for `plugin.md` in unstable-book

- sample codes not working
I referred to https://github.com/rust-lang/rust/blob/master/src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs and https://github.com/rust-lang/rust/blob/master/src/test/ui-fulldeps/lint-plugin.rs.

- broken link
https://github.com/rust-lang/rust/blob/master/src/librustc/lint/builtin.rs -> https://github.com/rust-lang/rust/blob/master/src/librustc_session/lint/builtin.rs

3 years agoRollup merge of #74977 - GuillaumeGomez:cleanup-e0741, r=pickfire
Manish Goregaokar [Sat, 1 Aug 2020 16:30:11 +0000 (09:30 -0700)]
Rollup merge of #74977 - GuillaumeGomez:cleanup-e0741, r=pickfire

Clean up E0741 error explanation

r? @Dylan-DPC

3 years agoRemove chrono feature from tracing
Oliver Scherer [Sat, 1 Aug 2020 14:24:52 +0000 (16:24 +0200)]
Remove chrono feature from tracing

3 years agoClean up E0743 explanation
Guillaume Gomez [Sat, 1 Aug 2020 13:19:00 +0000 (15:19 +0200)]
Clean up E0743 explanation

3 years agoDefine forget_type only when relevant
Stein Somers [Sun, 26 Jul 2020 13:01:43 +0000 (15:01 +0200)]
Define forget_type only when relevant

3 years agoAuto merge of #74993 - sunfishcode:update-wasi-libc, r=alexcrichton
bors [Sat, 1 Aug 2020 11:25:31 +0000 (11:25 +0000)]
Auto merge of #74993 - sunfishcode:update-wasi-libc, r=alexcrichton

Update the bundled wasi-libc with libstd

This just updates WASI libc, in preparation for WASI reactor support in
a separate change.

r? @alexcrichton

3 years agoAuto merge of #74582 - Lezzz:rename-hair, r=nikomatsakis
bors [Sat, 1 Aug 2020 09:25:03 +0000 (09:25 +0000)]
Auto merge of #74582 - Lezzz:rename-hair, r=nikomatsakis

Rename HAIR to THIR (Typed HIR).

r? @nikomatsakis

Originally suggested by @eddyb

3 years agoAuto merge of #74373 - lcnr:array_chunks, r=withoutboats
bors [Sat, 1 Aug 2020 06:54:14 +0000 (06:54 +0000)]
Auto merge of #74373 - lcnr:array_chunks, r=withoutboats

add `slice::array_chunks` to std

Now that #74113 has landed, these methods are suddenly usable. A rebirth of #72334

Tests are directly copied from `chunks_exact` and some additional tests for type inference.

r? @withoutboats as you are both part of t-libs and working on const generics. closes #60735

3 years agoadd tracking issue
Bastian Kauschke [Sat, 1 Aug 2020 05:49:24 +0000 (07:49 +0200)]
add tracking issue

3 years agoReplace a recursive algorithm with an iterative one and a stack.
Oliver Scherer [Fri, 31 Jul 2020 16:40:25 +0000 (18:40 +0200)]
Replace a recursive algorithm with an iterative one and a stack.

3 years agoAuto merge of #74945 - dingxiangfei2009:promote-static-ref-deref, r=oli-obk
bors [Sat, 1 Aug 2020 04:34:05 +0000 (04:34 +0000)]
Auto merge of #74945 - dingxiangfei2009:promote-static-ref-deref, r=oli-obk

[mir] Special treatment for dereferencing a borrow to a static definition

Fix #70584.

As suggested by @oli-obk in this [comment](https://github.com/rust-lang/rust/issues/70584#issuecomment-626009260), one can chase the definition of the local variable being de-referenced and check if it is a true static variable. If that is the case, `validate_place` will admit the promotion.

This is my first time to contribute to `rustc`, and I have two questions.
1. A generalization to some extent is applied to decide if the promotion is possible in the static context. In case that there are more projection operations preceding the de-referencing, `validate_place` recursively decent into inner projection operations. I have put thoughts into its correctness but I am not totally sure about it.
2. I have a hard time to find a good place for the test case. This patch has to do with MIR, but this test case would look out of place compared to other tests in `src/test/ui/mir` or `src/test/ui/borrowck` because it does not generate errors while others do. It is tentatively placed in `src/test/ui/statics` for now.

Thank you for any comments and suggestions!

3 years agoAuto merge of #74717 - davidtwco:issue-74636-polymorphized-closures-inherited-params...
bors [Sat, 1 Aug 2020 02:48:34 +0000 (02:48 +0000)]
Auto merge of #74717 - davidtwco:issue-74636-polymorphized-closures-inherited-params, r=oli-obk

mir: add `used_generic_parameters_needs_subst`

Fixes #74636.

This PR adds a `used_generic_parameters_needs_subst` helper function which checks whether a type needs substitution, but only for parameters that the `unused_generic_params` query considers used. This is used in the MIR interpreter to make the check for some pointer casts and for reflection intrinsics more precise.

I've opened this as a draft PR because this might not be the approach we want to fix this issue and we have to decide what to do about the reflection case.

r? @eddyb
cc @lcnr @wesleywiser

3 years agoAuto merge of #74994 - JohnTitor:rollup-eknaekv, r=JohnTitor
bors [Fri, 31 Jul 2020 23:52:46 +0000 (23:52 +0000)]
Auto merge of #74994 - JohnTitor:rollup-eknaekv, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #74644 (Remove `linked_list_extras` methods.)
 - #74968 (Run all tests if have no specified tests)
 - #74982 (1.45.2 release notes)
 - #74984 (Miri: fix ICE when unwinding past topmost stack frame)
 - #74986 (fix part of comparison that would always evaluate to "true", probably an oversight)
 - #74991 (Fix Const-Generic Cycle ICE #74199)

Failed merges:

r? @ghost

3 years agosubmodules: update cargo from 974eb438d to 2d5c2381e
Matthias Krüger [Fri, 31 Jul 2020 23:41:36 +0000 (01:41 +0200)]
submodules: update cargo from 974eb438d to 2d5c2381e

Changes:
````
Use the same index location on nightly as beta
relax deprecated diagnostic message check
Don't print to raw stderr in test
Emit the `test` field in cargo metadata
````

3 years agoUpdate the WASI libc build to LLVM 10.
Dan Gohman [Fri, 31 Jul 2020 23:07:08 +0000 (16:07 -0700)]
Update the WASI libc build to LLVM 10.

Among other things, this brings in [the `__main_argc_argv`] patch,
which simplifies the interaction between the compiler and WASI libc's
startup code, which will help work on reactor support.

[the `__main_argc_argv` patch]: https://github.com/llvm/llvm-project/commit/00072c08c75050ae2c835b7bb0e505475dbcd7b9

3 years agoRollup merge of #74991 - JulianKnodt:74199, r=lcnr
Yuki Okushi [Fri, 31 Jul 2020 23:02:12 +0000 (08:02 +0900)]
Rollup merge of #74991 - JulianKnodt:74199, r=lcnr

Fix Const-Generic Cycle ICE #74199

This PR intends to fix the bug in Issue #74199 by following the suggestion provided of ignoring the error that causes the ICE.

This does not fix the underlying cycle detection issue, but fixes the ICE.
Also adds a test to check that it doesn't causes an ICE but returns a valid error for now.

r? @lcnr

Edit: Also it's funny how this PR number is an anagram of the issue number

3 years agoRollup merge of #74986 - matthiaskrgr:cmp_true, r=oli-obk
Yuki Okushi [Fri, 31 Jul 2020 23:02:11 +0000 (08:02 +0900)]
Rollup merge of #74986 - matthiaskrgr:cmp_true, r=oli-obk

fix part of comparison that would always evaluate to "true", probably an oversight

cc  @jumbatm

3 years agoRollup merge of #74984 - RalfJung:miri-unwind-top, r=oli-obk
Yuki Okushi [Fri, 31 Jul 2020 23:02:09 +0000 (08:02 +0900)]
Rollup merge of #74984 - RalfJung:miri-unwind-top, r=oli-obk

Miri: fix ICE when unwinding past topmost stack frame

Fixes https://github.com/rust-lang/miri/issues/1389

3 years agoRollup merge of #74982 - jonas-schievink:relnotes-1.45.2, r=Mark-Simulacrum
Yuki Okushi [Fri, 31 Jul 2020 23:02:07 +0000 (08:02 +0900)]
Rollup merge of #74982 - jonas-schievink:relnotes-1.45.2, r=Mark-Simulacrum

1.45.2 release notes

(for master)

cc https://github.com/rust-lang/rust/pull/74958

3 years agoRollup merge of #74968 - lzutao:no-args, r=Mark-Simulacrum
Yuki Okushi [Fri, 31 Jul 2020 23:02:06 +0000 (08:02 +0900)]
Rollup merge of #74968 - lzutao:no-args, r=Mark-Simulacrum

Run all tests if have no specified tests

The behaviour was changed in https://github.com/rust-lang/rust/pull/74905#discussion_r463259562
cc @alex if you could check it again, thank you.

3 years agoRollup merge of #74644 - crlf0710:drop_old_stuff, r=Amanieu
Yuki Okushi [Fri, 31 Jul 2020 23:02:04 +0000 (08:02 +0900)]
Rollup merge of #74644 - crlf0710:drop_old_stuff, r=Amanieu

Remove `linked_list_extras` methods.

Removing these in favor of the `Cursor` API in https://github.com/rust-lang/rust/issues/58533 .
Closes #27794.

r? @Amanieu

3 years agoRename HAIR to THIR (Typed HIR).
Valentin Lazureanu [Tue, 21 Jul 2020 09:09:27 +0000 (09:09 +0000)]
Rename HAIR to THIR (Typed HIR).

3 years agofix rustdoc generic param order
Bastian Kauschke [Fri, 31 Jul 2020 21:51:19 +0000 (23:51 +0200)]
fix rustdoc generic param order

3 years agoUpdate the bundled wasi-libc with libstd
Dan Gohman [Fri, 31 Jul 2020 21:47:19 +0000 (14:47 -0700)]
Update the bundled wasi-libc with libstd

This just updates WASI libc, in preparation for WASI reactor support in
a separate change.

3 years agoAdded in explicit check for the type being matched
kadmin [Fri, 31 Jul 2020 21:33:55 +0000 (21:33 +0000)]
Added in explicit check for the type being matched

3 years agoRemoved error check in order to prevent ICE
kadmin [Fri, 31 Jul 2020 21:12:05 +0000 (21:12 +0000)]
Removed error check in order to prevent ICE

3 years agoDon't register a tracing dispatcher if no tracing env var was set.
Oliver Scherer [Tue, 28 Jul 2020 13:49:04 +0000 (15:49 +0200)]
Don't register a tracing dispatcher if no tracing env var was set.

3 years agoDisable log support
Oliver Scherer [Sun, 26 Jul 2020 11:01:51 +0000 (13:01 +0200)]
Disable log support

3 years agoUpdate error index generator to tracing
Oliver Scherer [Sat, 25 Jul 2020 15:19:17 +0000 (17:19 +0200)]
Update error index generator to tracing

3 years agoMake rustdoc share the logger initialization routine with rustc.
Oliver Scherer [Sat, 25 Jul 2020 13:50:51 +0000 (15:50 +0200)]
Make rustdoc share the logger initialization routine with rustc.

3 years agoAdd tracing libs to list of permitted dependencies
Oliver Scherer [Fri, 24 Jul 2020 19:35:14 +0000 (21:35 +0200)]
Add tracing libs to list of permitted dependencies

3 years agoMove from `log` to `tracing`
Oliver Scherer [Fri, 24 Jul 2020 18:42:00 +0000 (20:42 +0200)]
Move from `log` to `tracing`

3 years agofix part of comparison that would always evaluate to "true", probably an oversight
Matthias Krüger [Fri, 31 Jul 2020 19:23:39 +0000 (21:23 +0200)]
fix part of comparison that would always evaluate to "true", probably an oversight

3 years agoMiri: fix ICE when unwinding past topmost stack frame
Ralf Jung [Fri, 31 Jul 2020 18:46:05 +0000 (20:46 +0200)]
Miri: fix ICE when unwinding past topmost stack frame