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

3 years agoAuto merge of #74908 - RalfJung:miri, r=RalfJung
bors [Thu, 30 Jul 2020 18:29:08 +0000 (18:29 +0000)]
Auto merge of #74908 - RalfJung:miri, r=RalfJung

update Miri

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

3 years agoAdd comments to explain the test case and the special treatment
Ding Xiang Fei [Thu, 30 Jul 2020 18:16:42 +0000 (02:16 +0800)]
Add comments to explain the test case and the special treatment

3 years agoFix uitests
Manish Goregaokar [Thu, 30 Jul 2020 17:40:17 +0000 (10:40 -0700)]
Fix uitests

3 years agoRename the lint again
Manish Goregaokar [Thu, 30 Jul 2020 17:39:16 +0000 (10:39 -0700)]
Rename the lint again

3 years agointra_doc_resolution_failures -> broken_intra_doc_links
Manish Goregaokar [Thu, 30 Jul 2020 17:38:55 +0000 (10:38 -0700)]
intra_doc_resolution_failures -> broken_intra_doc_links

3 years agoUpdate uitest expectations
Manish Goregaokar [Thu, 30 Jul 2020 17:22:57 +0000 (10:22 -0700)]
Update uitest expectations

3 years agoupdate Miri
Ralf Jung [Thu, 30 Jul 2020 17:05:21 +0000 (19:05 +0200)]
update Miri

3 years agorustc: Ignore fs::canonicalize errors in metadata
Alex Crichton [Wed, 29 Jul 2020 16:10:07 +0000 (09:10 -0700)]
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 agoRemove deny for intra doc link failures from library code, it's no longer necessary
Manish Goregaokar [Thu, 30 Jul 2020 06:19:12 +0000 (23:19 -0700)]
Remove deny for intra doc link failures from library code, it's no longer necessary

3 years agoRename in library
Manish Goregaokar [Thu, 30 Jul 2020 00:06:44 +0000 (17:06 -0700)]
Rename in library

3 years agoRename to intra_doc_resolution_failures
Manish Goregaokar [Wed, 29 Jul 2020 23:26:32 +0000 (16:26 -0700)]
Rename to intra_doc_resolution_failures

3 years agoAuto merge of #73990 - jumbatm:clashing-extern-decl, r=nagisa
bors [Thu, 30 Jul 2020 14:36:41 +0000 (14:36 +0000)]
Auto merge of #73990 - jumbatm:clashing-extern-decl, r=nagisa

Fix incorrect clashing_extern_declarations warnings.

Fixes #73735, fixes #73872.

Fix clashing_extern_declarations warning for `#[repr(transparent)]` structs and safely-FFI-convertible enums, and not warning for clashes of struct members of different types, but the same size.

r? @nagisa

3 years agoSpecial treatment for dereferencing a borrow to a static definition
Ding Xiang Fei [Thu, 30 Jul 2020 10:33:34 +0000 (18:33 +0800)]
Special treatment for dereferencing a borrow to a static definition

3 years agoAuto merge of #74930 - ecstatic-morse:const-size-align-of-val, r=oli-obk
bors [Thu, 30 Jul 2020 12:52:41 +0000 (12:52 +0000)]
Auto merge of #74930 - ecstatic-morse:const-size-align-of-val, r=oli-obk

Make `mem::size_of_val` and `mem::align_of_val` unstably const

Implements #46571 but does not stabilize it. I wanted this while working on something today.

