]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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 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 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

3 years agoReduce verbosity of some type ascription errors
Esteban Küber [Thu, 9 Jul 2020 20:49:55 +0000 (13:49 -0700)]
Reduce verbosity of some type ascription errors

* Deduplicate type ascription LHS errors
* Remove duplicated `:` -> `::` suggestion from parse error
* Tweak wording to be more accurate
* Modify `current_type_ascription` to reduce span wrangling
* remove now unnecessary match arm
* Add run-rustfix to appropriate tests

3 years agoAuto merge of #65989 - Aaron1011:fix/normalize-param-env, r=nikomatsakis
bors [Fri, 31 Jul 2020 18:14:59 +0000 (18:14 +0000)]
Auto merge of #65989 - Aaron1011:fix/normalize-param-env, r=nikomatsakis

Normalize all opaque types when converting ParamEnv to Reveal::All

When we normalize a type using a ParamEnv with a reveal mode of
RevealMode::All, we will normalize opaque types to their underlying
types (e.g. `type MyOpaque = impl Foo` -> `StructThatImplsFoo`).
However, the ParamEnv may still have predicates referring to the
un-normalized opaque type (e.g. `<T as MyTrait<MyOpaque>>`). This can
cause trait projection to fail, since a type containing normalized
opaque types will not match up with the un-normalized type in the
`ParamEnv`.

To fix this, we now explicitly normalize all opaque types in
caller_bounds of a `ParamEnv` when changing its mode to
`RevealMode::All`. This ensures that all predicatse will refer to the
underlying types of any opaque types involved, allowing them to be
matched up properly during projection. To reflect the fact that
normalization is occuring, `ParamEnv::with_reveal_all` is renamed to
`ParamEnv::with_reveal_all_normalized`

Fixes #65918

3 years agoRemove `linked_list_extras` methods.
Charles Lew [Wed, 22 Jul 2020 17:30:54 +0000 (01:30 +0800)]
Remove `linked_list_extras` methods.

3 years ago1.45.2 release notes
Mark Rousskov [Thu, 30 Jul 2020 20:12:02 +0000 (16:12 -0400)]
1.45.2 release notes

3 years agointerp: needs_subst -> ensure_monomorphic_enough
David Wood [Fri, 24 Jul 2020 12:16:54 +0000 (13:16 +0100)]
interp: needs_subst -> ensure_monomorphic_enough

This commit adds a `ensure_monomorphic_enough` utility function which
checks whether a type needs substitution, but only for parameters
that the `unused_generic_params` query considers used.

`ensure_monomorphic_enough` is then used throughout interpret where
`needs_subst` checks previously existed (in particular, for some
pointer casts and for reflection intrinsics more precise).

Signed-off-by: David Wood <david@davidtw.co>
3 years agoSome fixes for `plugin.md` in unstable-book
Takayuki Nakata [Fri, 31 Jul 2020 14:53:05 +0000 (23:53 +0900)]
Some fixes for `plugin.md` in unstable-book

- sample codes not working
- broken link

3 years agoAuto merge of #74844 - asomers:freebsd-profiler, r=pietroalbini
bors [Fri, 31 Jul 2020 12:27:13 +0000 (12:27 +0000)]
Auto merge of #74844 - asomers:freebsd-profiler, r=pietroalbini

Enable the profiler on FreeBSD

FreeBSD has been doing this in our own package builds for two months
now.

https://svnweb.freebsd.org/ports?view=revision&revision=535771

3 years agoClean up E0741 error explanation
Guillaume Gomez [Fri, 31 Jul 2020 11:15:47 +0000 (13:15 +0200)]
Clean up E0741 error explanation

3 years agoAuto merge of #74965 - JohnTitor:sort-params, r=estebank
bors [Fri, 31 Jul 2020 10:16:57 +0000 (10:16 +0000)]
Auto merge of #74965 - JohnTitor:sort-params, r=estebank

Presort restrictions to make output consistent

The const test part is already adjusted so this should fix #74886.
r? @estebank

3 years agoAdd the proper tests
Ding Xiang Fei [Fri, 31 Jul 2020 10:04:13 +0000 (18:04 +0800)]
Add the proper tests

3 years agoFix std::fs::File::metadata permission on WASI target
Shen-Ta Hsieh [Fri, 31 Jul 2020 08:52:59 +0000 (08:52 +0000)]
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 agoAuto merge of #74956 - ecstatic-morse:const-option-unwrap, r=oli-obk
bors [Fri, 31 Jul 2020 08:26:33 +0000 (08:26 +0000)]
Auto merge of #74956 - ecstatic-morse:const-option-unwrap, r=oli-obk

