]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRevert "Set MACOSX_DEPLOYMENT_TARGET env var to default for linking if not set."
Hans Kratz [Mon, 13 Dec 2021 20:31:48 +0000 (21:31 +0100)]
Revert "Set MACOSX_DEPLOYMENT_TARGET env var to default for linking if not set."

This reverts commit b376f5621b801460b911a75048a70698021bbc69, which is
the main part of #90499, because it turns out that this causes a good
amount of breakage in crates relying on the old behavior.

Fixes #91372.

2 years agoAuto merge of #91865 - matthiaskrgr:rollup-rai9ecq, r=matthiaskrgr
bors [Mon, 13 Dec 2021 20:12:35 +0000 (20:12 +0000)]
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

2 years agofix coverage report test
Esteban Kuber [Mon, 13 Dec 2021 17:22:48 +0000 (17:22 +0000)]
fix coverage report test

2 years agoRollup merge of #91855 - xfix:const_cstr_unchecked, r=dtolnay
Matthias Krüger [Mon, 13 Dec 2021 17:15:17 +0000 (18:15 +0100)]
Rollup merge of #91855 - xfix:const_cstr_unchecked, r=dtolnay

Stabilize const_cstr_unchecked

Closes #90343

``@rustbot`` modify labels: +T-libs-api

2 years agoRollup merge of #91849 - jackh726:gats-outlives-lint-part2, r=nikomatsakis
Matthias Krüger [Mon, 13 Dec 2021 17:15:16 +0000 (18:15 +0100)]
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``

2 years agoRollup merge of #91847 - BoxyUwU:generic_arg_infer_fixme, r=lcnr
Matthias Krüger [Mon, 13 Dec 2021 17:15:15 +0000 (18:15 +0100)]
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

2 years agoRollup merge of #91846 - camelid:doctest-cleanup, r=GuillaumeGomez
Matthias Krüger [Mon, 13 Dec 2021 17:15:14 +0000 (18:15 +0100)]
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`

2 years agoRollup merge of #91699 - jsha:webkit-appearance-search-input, r=GuillaumeGomez
Matthias Krüger [Mon, 13 Dec 2021 17:15:13 +0000 (18:15 +0100)]
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

2 years agofix clippy tests
Esteban Kuber [Fri, 10 Dec 2021 17:20:57 +0000 (17:20 +0000)]
fix clippy tests

2 years agoreview comment: change wording of suggestion
Esteban Kuber [Fri, 10 Dec 2021 03:01:37 +0000 (03:01 +0000)]
review comment: change wording of suggestion

2 years agoreview comments
Esteban Kuber [Thu, 2 Dec 2021 23:41:45 +0000 (23:41 +0000)]
review comments

2 years agoSimplify diagnostic logic
Esteban Kuber [Wed, 17 Nov 2021 17:33:15 +0000 (17:33 +0000)]
Simplify diagnostic logic

The spans no longer overlap, so we no longer need to specialize the
output depending on whether they would.

2 years agotidy fix
Esteban Kuber [Tue, 16 Nov 2021 23:04:15 +0000 (23:04 +0000)]
tidy fix

2 years agoFix rebase and clippy tests
Esteban Kuber [Tue, 16 Nov 2021 22:06:25 +0000 (22:06 +0000)]
Fix rebase and clippy tests

2 years agoFix clippy uses of QPath::LangItem
Esteban Kuber [Tue, 16 Nov 2021 20:44:25 +0000 (20:44 +0000)]
Fix clippy uses of QPath::LangItem

2 years agoKeep info on pre-desugaring expression for better "incorrect `.await`" suggestion
Esteban Kuber [Tue, 16 Nov 2021 20:07:23 +0000 (20:07 +0000)]
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`.

2 years agoFix mistake
Esteban Kuber [Tue, 16 Nov 2021 03:04:36 +0000 (03:04 +0000)]
Fix mistake

