Commit graph

159598 commits

Author SHA1 Message Date
lcnr
023b56572f add some comments 2021-12-14 13:32:42 +01:00
lcnr
992efa68b7 replace DefId with D in SimplifiedType 2021-12-14 13:32:42 +01:00
lcnr
dcd716fee2 extend simplify_type 2021-12-14 13:32:42 +01:00
bors
83b32f27fc Auto merge of #91766 - scottmcm:more-array-raw-eq, r=yaahc
Allow `memcmp` for more array comparisons

This way comparing `[NonZeroU8; 8]` is just as fast as comparing `[u8; 8]`.
2021-12-14 08:22:31 +00:00
bors
7ca74ea0af Auto merge of #91680 - saethlin:spare_capacity_mut-in-join, r=dtolnay
Use spare_capacity_mut instead of invalid unchecked indexing when joining str

This is a fix for https://github.com/rust-lang/rust/issues/91574

I think in general I'd prefer to see this code implemented with raw pointers or `MaybeUninit::write_slice`, but there's existing code in here based on copying from slice to slice, so converting everything from `&[T]` to `&[MaybeUninit<T>]` is less disruptive.
2021-12-14 04:29:54 +00:00
bors
a2d25b4ff7 Auto merge of #91660 - llogiq:make-a-hash-of-def-ids, r=nnethercote
manually implement `Hash` for `DefId`

This might speed up hashing for hashers that can work on individual u64s. Just as an experiment, suggested in a reddit thread on `FxHasher`. cc `@nnethercote`

Note that this should not be merged as is without cfg-ing the code path for 64 bits.
2021-12-14 01:39:01 +00:00
bors
8f117a77d0 Auto merge of #91865 - matthiaskrgr:rollup-rai9ecq, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #91699 (Add `-webkit-appearance: none` to search input)
 - #91846 (rustdoc: Reduce number of arguments for `run_test` a bit)
 - #91847 (Fix FIXME for `generic_arg_infer` in `create_substs_for_ast_path`)
 - #91849 (GATs outlives lint: Try to prove bounds)
 - #91855 (Stabilize const_cstr_unchecked)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-12-13 20:12:35 +00:00
Matthias Krüger
ff214b745d
Rollup merge of #91855 - xfix:const_cstr_unchecked, r=dtolnay
Stabilize const_cstr_unchecked

Closes #90343

``@rustbot`` modify labels: +T-libs-api
2021-12-13 18:15:17 +01:00
Matthias Krüger
84878336b0
Rollup merge of #91849 - jackh726:gats-outlives-lint-part2, r=nikomatsakis
GATs outlives lint: Try to prove bounds

Fixes #91036
Fixes #90888
Fixes #91348 (better error + documentation to be added to linked issue)

Instead of checking for bounds directly, try to prove them in the associated type environment.

Also, add a bit of extra information to the error, including a link to the relevant discussion issue (#87479). That should be edited to include a brief summary of the current state of the outlives lint, including a brief background. It also might or might not be worth it to bump this to a full error code at some point.

r? ``@nikomatsakis``
2021-12-13 18:15:16 +01:00
Matthias Krüger
f8de2f56e8
Rollup merge of #91847 - BoxyUwU:generic_arg_infer_fixme, r=lcnr
Fix FIXME for `generic_arg_infer` in `create_substs_for_ast_path`

Fixes a FIXME, does some general refactoring of this fn, and also fixes a bug where we would use a const params defaults instead of an inference var ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=19456f65ea5dc3fcaa9b696f842ab380))
(lot of stuff in one PR but it was all so close together...)

r? `@lcnr`

Fixes #91614
2021-12-13 18:15:15 +01:00
Matthias Krüger
dca8ddeade
Rollup merge of #91846 - camelid:doctest-cleanup, r=GuillaumeGomez
rustdoc: Reduce number of arguments for `run_test` a bit