The only reason not to immediately stabilize are concerns around [custom DSTs](https://github.com/rust-lang/rust/issues/46571#issuecomment-387669352). That proposal has made zero progress in the last two years and const eval is rich enough to support pretty much any user-defined `len` function as long as nightly features are allowed (`raw_ptr_deref`).

Currently, this raises a `const_err` lint when passed an `extern type`.

r? @oli-obk

cc @rust-lang/wg-const-eval

3 years agoFix missed same-sized member clash in ClashingExternDeclarations.
jumbatm [Tue, 7 Jul 2020 11:08:14 +0000 (21:08 +1000)]
Fix missed same-sized member clash in ClashingExternDeclarations.

3 years agoHandle structs with zst members.
jumbatm [Wed, 15 Jul 2020 07:03:53 +0000 (17:03 +1000)]
Handle structs with zst members.

3 years agoAddress code review comments.
jumbatm [Mon, 13 Jul 2020 13:06:35 +0000 (23:06 +1000)]
Address code review comments.

- Make `is_repr_nullable_ptr` freestanding again to avoid usage of
ImproperCTypesVisitor in ClashingExternDeclarations (and don't
accidentally revert the ParamEnv::reveal_all() fix from a week earlier)
- Revise match condition for 1 Adt, 1 primitive
- Generalise check for non-null type so that it would also work for
ranges which exclude any single value (all bits set, for example)
- Make is_repr_nullable_ptr return the representable type instead of
just a boolean, to avoid adding an additional, independent "source of
truth" about the FFI-compatibility of Option-like enums. Also, rename to
`repr_nullable_ptr`.

3 years agoApply suggested wording changes from code review.
jumbatm [Sat, 4 Jul 2020 02:07:43 +0000 (12:07 +1000)]
Apply suggested wording changes from code review.

Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
3 years agoDon't emit clashing decl lint for FFI-safe enums.
jumbatm [Fri, 3 Jul 2020 10:14:05 +0000 (20:14 +1000)]
Don't emit clashing decl lint for FFI-safe enums.

An example of an FFI-safe enum conversion is when converting
Option<NonZeroUsize> to usize. Because the Some value must be non-zero,
rustc can use 0 to represent the None variant, making this conversion is
safe. Furthermore, it can be relied on (and removing this optimisation
already would be a breaking change).

3 years agoAdd additional clashing_extern_decl cases.
jumbatm [Sun, 28 Jun 2020 21:33:15 +0000 (07:33 +1000)]
Add additional clashing_extern_decl cases.

3 years agoImprove E0730 explanation
Guillaume Gomez [Thu, 30 Jul 2020 11:51:22 +0000 (13:51 +0200)]
Improve E0730 explanation

3 years agoAuto merge of #74105 - npmccallum:naked, r=matthewjasper
bors [Thu, 30 Jul 2020 10:58:59 +0000 (10:58 +0000)]
Auto merge of #74105 - npmccallum:naked, r=matthewjasper

Suppress debuginfo on naked function arguments

A function that has no prologue cannot be reasonably expected to support
debuginfo. In fact, the existing code (before this patch) would generate
invalid instructions that caused crashes. We can solve this easily by
just not emitting the debuginfo in this case.

Fixes https://github.com/rust-lang/rust/issues/42779
cc https://github.com/rust-lang/rust/issues/32408

3 years agoliballoc export ArrayChunks
Bastian Kauschke [Mon, 18 May 2020 21:14:55 +0000 (23:14 +0200)]
liballoc export ArrayChunks

3 years agoadd tests for array_chunks
Bastian Kauschke [Mon, 18 May 2020 19:24:37 +0000 (21:24 +0200)]
add tests for array_chunks

3 years agoadds `slice::array_chunks`
Bastian Kauschke [Mon, 18 May 2020 18:40:37 +0000 (20:40 +0200)]
adds `slice::array_chunks`

3 years agoimprove chunks + windows err on size 0
Bastian Kauschke [Mon, 18 May 2020 18:06:00 +0000 (20:06 +0200)]
improve chunks + windows err on size 0

3 years agoFix ui tests
Gary Guo [Thu, 30 Jul 2020 05:34:16 +0000 (06:34 +0100)]
Fix ui tests

3 years agoImprove diagnostics when constant pattern is too generic
Gary Guo [Thu, 30 Jul 2020 05:17:18 +0000 (06:17 +0100)]
Improve diagnostics when constant pattern is too generic

3 years agoAuto merge of #74876 - oli-obk:lumberjack_disable, r=RalfJung
bors [Thu, 30 Jul 2020 03:54:05 +0000 (03:54 +0000)]
Auto merge of #74876 - oli-obk:lumberjack_disable, r=RalfJung

Replace all uses of `log::log_enabled` with `Debug` printers

cc @RalfJung this touches a bunch of logging in the miri engine. There are some visual changes, mainly that in several cases we stop prepending lines with the module path and just have a newline.

3 years agoTest `{align,size}_of_val` in a const context
Dylan MacKenzie [Wed, 29 Jul 2020 21:58:06 +0000 (14:58 -0700)]
Test `{align,size}_of_val` in a const context

3 years agoAuto merge of #74923 - ehuss:update-cargo, r=Mark-Simulacrum
bors [Thu, 30 Jul 2020 02:05:48 +0000 (02:05 +0000)]
Auto merge of #74923 - ehuss:update-cargo, r=Mark-Simulacrum

Update cargo

14 commits in aa6872140ab0fa10f641ab0b981d5330d419e927..974eb438da8ced6e3becda2bbf63d9b643eacdeb
2020-07-23 13:46:27 +0000 to 2020-07-29 16:15:05 +0000
- Fix O0 build scripts by default without `[profile.release]` (rust-lang/cargo#8560)
- Emphasize git dependency version locking behavior. (rust-lang/cargo#8561)
- Update lock file encodings on changes (rust-lang/cargo#8554)
- Fix sporadic lto test failures. (rust-lang/cargo#8559)
- build-std: Fix libraries paths following upstream (rust-lang/cargo#8558)
- Flag git http errors as maybe spurious (rust-lang/cargo#8553)
- Display builtin aliases with `cargo --list` (rust-lang/cargo#8542)
- Check manifest for requiring nonexistent features (rust-lang/cargo#7950)
- Clarify test name filter usage (rust-lang/cargo#8552)
- Revert Cargo Book changes for default edition (rust-lang/cargo#8551)
- Prepare for not defaulting to master branch for git deps (rust-lang/cargo#8522)
- Include `+` for crates.io feature requirements in the Cargo Book section on features (rust-lang/cargo#8547)
- Update termcolor and fwdansi versions (rust-lang/cargo#8540)
- Cargo book nitpick in Manifest section (rust-lang/cargo#8543)

3 years agoAuto merge of #74929 - Manishearth:rollup-z2vflrp, r=Manishearth
bors [Thu, 30 Jul 2020 00:17:51 +0000 (00:17 +0000)]
Auto merge of #74929 - Manishearth:rollup-z2vflrp, r=Manishearth

Rollup of 10 pull requests

Successful merges:

 - #74742 (Remove links to rejected errata 4406 for RFC 4291)
 - #74819 (Point towards `format_spec`; it is in other direction)
 - #74852 (Explain why inlining default ToString impl)
 - #74869 (Make closures and generators a must use types)
 - #74873 (symbol mangling: use ty::print::Print for consts)
 - #74902 (Remove deprecated unstable `{Box,Rc,Arc}::into_raw_non_null` functions)
 - #74904 (Fix some typos in src/librustdoc/clean/auto_trait.rs)
 - #74910 (fence docs: fix example Mutex)
 - #74912 (Fix broken link in unstable book `plugin`)
 - #74927 (Change the target data layout to specify more values)

Failed merges:

r? @ghost

3 years agoMake `{align,size}_of_val` `const`
Dylan MacKenzie [Wed, 29 Jul 2020 21:56:58 +0000 (14:56 -0700)]
Make `{align,size}_of_val` `const`

3 years agoRollup merge of #74927 - Lokathor:Lokathor-patch-1, r=jonas-schievink
Manish Goregaokar [Wed, 29 Jul 2020 23:38:34 +0000 (16:38 -0700)]
Rollup merge of #74927 - Lokathor:Lokathor-patch-1, r=jonas-schievink

Change the target data layout to specify more values

This does not actually alter the previously specified important parts, but apparently `rustc` cares about more layout components than `cargo-xbuild` ever did. This extends the data layout to be a fully specified layout, as given in the error from issue #74767

* Closes https://github.com/rust-lang/rust/issues/74767

3 years agoRollup merge of #74912 - giraffate:fix_broken_link_in_unstable_plugin_book, r=jonas...
Manish Goregaokar [Wed, 29 Jul 2020 23:38:33 +0000 (16:38 -0700)]
Rollup merge of #74912 - giraffate:fix_broken_link_in_unstable_plugin_book, r=jonas-schievink

Fix broken link in unstable book `plugin`

There is broken link in https://doc.rust-lang.org/unstable-book/language-features/plugin.html#lint-plugins.

3 years agoRollup merge of #74910 - RalfJung:fence, r=Mark-Simulacrum
Manish Goregaokar [Wed, 29 Jul 2020 23:38:31 +0000 (16:38 -0700)]
Rollup merge of #74910 - RalfJung:fence, r=Mark-Simulacrum

fence docs: fix example Mutex

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

Cc @pca006132

3 years agoRollup merge of #74904 - joshtriplett:typo-fix, r=jonas-schievink
Manish Goregaokar [Wed, 29 Jul 2020 23:38:29 +0000 (16:38 -0700)]
Rollup merge of #74904 - joshtriplett:typo-fix, r=jonas-schievink

Fix some typos in src/librustdoc/clean/auto_trait.rs

3 years agoRollup merge of #74902 - rust-lang:into_raw_non_null, r=dtolnay
Manish Goregaokar [Wed, 29 Jul 2020 23:38:28 +0000 (16:38 -0700)]
Rollup merge of #74902 - rust-lang:into_raw_non_null, r=dtolnay

Remove deprecated unstable `{Box,Rc,Arc}::into_raw_non_null` functions

FCP: https://github.com/rust-lang/rust/issues/47336#issuecomment-619369613

3 years agoRollup merge of #74873 - lcnr:const-print, r=eddyb
Manish Goregaokar [Wed, 29 Jul 2020 23:38:26 +0000 (16:38 -0700)]
Rollup merge of #74873 - lcnr:const-print, r=eddyb

symbol mangling: use ty::print::Print for consts

r? @eddyb

3 years agoRollup merge of #74869 - tmiasko:must-use-closures, r=ecstatic-morse
Manish Goregaokar [Wed, 29 Jul 2020 23:38:24 +0000 (16:38 -0700)]
Rollup merge of #74869 - tmiasko:must-use-closures, r=ecstatic-morse

Make closures and generators a must use types

Warn about unused expressions with closure or generator type. This follows
existing precedence of must use annotations present on `FnOnce`, `FnMut`, `Fn`
traits, which already indirectly apply to closures in some cases, e.g.,:

```rust
fn f() -> impl FnOnce() {
    || {}
}

fn main() {
    // an existing warning: unused implementer of `std::ops::FnOnce` that must be used:
    f();

    // a new warning: unused closure that must be used:
    || {};
}
```

Closes #74691.

3 years agoRollup merge of #74852 - lzutao:inline-rm-tostring, r=nnethercote
Manish Goregaokar [Wed, 29 Jul 2020 23:38:22 +0000 (16:38 -0700)]
Rollup merge of #74852 - lzutao:inline-rm-tostring, r=nnethercote

Explain why inlining default ToString impl

Trying to remove inline attribute from default ToString impl causes regression.
Perf result at <https://github.com/rust-lang/rust/pull/74852#issuecomment-664812994>.

3 years agoRollup merge of #74819 - tmiasko:format-spec, r=joshtriplett
Manish Goregaokar [Wed, 29 Jul 2020 23:38:20 +0000 (16:38 -0700)]
Rollup merge of #74819 - tmiasko:format-spec, r=joshtriplett

Point towards `format_spec`; it is in other direction

3 years agoRollup merge of #74742 - poliorcetics:ip-addr-remove-rejected-errata, r=nikomatsakis
Manish Goregaokar [Wed, 29 Jul 2020 23:38:19 +0000 (16:38 -0700)]
Rollup merge of #74742 - poliorcetics:ip-addr-remove-rejected-errata, r=nikomatsakis

Remove links to rejected errata 4406 for RFC 4291

Fixes #74198.

For now I simply removed the links, the docs seems clear enough to me but I'm no expert in the domain so don't hesitate to correct me if more is needed.

cc @ghanan94.

@rustbot modify labels: T-doc, T-libs

3 years agoChange the target data layout to specify more values
Lokathor [Wed, 29 Jul 2020 22:26:09 +0000 (16:26 -0600)]
Change the target data layout to specify more values

This does not actually alter the previously specified important parts, but apparently `rustc` cares about more layout components than `cargo-xbuild` ever did. This extends the data layout to be fully specified layout, as given in the error from issue #74767

3 years agoAuto merge of #73767 - P1n3appl3:rustdoc-formats, r=tmandry
bors [Wed, 29 Jul 2020 22:24:46 +0000 (22:24 +0000)]
Auto merge of #73767 - P1n3appl3:rustdoc-formats, r=tmandry

Refactor librustdoc html backend

This PR moves several types out of the librustdoc::html module so that they can be used by a future json backend. These changes are a re-implementation of [some work done 6 months ago](https://github.com/rust-lang/rust/compare/master...GuillaumeGomez:multiple-output-formats) by @GuillaumeGomez. I'm currently working on said json backend and will put up an RFC soon with the proposed implementation.

There are a couple of changes that are more substantial than relocating structs to a different module:
1. The `Cache` is no longer part of the `html::render::Context` type and therefor it needs to be explicitly passed to any functions that access it.
2. The driving function `html::render::run` has been rewritten to use the `FormatRenderer` trait which should allow different backends to re-use the driving code.

r? @GuillaumeGomez

cc @tmandry @betamos