Make `Option::unwrap` unstably const

This is lumped into the `const_option` feature gate (#67441), which enables a potpourri of `Option` methods.

cc @rust-lang/wg-const-eval

r? @oli-obk

3 years agoAuto merge of #74959 - richkadel:llvm-coverage-map-gen-5.1, r=tmandry
bors [Fri, 31 Jul 2020 06:35:19 +0000 (06:35 +0000)]
Auto merge of #74959 - richkadel:llvm-coverage-map-gen-5.1, r=tmandry

Rust function-level coverage now works on external crates

Follow-up to a known issue discussed (post-merge) in #74733:

Resolves a known issue in the coverage map where some regions had nonsensical source code locations.

External crate functions are already included in their own coverage maps, per library, and don't need to also
be added to the importing crate's coverage map. (In fact, their source start and end byte positions are not relevant to the importing crate's SourceMap.)

The fix was to simply skip trying to add imported coverage info to the coverage map if the instrumented function is not "local".

The injected counters are still relevant, however, and the LLVM `instrprof.increment` intrinsic call parameters will map those counters to the external crates' coverage maps, when generating runtime coverage data.

Now Rust Coverage can cleanly instrument and analyze coverage on an entire crate and its dependencies.

Example (instrumenting https://github.com/google/json5format):

```bash
$ ./x.py build rust-demangler  # make sure the demangler is built
$ cd ~/json5format
$ RUSTC=$HOME/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc \
   RUSTFLAGS="-Zinstrument-coverage" \
   cargo build --example formatjson5
$ LLVM_PROFILE_FILE="formatjson5.profraw" \
   ./target/debug/examples/formatjson5 session_manager.cml
$ ~/rust/build/x86_64-unknown-linux-gnu/llvm/bin/llvm-profdata merge \
   -sparse formatjson5.profraw -o formatjson5.profdata
$ ~/rust/build/x86_64-unknown-linux-gnu/llvm/bin/llvm-cov show --use-color \
   --instr-profile=formatjson5.profdata target/debug/examples/formatjson5 \
   --show-line-counts-or-regions  \
   --Xdemangler=$HOME/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/rust-demangler \
   --show-instantiations \
   2>&1 | less -R
```

(Scan forward for some of the non-zero coverage results, with `/^....[0-9]\|  *[^ |0]`.)

<img width="1071" alt="Screen Shot 2020-07-30 at 1 21 01 PM" src="https://user-images.githubusercontent.com/3827298/88970627-97e43000-d267-11ea-8e4d-fe40a091f756.png">

3 years agouse Iter<'_, [T; N]> in array_chunks
Bastian Kauschke [Fri, 31 Jul 2020 06:24:39 +0000 (08:24 +0200)]
use Iter<'_, [T; N]> in array_chunks

3 years agoadd note to array_chunks
Bastian Kauschke [Mon, 20 Jul 2020 21:33:22 +0000 (23:33 +0200)]
add note to array_chunks

3 years agoAuto merge of #74955 - P1n3appl3:rustdoc-formats, r=GuillaumeGomez
bors [Fri, 31 Jul 2020 04:37:14 +0000 (04:37 +0000)]
Auto merge of #74955 - P1n3appl3:rustdoc-formats, r=GuillaumeGomez

Add `--output-format json` for Rustdoc on nightly

This enables the previously deprecated `--output-format` flag so it can be used on nightly to host the experimental implementation of [rfc/2963](https://github.com/rust-lang/rfcs/pull/2963). The actual implementation will come in later PRs so for now there's just a stub that gives you an ICE.

I'm _pretty_ sure that the logic I added makes it inaccessible from stable, but someone should double check that. @tmandry @jyn514

3 years agoRun all tests if have no specified tests
Lzu Tao [Fri, 31 Jul 2020 04:20:27 +0000 (04:20 +0000)]
Run all tests if have no specified tests

3 years agorustfmt
Ding Xiang Fei [Fri, 31 Jul 2020 03:58:49 +0000 (11:58 +0800)]
rustfmt

3 years agoRemove a trailing space
Ding Xiang Fei [Fri, 31 Jul 2020 03:46:05 +0000 (11:46 +0800)]
Remove a trailing space

3 years agoAuto merge of #74926 - Manishearth:rename-lint, r=jyn514
bors [Fri, 31 Jul 2020 02:20:47 +0000 (02:20 +0000)]
Auto merge of #74926 - Manishearth:rename-lint, r=jyn514

Rename intra_doc_link_resolution_failure

It should be plural to follow the conventions in https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#lints

3 years agoPresort restrictions to make output consistent
Yuki Okushi [Fri, 31 Jul 2020 00:03:14 +0000 (09:03 +0900)]
Presort restrictions to make output consistent

3 years agoAuto merge of #74682 - alexcrichton:backtrace-gimli-round-2, r=Mark-Simulacrum
bors [Thu, 30 Jul 2020 23:22:09 +0000 (23:22 +0000)]
Auto merge of #74682 - alexcrichton:backtrace-gimli-round-2, r=Mark-Simulacrum

std: Switch from libbacktrace to gimli (take 2)

This is the second attempt to land https://github.com/rust-lang/rust/pull/73441 after being reverted in https://github.com/rust-lang/rust/pull/74613. Will be gathering precise perf numbers here in this take.

Closes #71060

3 years agoAuto merge of #74957 - Manishearth:rollup-3wudwlg, r=Manishearth
bors [Thu, 30 Jul 2020 20:57:54 +0000 (20:57 +0000)]
Auto merge of #74957 - Manishearth:rollup-3wudwlg, r=Manishearth

Rollup of 9 pull requests

Successful merges:

 - #74751 (Clean up E0730 explanation)
 - #74782 (Don't use "weak count" around Weak::from_raw_ptr)
 - #74835 (Clean up E0734 explanation)
 - #74871 (Enable docs on dist-x86_64-musl)
 - #74905 (Avoid bool-like naming)
 - #74907 (Clean up E0740 explanation)
 - #74915 (rustc: Ignore fs::canonicalize errors in metadata)
 - #74934 (Improve diagnostics when constant pattern is too generic)
 - #74951 (Cherry-pick the release notes for 1.45.1)

Failed merges:

r? @ghost

3 years agoTest `Option::unwrap` in a const context
Dylan MacKenzie [Thu, 30 Jul 2020 19:32:20 +0000 (12:32 -0700)]
Test `Option::unwrap` in a const context

3 years agoRollup merge of #74951 - cuviper:relnotes-1.45.1, r=jonas-schievink
Manish Goregaokar [Thu, 30 Jul 2020 20:04:43 +0000 (13:04 -0700)]
Rollup merge of #74951 - cuviper:relnotes-1.45.1, r=jonas-schievink

Cherry-pick the release notes for 1.45.1

3 years agoRollup merge of #74934 - nbdd0121:issue-73976, r=ecstatic-morse
Manish Goregaokar [Thu, 30 Jul 2020 20:04:42 +0000 (13:04 -0700)]
Rollup merge of #74934 - nbdd0121:issue-73976, r=ecstatic-morse

Improve diagnostics when constant pattern is too generic

This PR is a follow-up to PR #74538 and issue #73976

When constants queries Layout, TypeId or type_name of a generic parameter, instead of emitting `could not evaluate constant pattern`, we will instead emit a more detailed message `constant pattern depends on a generic parameter`.

3 years agoRollup merge of #74915 - alexcrichton:allow-failing-canonicalize, r=Mark-Simulacrum
Manish Goregaokar [Thu, 30 Jul 2020 20:04:40 +0000 (13:04 -0700)]
Rollup merge of #74915 - alexcrichton:allow-failing-canonicalize, r=Mark-Simulacrum

rustc: Ignore fs::canonicalize errors in metadata

This commit updates the metadata location logic to ignore errors when
calling `fs::canonicalize`. Canonicalization was added historically so
multiple `-L` paths to the same directory don't print errors about
multiple candidates (since rustc can deduplicate same-named paths), but
canonicalization doesn't work on all filesystems. Cargo, for example,
always uses this sort of fallback where it will opportunitistically try
to canonicalize but fall back to using the input path if it otherwise
doesn't work.

If rustc is run on a filesystem that doesn't support canonicalization
then the effect of this change will be that `-L` paths which logically
point to the same directory will cause errors, but that's a rare enough
occurrence it shouldn't cause much issue in practice. Otherwise rustc
doesn't work at all today on those sorts of filesystem where
canonicalization isn't supported!

3 years agoRollup merge of #74907 - GuillaumeGomez:cleanup-e0740, r=pickfire
Manish Goregaokar [Thu, 30 Jul 2020 20:04:38 +0000 (13:04 -0700)]
Rollup merge of #74907 - GuillaumeGomez:cleanup-e0740, r=pickfire

Clean up E0740 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74905 - lzutao:listed, r=jyn514
Manish Goregaokar [Thu, 30 Jul 2020 20:04:36 +0000 (13:04 -0700)]
Rollup merge of #74905 - lzutao:listed, r=jyn514

Avoid bool-like naming

Lost in https://github.com/rust-lang/rust/pull/74127#discussion_r453143504

3 years agoRollup merge of #74871 - etherealist:musl_doc, r=Mark-Simulacrum
Manish Goregaokar [Thu, 30 Jul 2020 20:04:34 +0000 (13:04 -0700)]
Rollup merge of #74871 - etherealist:musl_doc, r=Mark-Simulacrum

Enable docs on dist-x86_64-musl

Add the `rust-docs` component to toolchain `x86_64-unknown-linux-musl`, which allows people using rustup on their musl-based linux distribution to download the rust-docs.

`--disable-docs` is based on the assumption that `x86_64-unknown-linux-musl` is only a cross-compile target.

I have tested that the docs are built. I assume the build-system will automatically detect the docs and create a `rust-docs` component. I will [monitor](https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-musl.html) the components and create a follow-up PR, if the docs aren't published.

See also #70619, where we enabled `rust-lld` to enable the wasm-workflow on musl-based linux distributions.

3 years agoRollup merge of #74835 - GuillaumeGomez:cleanup-e0734, r=jyn514
Manish Goregaokar [Thu, 30 Jul 2020 20:04:32 +0000 (13:04 -0700)]
Rollup merge of #74835 - GuillaumeGomez:cleanup-e0734, r=jyn514

Clean up E0734 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74782 - vorner:weak-into-raw-cnt-doc, r=dtolnay
Manish Goregaokar [Thu, 30 Jul 2020 20:04:29 +0000 (13:04 -0700)]
Rollup merge of #74782 - vorner:weak-into-raw-cnt-doc, r=dtolnay

Don't use "weak count" around Weak::from_raw_ptr

As `Rc/Arc::weak_count` returns 0 when having no strong counts, this
could be confusing and it's better to avoid using that completely.

Closes #73840.

3 years agoRollup merge of #74751 - GuillaumeGomez:cleanup-e0730, r=jyn514
Manish Goregaokar [Thu, 30 Jul 2020 20:04:23 +0000 (13:04 -0700)]
Rollup merge of #74751 - GuillaumeGomez:cleanup-e0730, r=jyn514

Clean up E0730 explanation

r? @Dylan-DPC

3 years agoMake `Option::unwrap` unstably const
Dylan MacKenzie [Thu, 30 Jul 2020 19:30:56 +0000 (12:30 -0700)]
Make `Option::unwrap` unstably const

`Result::unwrap` is not eligible becuase it formats the contents of the
`Err` variant. `unwrap_or`, `unwrap_or_else` and friends are not
eligible because they drop things or invoke closures.

3 years agoRust function-level coverage now works on external crates
Rich Kadel [Thu, 30 Jul 2020 19:25:39 +0000 (12:25 -0700)]
Rust function-level coverage now works on external crates

Fixed a known issue in the coverage map where some regions had
nonsensical source code locations. External crate functions are already
included in their own coverage maps, per library, and don't need to also
be added to the importing crate's coverage map. (In fact, their source
start and end byte positions are not relevant to the importing crate's
SourceMap.)

The fix was to simply skip trying to add imported coverage info to the
coverage map if the instrumented function is not "local".

The injected counters are still relevant, however, and the LLVM
`instrprof.increment` intrinsic call parameters will map those counters
to the external crates' coverage maps, when generating runtime coverage
data.

3 years agoUpdate driver to add json backend
Joseph Ryan [Thu, 30 Jul 2020 18:54:26 +0000 (13:54 -0500)]
Update driver to add json backend

3 years agoUpdate release notes
Mark Rousskov [Sat, 25 Jul 2020 15:01:44 +0000 (11:01 -0400)]
Update release notes

(cherry picked from commit 32166ab1ebec2e5e5454221f0d3238c21382de9f)

3 years ago1.45.1 release
Mark Rousskov [Mon, 20 Jul 2020 12:58:10 +0000 (08:58 -0400)]
1.45.1 release

(cherry picked from commit 9e5fb40807f97fe47d2eaca99daeb1f1f6ff07a7)