Commit graph

124583 commits

Author SHA1 Message Date
Ding Xiang Fei
db07174632
Remove a trailing space 2020-07-31 11:46:05 +08:00
Lzu Tao
6d293ede9f Update tests 2020-07-31 02:44:29 +00:00
Lzu Tao
c25f25f7f1 Stabilize as_deref and as_deref on Result 2020-07-31 02:42:24 +00:00
Lzu Tao
07575286b8 Remove as_deref_err and as_deref_mut_err from Result 2020-07-31 02:42:24 +00:00
bors
ffa80f01d8 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
2020-07-31 02:20:47 +00:00
Yuki Okushi
1629fed4c0
Presort restrictions to make output consistent 2020-07-31 09:03:14 +09:00
bors
c058a8b8dc 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
2020-07-30 23:22:09 +00:00
Yuki Okushi
c2afce4058
Fix ICEs with @ .. binding 2020-07-31 07:50:29 +09:00
Yuki Okushi
8b778a5f8d
Revert "Fix an ICE on an invalid binding @ ... in a tuple struct pattern"
This reverts commit f5e5eb6f46.
2020-07-31 06:52:00 +09:00
bors
cfc572cae2 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
2020-07-30 20:57:54 +00:00
Dylan MacKenzie
96c84ac3cb Test Option::unwrap in a const context 2020-07-30 13:09:45 -07:00
Manish Goregaokar
9eb50260bd
Rollup merge of #74951 - cuviper:relnotes-1.45.1, r=jonas-schievink
Cherry-pick the release notes for 1.45.1
2020-07-30 13:04:43 -07:00
Manish Goregaokar
b0d426165f
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`.
2020-07-30 13:04:42 -07:00
Manish Goregaokar
0a45b1303c
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!
2020-07-30 13:04:40 -07:00
Manish Goregaokar
2c6c764d9a
Rollup merge of #74907 - GuillaumeGomez:cleanup-e0740, r=pickfire
Clean up E0740 explanation

r? @Dylan-DPC
2020-07-30 13:04:38 -07:00
Manish Goregaokar
e823af6015
Rollup merge of #74905 - lzutao:listed, r=jyn514
Avoid bool-like naming

Lost in https://github.com/rust-lang/rust/pull/74127#discussion_r453143504
2020-07-30 13:04:36 -07:00
Manish Goregaokar
8892785c8e
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.
2020-07-30 13:04:34 -07:00
Manish Goregaokar
172b3a713a
Rollup merge of #74835 - GuillaumeGomez:cleanup-e0734, r=jyn514
Clean up E0734 explanation

r? @Dylan-DPC
2020-07-30 13:04:32 -07:00
Manish Goregaokar
46379687ac
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.
2020-07-30 13:04:29 -07:00
Manish Goregaokar
7e86c8eccb
Rollup merge of #74751 - GuillaumeGomez:cleanup-e0730, r=jyn514
Clean up E0730 explanation

r? @Dylan-DPC
2020-07-30 13:04:23 -07:00
Dylan MacKenzie
fc2c1f8ddc 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.
2020-07-30 12:30:58 -07:00
Rich Kadel
34b26d6a77 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.
2020-07-30 12:25:39 -07:00
Joseph Ryan
48c6f05662
Update driver to add json backend 2020-07-30 14:13:51 -05:00
Mark Rousskov
19d191bb02 Update release notes
(cherry picked from commit 32166ab1ebec2e5e5454221f0d3238c21382de9f)
2020-07-30 11:36:33 -07:00
Mark Rousskov
e1e01f72a5 1.45.1 release
(cherry picked from commit 9e5fb40807f97fe47d2eaca99daeb1f1f6ff07a7)
2020-07-30 11:36:14 -07:00
bors
438c59f010 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
2020-07-30 18:29:08 +00:00
Ding Xiang Fei
3b2642ffa7
Add comments to explain the test case and the special treatment 2020-07-31 02:16:42 +08:00
Manish Goregaokar
c17eb566c2 Fix uitests 2020-07-30 10:40:17 -07:00
Manish Goregaokar
e25a67fa6c Rename the lint again 2020-07-30 10:39:31 -07:00
Manish Goregaokar
8fe438e632 intra_doc_resolution_failures -> broken_intra_doc_links 2020-07-30 10:38:55 -07:00
Manish Goregaokar
bcb2813e01 Update uitest expectations 2020-07-30 10:22:57 -07:00
Ralf Jung
1a2208afc5 update Miri 2020-07-30 19:05:21 +02:00
Alex Crichton
cd8bdb5eb9 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!
2020-07-30 08:21:10 -07:00
Manish Goregaokar
522ef2e981 Remove deny for intra doc link failures from library code, it's no longer necessary 2020-07-30 08:14:27 -07:00
Manish Goregaokar
7b7b5a7a12 Rename in library 2020-07-30 08:14:27 -07:00
Manish Goregaokar
4df76f0f90 Rename to intra_doc_resolution_failures 2020-07-30 08:14:27 -07:00
bors
6b09c37ddc 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
2020-07-30 14:36:41 +00:00
Ding Xiang Fei
ddbe69a5b2
Special treatment for dereferencing a borrow to a static definition 2020-07-30 22:17:56 +08:00
bors
21867225a7 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
2020-07-30 12:52:41 +00:00
jumbatm
0bd292dea1 Fix missed same-sized member clash in ClashingExternDeclarations. 2020-07-30 21:59:02 +10:00
jumbatm
30a6f57308 Handle structs with zst members. 2020-07-30 21:59:02 +10:00
jumbatm
060666d0a4 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`.
2020-07-30 21:59:02 +10:00
jumbatm
5e52edca52 Apply suggested wording changes from code review.
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
2020-07-30 21:59:02 +10:00
jumbatm
3eaead7d51 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).
2020-07-30 21:59:01 +10:00
jumbatm
4da72f5387 Add additional clashing_extern_decl cases. 2020-07-30 21:59:01 +10:00
Guillaume Gomez
89e4fe3313 Improve E0730 explanation 2020-07-30 13:51:22 +02:00
bors
1ce0cf070e 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
2020-07-30 10:58:59 +00:00
Bastian Kauschke
95fa63e63f liballoc export ArrayChunks 2020-07-30 10:50:35 +02:00
Bastian Kauschke
d27007fd6d add tests for array_chunks 2020-07-30 10:50:34 +02:00
Bastian Kauschke
d405347f09 adds slice::array_chunks 2020-07-30 10:50:34 +02:00