Commit Graph

159678 Commits

Author SHA1 Message Date
Esteban Kuber
f2fc84f604 fix coverage report test 2021-12-13 17:22:48 +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
Esteban Kuber
64f88e8379 fix clippy tests 2021-12-13 17:09:16 +00:00
Esteban Kuber
1a7f2d5cd9 review comment: change wording of suggestion 2021-12-13 17:09:16 +00:00
Esteban Kuber
64dea33a3d review comments 2021-12-13 17:09:16 +00:00
Esteban Kuber
d59f74aeaf Simplify diagnostic logic
The spans no longer overlap, so we no longer need to specialize the
output depending on whether they would.
2021-12-13 17:09:16 +00:00
Esteban Kuber
9ecb141643 tidy fix 2021-12-13 17:09:16 +00:00
Esteban Kuber
b825b0fe63 Fix rebase and clippy tests 2021-12-13 17:09:16 +00:00
Esteban Kuber
8888d0d61e Fix clippy uses of QPath::LangItem 2021-12-13 17:09:16 +00:00
Esteban Kuber
f640438b40 Keep info on pre-desugaring expression for better "incorrect .await" suggestion
Keep the `HirId` of `.await`ed expressions so in the case of a `fn` call
on on a sync `fn`, we can suggest maybe turning it into an `async fn`.
2021-12-13 17:09:16 +00:00
Esteban Kuber
d45e030c04 Fix mistake 2021-12-13 17:09:15 +00:00
Esteban Kuber
4f2b1c0650 Remove unnecessary argument 2021-12-13 17:09:15 +00:00
Esteban Kuber
79749d64fa Remove yet more output from for-loop and ? errors 2021-12-13 17:09:15 +00:00
Esteban Kuber
81a3b90afd Further silence ? errors 2021-12-13 17:09:15 +00:00
Esteban Kuber
caf0c1bb1c Reduce verbosity for ? on non-Try expressions 2021-12-13 17:09:15 +00:00
Esteban Kuber
75b62757e4 Reduce verbosity when calling for-loop on non-Iterator expression 2021-12-13 17:09:15 +00:00
Esteban Kuber
7227a87371 When .await is called on a non-Future expression, suggest removal
Keep track of the origin of a `T: Future` obligation when caused by an
`.await` expression.

Address #66731.
2021-12-13 17:09:15 +00: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
Lucas Kent
fae40c5070 Suggest to specify a target triple when eh_personality lang item is missing 2021-12-14 00:04:15 +11:00
Jonas Berlin
715c562d71
[ReviewFix] Linguistics 2021-12-13 13:52:17 +02:00
Jonas Berlin
7f2f9c60c2
Iterator::cycle() — document empty iterator special case 2021-12-13 13:23:33 +02: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
ouz-a
a01b13dede formatting 2021-12-13 12:59:31 +03:00
ouz-a
01948e2f45 Looser check for binary_op_overflow 2021-12-13 12:35:55 +03: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
woppopo
2a5a6680fc Make MaybeUninit::zeroed const 2021-12-13 14:17:35 +09: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
Amanieu d'Antras
ead68f0e5c Fix clippy tests 2021-12-13 00:00:51 +00:00
Tomasz Miąsko
3f2a1c9c17 Use OutputFilenames to generate output file for -Zllvm-time-trace
The resulting profile will include the crate name and will be stored in
the `--out-dir` directory.

This implementation makes it convenient to use LLVM time trace together
with cargo, in the contrast to the previous implementation which would
overwrite profiles or store them in `.cargo/registry/..`.
2021-12-13 00:00:00 +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