2 years agoRemove unnecessary argument
Esteban Kuber [Tue, 16 Nov 2021 03:03:00 +0000 (03:03 +0000)]
Remove unnecessary argument

2 years agoRemove yet more output from `for`-loop and `?` errors
Esteban Kuber [Tue, 16 Nov 2021 02:50:30 +0000 (02:50 +0000)]
Remove yet more output from `for`-loop and `?` errors

2 years agoFurther silence `?` errors
Esteban Kuber [Tue, 16 Nov 2021 02:27:18 +0000 (02:27 +0000)]
Further silence `?` errors

2 years agoReduce verbosity for `?` on non-`Try` expressions
Esteban Kuber [Tue, 16 Nov 2021 02:17:57 +0000 (02:17 +0000)]
Reduce verbosity for `?` on non-`Try` expressions

2 years agoReduce verbosity when calling `for`-loop on non-`Iterator` expression
Esteban Kuber [Tue, 16 Nov 2021 01:46:28 +0000 (01:46 +0000)]
Reduce verbosity when calling `for`-loop on non-`Iterator` expression

2 years agoWhen `.await` is called on a non-`Future` expression, suggest removal
Esteban Kuber [Tue, 16 Nov 2021 00:57:53 +0000 (00:57 +0000)]
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.

2 years agoAuto merge of #91353 - eggyal:reuse-rcs-during-folding, r=lcnr
bors [Mon, 13 Dec 2021 17:05:40 +0000 (17:05 +0000)]
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`

2 years agoAdd run-make-fulldeps test
pierwill [Thu, 28 Oct 2021 17:00:43 +0000 (12:00 -0500)]
Add run-make-fulldeps test

Implement RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER

Also makes minor docs edits.

2 years agoInclude rustc version in `rustc_span::StableCrateId`
pierwill [Wed, 20 Oct 2021 20:14:16 +0000 (15:14 -0500)]
Include rustc version in `rustc_span::StableCrateId`

Normalize symbol hashes in compiletest.

Remove DefId sorting

2 years agoAdjust wording for review
Jack Huey [Mon, 13 Dec 2021 15:06:57 +0000 (10:06 -0500)]
Adjust wording for review

2 years agoAvoid cloning refcounted types during folding
Alan Egerton [Mon, 29 Nov 2021 12:55:00 +0000 (12:55 +0000)]
Avoid cloning refcounted types during folding

2 years agoAuto merge of #91657 - nikic:update-llvm, r=cuviper
bors [Mon, 13 Dec 2021 13:37:53 +0000 (13:37 +0000)]
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

2 years agoSuggest to specify a target triple when eh_personality lang item is missing
Lucas Kent [Sun, 12 Dec 2021 02:04:00 +0000 (13:04 +1100)]
Suggest to specify a target triple when eh_personality lang item is missing

2 years ago[ReviewFix] Linguistics
Jonas Berlin [Mon, 13 Dec 2021 11:52:17 +0000 (13:52 +0200)]
[ReviewFix] Linguistics

2 years agoIterator::cycle() — document empty iterator special case
Jonas Berlin [Mon, 13 Dec 2021 11:23:33 +0000 (13:23 +0200)]
Iterator::cycle() — document empty iterator special case

2 years agoAuto merge of #91654 - nikic:llvmbc-section-flags, r=nagisa
bors [Mon, 13 Dec 2021 10:35:28 +0000 (10:35 +0000)]
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`

2 years agoformatting
ouz-a [Mon, 13 Dec 2021 09:59:31 +0000 (12:59 +0300)]
formatting

2 years agoLooser check for binary_op_overflow
ouz-a [Mon, 13 Dec 2021 09:35:55 +0000 (12:35 +0300)]
Looser check for binary_op_overflow

2 years agoStabilize const_cstr_unchecked
Konrad Borowski [Mon, 13 Dec 2021 07:43:19 +0000 (08:43 +0100)]
Stabilize const_cstr_unchecked