- rustdoc: Coalesce some `run_test` args as one `LangString` arg
- Rename `TestOptions` to `GlobalTestOptions`
- doctest: Rename `options` to `rustdoc_options`
2021-12-13 18:15:14 +01:00
Matthias Krüger
e354f0ce87
Rollup merge of #91699 - jsha:webkit-appearance-search-input, r=GuillaumeGomez
Add `-webkit-appearance: none` to search input

This fixes an issue when displaying on iPad, where the search box had no borders.

r? ``@GuillaumeGomez``

Demo https://rustdoc.crud.net/jsha/webkit-appearance-search-input/std/string/struct.String.html
2021-12-13 18:15:13 +01:00
bors
1796de7bb1 Auto merge of #91353 - eggyal:reuse-rcs-during-folding, r=lcnr
Avoid cloning refcounted types during folding

Addresses FIXME comment created in #78313

r? `@lcnr`
2021-12-13 17:05:40 +00:00
Jack Huey
48974158f1 Adjust wording for review 2021-12-13 10:06:57 -05:00
Alan Egerton
5920a1d948
Avoid cloning refcounted types during folding 2021-12-13 14:27:26 +00:00
bors
06a6674a7d Auto merge of #91657 - nikic:update-llvm, r=cuviper
Update LLVM submodule

Update LLVM submodule with recent cherry-picks. In particular:
 * https://github.com/rust-lang/llvm-project/pull/123
 * https://github.com/rust-lang/llvm-project/pull/124
2021-12-13 13:37:53 +00:00
bors
a737592a3d Auto merge of #91654 - nikic:llvmbc-section-flags, r=nagisa
Use module inline assembly to embed bitcode

In LLVM 14, our current method of setting section flags to avoid
embedding the `.llvmbc` section into final compilation artifacts
will no longer work, see issue #90326. The upstream recommendation
is to instead embed the entire bitcode using module-level inline
assembly, which is what this change does.

I've kept the existing code for platforms where we do not need to
set section flags, but possibly we should always be using the
inline asm approach (which would have to look a bit different for MachO).

r? `@nagisa`
2021-12-13 10:35:28 +00:00
Konrad Borowski
23e4aeb140 Stabilize const_cstr_unchecked 2021-12-13 08:43:19 +01:00
bors
6d6d0899c8 Auto merge of #91626 - klensy:json-less-alloc, r=petrochenkov
rustc_serialize: don't allocate `String`s as key for `BTreeMap`, when `str` is enough
2021-12-13 07:30:38 +00:00
Jack Huey
7cbd0dcf93 I wrote these functions, I should use them dang it 2021-12-13 01:10:39 -05:00
Jack Huey
8a28c172a1 Instead of checking for exact bounds, try to prove them 2021-12-13 00:48:46 -05:00
Jacob Hoffman-Andrews
da472a5a84 Add -webkit-appearance: none to search input
This fixes an issue when displaying on iPad, where the search box had no
borders.
2021-12-12 20:33:18 -08:00
bors
4a7fb971c9 Auto merge of #91569 - erikdesjardins:vt-align, r=nikic
Attach range metadata to alignment loads from vtables

...because alignment is always nonzero[0].

This helps eliminate redundant runtime alignment checks, when a DST
is a field of a struct whose remaining fields have alignment 1.

Fixes #91438.

---
[0]:

The [reference](https://doc.rust-lang.org/reference/type-layout.html) says that alignment must be at least 1.

And in practice, the alignment field for all vtables is generated here: 772d51f887/compiler/rustc_middle/src/ty/vtable.rs (L68-L90) and is nonzero because [`Align::bytes()`](772d51f887/compiler/rustc_target/src/abi/mod.rs (L547-L549)) is always nonzero.
2021-12-13 04:29:20 +00:00
Ellen
6c79595134 extra test for bug i found 2021-12-13 03:33:14 +00:00
Ellen
5ab1329b58 hurray for portable simd finding a nice test for this FIXME 2021-12-13 03:16:00 +00:00
Noah Lev
9afa190c44 doctest: Rename options to rustdoc_options
These are the rustdoc-wide options. It's easy to confuse them with
options for doctests in particular, so this change should help.
2021-12-12 17:46:19 -08:00
Noah Lev
5e33e6affd Rename TestOptions to GlobalTestOptions
It seems to apply to all doctests in the crate.
2021-12-12 17:46:19 -08:00
Noah Lev
b345e18462 rustdoc: Coalesce some run_test args as one LangString arg 2021-12-12 17:46:18 -08:00
bors
f7fd79ac1d Auto merge of #91841 - matthiaskrgr:rollup-zlhsg5a, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #91086 (Implement `TryFrom<&'_ mut [T]>` for `[T; N]`)
 - #91091 (Stabilize `ControlFlow::{is_break, is_continue}`)
 - #91749 (BTree: improve public descriptions and comments)
 - #91819 (rustbot: Add autolabeling for `T-compiler`)
 - #91824 (Make `(*mut T)::write_bytes` `const`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-12-13 00:56:18 +00:00
Matthias Krüger
9e662d0c03
Rollup merge of #91824 - woppopo:const_ptr_write_bytes, r=oli-obk
Make `(*mut T)::write_bytes` `const`

Tracking issue: #86302
2021-12-13 00:20:10 +01:00
Matthias Krüger
3b79d4f0b7
Rollup merge of #91819 - rust-lang:compiler-autolabel, r=jackh726
rustbot: Add autolabeling for `T-compiler`

This commit adds autolabeling for the `T-compiler` label, for PRs that
modify rustc's source code or tests (currently only `src/test/ui`).

This is possible now that rust-lang/triagebot#1321 has landed.
2021-12-13 00:20:09 +01:00
Matthias Krüger
87cda671e5
Rollup merge of #91749 - ssomers:btree_comments, r=Mark-Simulacrum
BTree: improve public descriptions and comments

BTreeSet has always used the term "value" next to and meaning the same thing as "elements" (in the mathematical sense but also used for key-value pairs in BTreeMap), while in the BTreeMap sense these "values" are known as "keys" and definitely not "values". Today I had enough of that.

r? `@Mark-Simulacrum`
2021-12-13 00:20:08 +01:00
Matthias Krüger
6227d42928
Rollup merge of #91091 - ecstatic-morse:control-flow-enum-is, r=m-ou-se
Stabilize `ControlFlow::{is_break, is_continue}`

The type itself was stabilized in 1.55, but using it is not ergonomic without these helper functions. Stabilize them.

r? rust-lang/libs-api
2021-12-13 00:20:07 +01:00
Matthias Krüger
42f8d4833f
Rollup merge of #91086 - rhysd:issue-91085, r=m-ou-se
Implement `TryFrom<&'_ mut [T]>` for `[T; N]`

Fixes #91085.
2021-12-13 00:20:06 +01:00
bors
22f8bde876 Auto merge of #91549 - fee1-dead:const_env, r=spastorino
Eliminate ConstnessAnd again

Closes #91489.
Closes #89432.

Reverts #91491.
Reverts #89450.

r? `@spastorino`
2021-12-12 22:15:32 +00:00
Noah Lev
1f65adfabf rustbot: Add autolabeling for T-compiler
This commit adds autolabeling for the `T-compiler` label, for PRs that
modify rustc's source code or tests (currently only `src/test/ui`).

This is possible now that rust-lang/triagebot#1321 has landed.
2021-12-12 11:10:05 -08:00
bors
6bda5b331c Auto merge of #90716 - euclio:libloading, r=cjgillot
replace dynamic library module with libloading

This PR deletes the `rustc_metadata::dynamic_lib` module in favor of the popular and better tested [`libloading` crate](https://github.com/nagisa/rust_libloading/).

We don't benefit from `libloading`'s symbol lifetimes since we end up leaking the loaded library in all cases, but the call-sites look much nicer by improving error handling and abstracting away some transmutes. We also can remove `rustc_metadata`'s direct dependencies on `libc` and `winapi`.

This PR also adds an exception for `libloading` (and its license) to tidy, so this will need sign-off from the compiler team.
2021-12-12 17:28:52 +00:00
bors
753e569c9c Auto merge of #90207 - BoxyUwU:stabilise_cg_defaults, r=lcnr
Stabilise `feature(const_generics_defaults)`

`feature(const_generics_defaults)` is complete implementation wise and has a pretty extensive test suite so I think is ready for stabilisation.

needs stabilisation report and maybe an RFC 😅

r? `@lcnr`
cc `@rust-lang/project-const-generics`
2021-12-12 14:24:23 +00:00
Ellen
1e896df2fe clippy owo 2021-12-12 12:34:21 +00:00
bors
4c9bdf4cbb Auto merge of #90423 - Aaron1011:deduplicate-projection, r=jackh726
Deduplicate projection sub-obligations
2021-12-12 11:24:20 +00:00
bors
a0a4c7d1e4 Auto merge of #91825 - matthiaskrgr:rollup-e4s8lwp, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #91746 (Btree: assert more API compatibility)
 - #91748 (rustdoc: Add regression test for Iterator as notable trait on &mut T)
 - #91811 (bootstrap: Change unwrap() to expect() for WIX path)
 - #91814 (doc: fix typo in comments)
 - #91815 (better span for unexpected normalization failure in CTFE engine)
 - #91817 (rustbot: Add autolabeling for `T-rustdoc`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-12-12 06:54:28 +00:00
Matthias Krüger
479e18920c
Rollup merge of #91817 - rust-lang:rustdoc-autolabel, r=Mark-Simulacrum
rustbot: Add autolabeling for `T-rustdoc`

This commit adds autolabeling for the `T-rustdoc` label, for PRs that
modify rustdoc's source code, tests, or internal tooling.

This is possible now that rust-lang/triagebot#1321 has landed.
2021-12-12 07:45:32 +01:00
Matthias Krüger
6d9d8de029
Rollup merge of #91815 - RalfJung:span, r=oli-obk
better span for unexpected normalization failure in CTFE engine

No reason to use `DUMMY_SP` here.
2021-12-12 07:45:31 +01:00
Matthias Krüger
955e552d31
Rollup merge of #91814 - japm48:spelling-fix, r=RalfJung
doc: fix typo in comments

`dereferencable -> dereferenceable`

Fixes #91802.
2021-12-12 07:45:30 +01:00
Matthias Krüger
be20570a07
Rollup merge of #91811 - itzurabhi:boostrap-dist-wix-unwrap-issue, r=Mark-Simulacrum
bootstrap: Change unwrap() to expect() for WIX path

On Windows, `x.py dist` command panics without proper error message if `WIX` environment variable is not set. This patch changes `Option::unwrap()` to `Option::expect()`.
2021-12-12 07:45:29 +01:00
Matthias Krüger
5dec0139f9
Rollup merge of #91748 - notriddle:notriddle/doc-notable_trait-mut_t_is_not_an_iterator, r=Mark-Simulacrum
rustdoc: Add regression test for Iterator as notable trait on &mut T

Closes #80737
2021-12-12 07:45:28 +01:00
Matthias Krüger
0f3a4c77c4
Rollup merge of #91746 - ssomers:btree_tests, r=Mark-Simulacrum
Btree: assert more API compatibility

Introducing a member such as `BTreeSet::min()` would silently break compatibility if no code calls the existing `BTreeSet::min(set)`. `BTreeSet` is the only btree class silently bringing in stable members, apart from many occurrences of `#[derive(Debug)]` on iterators.

r? `@Mark-Simulacrum`
2021-12-12 07:45:28 +01:00
woppopo
7f5dc0f609 Make (*mut T)::write_bytes const 2021-12-12 14:02:53 +09:00
Deadbeef
ffc9082d97
Remove function from rebase 2021-12-12 12:52:30 +08:00
Deadbeef
83587e8d30
Small performance tweaks 2021-12-12 12:35:01 +08:00