2 years agoAuto merge of #91626 - klensy:json-less-alloc, r=petrochenkov
bors [Mon, 13 Dec 2021 07:30:38 +0000 (07:30 +0000)]
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

2 years agoI wrote these functions, I should use them dang it
Jack Huey [Mon, 13 Dec 2021 06:10:39 +0000 (01:10 -0500)]
I wrote these functions, I should use them dang it

2 years agoInstead of checking for exact bounds, try to prove them
Jack Huey [Mon, 13 Dec 2021 04:23:55 +0000 (23:23 -0500)]
Instead of checking for exact bounds, try to prove them

2 years agoMake `MaybeUninit::zeroed` `const`
woppopo [Mon, 13 Dec 2021 05:17:35 +0000 (14:17 +0900)]
Make `MaybeUninit::zeroed` `const`

2 years agoAdd -webkit-appearance: none to search input
Jacob Hoffman-Andrews [Thu, 9 Dec 2021 07:39:42 +0000 (23:39 -0800)]
Add -webkit-appearance: none to search input

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

2 years agoAuto merge of #91569 - erikdesjardins:vt-align, r=nikic
bors [Mon, 13 Dec 2021 04:29:20 +0000 (04:29 +0000)]
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: https://github.com/rust-lang/rust/blob/772d51f887fa407216860bf8ecf3f1a32fb795b4/compiler/rustc_middle/src/ty/vtable.rs#L68-L90 and is nonzero because [`Align::bytes()`](https://github.com/rust-lang/rust/blob/772d51f887fa407216860bf8ecf3f1a32fb795b4/compiler/rustc_target/src/abi/mod.rs#L547-L549) is always nonzero.

2 years agoextra test for bug i found
Ellen [Mon, 13 Dec 2021 03:33:14 +0000 (03:33 +0000)]
extra test for bug i found

2 years agohurray for portable simd finding a nice test for this FIXME
Ellen [Mon, 13 Dec 2021 03:16:00 +0000 (03:16 +0000)]
hurray for portable simd finding a nice test for this FIXME

2 years agodoctest: Rename `options` to `rustdoc_options`
Noah Lev [Sat, 4 Dec 2021 03:54:38 +0000 (19:54 -0800)]
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.

2 years agoRename `TestOptions` to `GlobalTestOptions`
Noah Lev [Sat, 4 Dec 2021 03:49:31 +0000 (19:49 -0800)]
Rename `TestOptions` to `GlobalTestOptions`

It seems to apply to all doctests in the crate.

2 years agorustdoc: Coalesce some `run_test` args as one `LangString` arg
Noah Lev [Sat, 4 Dec 2021 03:43:50 +0000 (19:43 -0800)]
rustdoc: Coalesce some `run_test` args as one `LangString` arg

2 years agoAuto merge of #91841 - matthiaskrgr:rollup-zlhsg5a, r=matthiaskrgr
bors [Mon, 13 Dec 2021 00:56:18 +0000 (00:56 +0000)]
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

2 years agoFix clippy tests
Amanieu d'Antras [Mon, 13 Dec 2021 00:00:51 +0000 (00:00 +0000)]
Fix clippy tests

2 years agoUse `OutputFilenames` to generate output file for `-Zllvm-time-trace`
Tomasz Miąsko [Mon, 13 Dec 2021 00:00:00 +0000 (00:00 +0000)]
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/..`.

2 years agoRollup merge of #91824 - woppopo:const_ptr_write_bytes, r=oli-obk
Matthias Krüger [Sun, 12 Dec 2021 23:20:10 +0000 (00:20 +0100)]
Rollup merge of #91824 - woppopo:const_ptr_write_bytes, r=oli-obk

Make `(*mut T)::write_bytes` `const`

Tracking issue: #86302

2 years agoRollup merge of #91819 - rust-lang:compiler-autolabel, r=jackh726
Matthias Krüger [Sun, 12 Dec 2021 23:20:09 +0000 (00:20 +0100)]
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.

2 years agoRollup merge of #91749 - ssomers:btree_comments, r=Mark-Simulacrum
Matthias Krüger [Sun, 12 Dec 2021 23:20:08 +0000 (00:20 +0100)]
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`

2 years agoRollup merge of #91091 - ecstatic-morse:control-flow-enum-is, r=m-ou-se
Matthias Krüger [Sun, 12 Dec 2021 23:20:07 +0000 (00:20 +0100)]
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

2 years agoRollup merge of #91086 - rhysd:issue-91085, r=m-ou-se
Matthias Krüger [Sun, 12 Dec 2021 23:20:06 +0000 (00:20 +0100)]
Rollup merge of #91086 - rhysd:issue-91085, r=m-ou-se

Implement `TryFrom<&'_ mut [T]>` for `[T; N]`

Fixes #91085.

2 years agoAuto merge of #91549 - fee1-dead:const_env, r=spastorino
bors [Sun, 12 Dec 2021 22:15:32 +0000 (22:15 +0000)]
Auto merge of #91549 - fee1-dead:const_env, r=spastorino

Eliminate ConstnessAnd again

Closes #91489.
Closes #89432.

Reverts #91491.
Reverts #89450.

r? `@spastorino`

2 years agoFix unused import in test
Amanieu d'Antras [Sun, 12 Dec 2021 21:11:15 +0000 (21:11 +0000)]
Fix unused import in test

2 years agorustbot: Add autolabeling for `T-compiler`
Noah Lev [Sun, 12 Dec 2021 02:03:52 +0000 (18:03 -0800)]
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.

2 years agoAuto merge of #90716 - euclio:libloading, r=cjgillot
bors [Sun, 12 Dec 2021 17:28:52 +0000 (17:28 +0000)]
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.

2 years agoAuto merge of #90207 - BoxyUwU:stabilise_cg_defaults, r=lcnr
bors [Sun, 12 Dec 2021 14:24:23 +0000 (14:24 +0000)]
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 :sweat_smile:

r? `@lcnr`
cc `@rust-lang/project-const-generics`

2 years agoclippy owo
Ellen [Sun, 12 Dec 2021 12:34:21 +0000 (12:34 +0000)]
clippy owo

2 years agoAddress review feedback
Amanieu d'Antras [Sat, 11 Dec 2021 00:11:26 +0000 (00:11 +0000)]
Address review feedback

2 years agoRe-bless asm tests for aarch64
Amanieu d'Antras [Sat, 11 Dec 2021 00:11:10 +0000 (00:11 +0000)]
Re-bless asm tests for aarch64

2 years agoAuto merge of #90423 - Aaron1011:deduplicate-projection, r=jackh726
bors [Sun, 12 Dec 2021 11:24:20 +0000 (11:24 +0000)]
Auto merge of #90423 - Aaron1011:deduplicate-projection, r=jackh726

Deduplicate projection sub-obligations

2 years agoStabilize asm! and global_asm!
Amanieu d'Antras [Fri, 10 Dec 2021 00:15:33 +0000 (00:15 +0000)]
Stabilize asm! and global_asm!

They are also removed from the prelude as per the decision in
https://github.com/rust-lang/rust/issues/87228.

stdarch and compiler-builtins are updated to work with the new, stable
asm! and global_asm! macros.

2 years agoRemove automatic rustfix of asm! to llvm_asm!
Amanieu d'Antras [Thu, 9 Dec 2021 18:48:19 +0000 (18:48 +0000)]
Remove automatic rustfix of asm! to llvm_asm!

This no longer works now that asm! needs an explicit import. Also, it's
been over a year since asm! landed, everyone should have transitioned by
now.

2 years agoAvoid suggesting self in visibility spec
Dániel Buga [Sat, 11 Dec 2021 16:32:15 +0000 (17:32 +0100)]
Avoid suggesting self in visibility spec

Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2 years agoAuto merge of #91825 - matthiaskrgr:rollup-e4s8lwp, r=matthiaskrgr
bors [Sun, 12 Dec 2021 06:54:28 +0000 (06:54 +0000)]
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

2 years agoRollup merge of #91817 - rust-lang:rustdoc-autolabel, r=Mark-Simulacrum
Matthias Krüger [Sun, 12 Dec 2021 06:45:32 +0000 (07:45 +0100)]
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.

2 years agoRollup merge of #91815 - RalfJung:span, r=oli-obk
Matthias Krüger [Sun, 12 Dec 2021 06:45:31 +0000 (07:45 +0100)]
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.

2 years agoRollup merge of #91814 - japm48:spelling-fix, r=RalfJung
Matthias Krüger [Sun, 12 Dec 2021 06:45:30 +0000 (07:45 +0100)]
Rollup merge of #91814 - japm48:spelling-fix, r=RalfJung

doc: fix typo in comments

`dereferencable -> dereferenceable`

Fixes #91802.

2 years agoRollup merge of #91811 - itzurabhi:boostrap-dist-wix-unwrap-issue, r=Mark-Simulacrum
Matthias Krüger [Sun, 12 Dec 2021 06:45:29 +0000 (07:45 +0100)]
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()`.

2 years agoRollup merge of #91748 - notriddle:notriddle/doc-notable_trait-mut_t_is_not_an_iterat...
Matthias Krüger [Sun, 12 Dec 2021 06:45:28 +0000 (07:45 +0100)]
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

2 years agoRollup merge of #91746 - ssomers:btree_tests, r=Mark-Simulacrum
Matthias Krüger [Sun, 12 Dec 2021 06:45:28 +0000 (07:45 +0100)]
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`

2 years agoMake `(*mut T)::write_bytes` `const`
woppopo [Sun, 12 Dec 2021 05:02:53 +0000 (14:02 +0900)]
Make `(*mut T)::write_bytes` `const`

2 years agoRemove function from rebase
Deadbeef [Sun, 12 Dec 2021 04:52:30 +0000 (12:52 +0800)]
Remove function from rebase

2 years agoSmall performance tweaks
Deadbeef [Wed, 8 Dec 2021 13:08:44 +0000 (21:08 +0800)]
Small performance tweaks

2 years agoRemap more env constness for queries
Deadbeef [Tue, 7 Dec 2021 12:40:06 +0000 (20:40 +0800)]
Remap more env constness for queries

2 years agoRemap predicate/env constness before querying
Deadbeef [Tue, 7 Dec 2021 08:08:59 +0000 (16:08 +0800)]
Remap predicate/env constness before querying

2 years agoQuery modifier
Deadbeef [Mon, 6 Dec 2021 11:47:54 +0000 (19:47 +0800)]
Query modifier

2 years agoAdd trailing newline
Deadbeef [Sun, 5 Dec 2021 11:03:01 +0000 (19:03 +0800)]
Add trailing newline

2 years agoRevert "Auto merge of #89450 - usbalbin:const_try_revert, r=oli-obk"
Deadbeef [Sun, 5 Dec 2021 10:46:29 +0000 (18:46 +0800)]
Revert "Auto merge of #89450 - usbalbin:const_try_revert, r=oli-obk"

This reverts commit a8387aef8c378a771686878062e544af4d5e2245, reversing
changes made to 6e1211081239be62a5d0bb3bbcb29a9f14621c81.

2 years agoRevert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"
Deadbeef [Sun, 12 Dec 2021 04:34:46 +0000 (12:34 +0800)]
Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"

This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing
changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.

2 years agoadd regression test for #91489
SNCPlay42 [Fri, 3 Dec 2021 16:31:06 +0000 (16:31 +0000)]
add regression test for #91489

2 years agoFix #91489
Deadbeef [Mon, 6 Dec 2021 12:46:05 +0000 (20:46 +0800)]
Fix #91489

2 years agoAuto merge of #89404 - Kobzol:hash-stable-sort, r=Mark-Simulacrum
bors [Sun, 12 Dec 2021 03:50:30 +0000 (03:50 +0000)]
Auto merge of #89404 - Kobzol:hash-stable-sort, r=Mark-Simulacrum

Slightly optimize hash map stable hashing

I was profiling some of the `rustc-perf` benchmarks locally and noticed that quite some time is spent inside the stable hash of hashmaps. I tried to use a `SmallVec` instead of a `Vec` there, which helped very slightly.

Then I tried to remove the sorting, which was a bottleneck, and replaced it with insertion into a binary heap. Locally, it yielded nice improvements in instruction counts and RSS in several benchmarks for incremental builds. The implementation could probably be much nicer and possibly extended to other stable hashes, but first I wanted to test the perf impact properly.

Can I ask someone to do a perf run? Thank you!

2 years agoAuto merge of #91813 - matthiaskrgr:rollup-nryyeyj, r=matthiaskrgr
bors [Sun, 12 Dec 2021 00:58:30 +0000 (00:58 +0000)]
Auto merge of #91813 - matthiaskrgr:rollup-nryyeyj, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #90081 (Make `intrinsics::write_bytes` const)
 - #91643 (asm: Allow using r9 (ARM) and x18 (AArch64) if they are not reserved by the current target)
 - #91737 (Make certain panicky stdlib functions behave better under panic_immediate_abort)
 - #91750 (rustdoc: Add regression test for Iterator as notable trait on &T)
 - #91764 (Do not ICE when suggesting elided lifetimes on non-existent spans.)
 - #91780 (Remove hir::Node::hir_id.)
 - #91797 (Fix zero-sized reference to deallocated memory)
 - #91806 (Make `Unique`s methods `const`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agorustbot: Add autolabeling for `T-rustdoc`
Noah Lev [Sun, 12 Dec 2021 00:51:07 +0000 (16:51 -0800)]
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.

2 years agobetter span for unexpected normalization failure in CTFE engine
Ralf Jung [Sat, 11 Dec 2021 23:55:58 +0000 (18:55 -0500)]
better span for unexpected normalization failure in CTFE engine

2 years agodoc: fix typo in comments
japm48 [Sat, 11 Dec 2021 23:23:06 +0000 (00:23 +0100)]
doc: fix typo in comments

dereferencable -> dereferenceable

2 years agoRollup merge of #91806 - woppopo:const_unique, r=dtolnay
Matthias Krüger [Sat, 11 Dec 2021 22:31:55 +0000 (23:31 +0100)]
Rollup merge of #91806 - woppopo:const_unique, r=dtolnay

Make `Unique`s methods `const`

Tracking issue: None

2 years agoRollup merge of #91797 - the8472:fix-invalid-deref, r=Mark-Simulacrum
Matthias Krüger [Sat, 11 Dec 2021 22:31:54 +0000 (23:31 +0100)]
Rollup merge of #91797 - the8472:fix-invalid-deref, r=Mark-Simulacrum

Fix zero-sized reference to deallocated memory

fixes #91772

r? `@camelid`

2 years agoRollup merge of #91780 - cjgillot:localize, r=Mark-Simulacrum
Matthias Krüger [Sat, 11 Dec 2021 22:31:53 +0000 (23:31 +0100)]
Rollup merge of #91780 - cjgillot:localize, r=Mark-Simulacrum

Remove hir::Node::hir_id.

Small cleanup.

2 years agoRollup merge of #91764 - cjgillot:elide-anyway, r=jackh726
Matthias Krüger [Sat, 11 Dec 2021 22:31:52 +0000 (23:31 +0100)]
Rollup merge of #91764 - cjgillot:elide-anyway, r=jackh726

Do not ICE when suggesting elided lifetimes on non-existent spans.

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

r? `@jackh726`

2 years agoRollup merge of #91750 - notriddle:notriddle/doc-notable_trait-mut_t_is_not_ref_t...
Matthias Krüger [Sat, 11 Dec 2021 22:31:51 +0000 (23:31 +0100)]
Rollup merge of #91750 - notriddle:notriddle/doc-notable_trait-mut_t_is_not_ref_t, r=Mark-Simulacrum

rustdoc: Add regression test for Iterator as notable trait on &T

Closes #78160

This regression test is different from the one in #91748, because while neither of these function should have Iterator marked as a notable trait, the reasons are different.

* In this PR, it returns `&T where T: Iterator`. The `mut` is what's missing.
* In #91748, it returns `&mut T`. The trait bounds are what's missing.

2 years agoRollup merge of #91737 - Manishearth:panic-immediate-stdlib, r=joshtriplett
Matthias Krüger [Sat, 11 Dec 2021 22:31:50 +0000 (23:31 +0100)]
Rollup merge of #91737 - Manishearth:panic-immediate-stdlib, r=joshtriplett

Make certain panicky stdlib functions behave better under panic_immediate_abort

The stdlib has a `panic_immediate_abort` feature that turns panics into immediate aborts, without any formatting/display logic. This feature was [introduced](https://github.com/rust-lang/rust/pull/55011) primarily for codesize-constrained situations.

Unfortunately, this win doesn't quite propagate to `Result::expect()` and `Result::unwrap()`, while the formatting machinery is reduced, `expect()` and `unwrap()` both call `unwrap_failed("msg", &err)` which has a signature of `fn unwrap_failed(msg: &str, error: &dyn fmt::Debug)` and is `#[inline(never)]`. This means that `unwrap_failed` will unconditionally construct a `dyn Debug` trait object even though the object is never used in the function.

Constructing a trait object (even if you never call a method on it!) forces rust to include the vtable and any dependencies. This means that in `panic_immediate_abort` mode, calling expect/unwrap on a Result will pull in a whole bunch of formatting code for the error type even if it's completely unused.

This PR swaps out the function with one that won't require a trait object such that it won't force the inclusion of vtables in the code. It also gates off `#[inline(never)]` in a bunch of other places where allowing the inlining of an abort may be useful (this kind of thing is already done elsewhere in the stdlib).

I don't know how to write a test for this; we don't really seem to have any tests for `panic_immediate_abort` anyway so perhaps it's fine as is.

2 years agoRollup merge of #91643 - Amanieu:r9x18, r=joshtriplett
Matthias Krüger [Sat, 11 Dec 2021 22:31:49 +0000 (23:31 +0100)]
Rollup merge of #91643 - Amanieu:r9x18, r=joshtriplett

asm: Allow using r9 (ARM) and x18 (AArch64) if they are not reserved by the current target

This supersedes https://github.com/rust-lang/rust/pull/88879.

cc `@Skirmisher`

r? `@joshtriplett`

2 years agoRollup merge of #90081 - woppopo:const_write_bytes, r=oli-obk
Matthias Krüger [Sat, 11 Dec 2021 22:31:48 +0000 (23:31 +0100)]
Rollup merge of #90081 - woppopo:const_write_bytes, r=oli-obk

Make `intrinsics::write_bytes` const

This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`.

Tracking issue: #86302

2 years agobootstrap: Change `unwrap()` to `expect()` for `WIX` path
Abhishek Sudhakaran [Sat, 11 Dec 2021 22:01:40 +0000 (03:31 +0530)]
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()`.

2 years agoAuto merge of #91769 - estebank:type-trait-bound-span-2, r=oli-obk
bors [Sat, 11 Dec 2021 21:57:19 +0000 (21:57 +0000)]
Auto merge of #91769 - estebank:type-trait-bound-span-2, r=oli-obk

Tweak assoc type obligation spans

* Point at RHS of associated type in obligation span
* Point at `impl` assoc type on projection error
* Reduce verbosity of recursive obligations
* Point at source of binding lifetime obligation
* Tweak "required bound" note
* Tweak "expected... found opaque (return) type" labels
* Point at set type in impl assoc type WF errors

r? `@oli-obk`

This is a(n uncontroversial) subset of #85799.