]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agofix cg cranelift
Waffle Maybe [Sun, 7 Aug 2022 18:32:26 +0000 (22:32 +0400)]
fix cg cranelift

Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
22 months agofill in tracking issue for `feature(ptr_mask)`
Maybe Waffle [Mon, 20 Jun 2022 12:26:40 +0000 (16:26 +0400)]
fill in tracking issue for `feature(ptr_mask)`

22 months agoFix `ptr_mask` impl in cg gcc
Maybe Waffle [Fri, 13 May 2022 13:08:44 +0000 (17:08 +0400)]
Fix `ptr_mask` impl in cg gcc

22 months agoImplement `ptr_mask` intrinsic in cg gcc
Maybe Waffle [Wed, 11 May 2022 18:01:53 +0000 (22:01 +0400)]
Implement `ptr_mask` intrinsic in cg gcc

22 months agouse shorter `ptr_mask` impl in cg cranelift
Waffle Maybe [Wed, 11 May 2022 17:43:13 +0000 (21:43 +0400)]
use shorter `ptr_mask` impl in cg cranelift

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
22 months agoAdd pointer masking convenience functions
Maybe Waffle [Wed, 11 May 2022 13:52:00 +0000 (17:52 +0400)]
Add pointer masking convenience functions

This commit adds the following functions all of which have a signature
`pointer, usize -> pointer`:
- `<*mut T>::mask`
- `<*const T>::mask`
- `intrinsics::ptr_mask`

These functions are equivalent to `.map_addr(|a| a & mask)` but they
utilize `llvm.ptrmask` llvm intrinsic.

*masks your pointers*

22 months agoAuto merge of #100809 - matthiaskrgr:rollup-xkpd5ii, r=matthiaskrgr
bors [Sat, 20 Aug 2022 17:38:29 +0000 (17:38 +0000)]
Auto merge of #100809 - matthiaskrgr:rollup-xkpd5ii, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #99415 (Initial implementation of REUSE)
 - #99544 (Expose `Utf8Lossy` as `Utf8Chunks`)
 - #100585 (Fix trailing space showing up in example)
 - #100596 (Remove unnecessary stderr files)
 - #100642 (Update fortanix-sgx-abi and export some useful SGX usercall traits)
 - #100691 (Make `same_type_modulo_infer` a proper `TypeRelation`)
 - #100693 (Add LLVM15-specific codegen test for `try`/`?`s that now optimize away)
 - #100710 (Windows: Load synch functions together)
 - #100807 (Add TaKO8Ki to translation-related mention groups)

Failed merges:

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

22 months agoRollup merge of #100807 - TaKO8Ki:add-tako8ki-to-translation-related-mention-groups...
Matthias Krüger [Sat, 20 Aug 2022 17:32:14 +0000 (19:32 +0200)]
Rollup merge of #100807 - TaKO8Ki:add-tako8ki-to-translation-related-mention-groups, r=Mark-Simulacrum

Add TaKO8Ki to translation-related mention groups

Can I join translation-related mention groups?

cc `@davidtwco`

22 months agoRollup merge of #100710 - ChrisDenton:load-library, r=thomcc
Matthias Krüger [Sat, 20 Aug 2022 17:32:13 +0000 (19:32 +0200)]
Rollup merge of #100710 - ChrisDenton:load-library, r=thomcc

Windows: Load synch functions together

Attempt to load all the required sync functions and fail if any one of them fails.

This fixes a FIXME by going back to optional loading of `WakeByAddressSingle`.

Also reintroduces a macro for optional loading of functions but keeps it separate from the fallback macro rather than having that do two different jobs.

r? `@thomcc`

22 months agoRollup merge of #100693 - scottmcm:new-llvm15-nops, r=Mark-Simulacrum
Matthias Krüger [Sat, 20 Aug 2022 17:32:12 +0000 (19:32 +0200)]
Rollup merge of #100693 - scottmcm:new-llvm15-nops, r=Mark-Simulacrum

Add LLVM15-specific codegen test for `try`/`?`s that now optimize away

These still generated a bunch of code back in Rust 1.63 (<https://rust.godbolt.org/z/z31P8h6rz>), but with LLVM 15 merged they no longer do 🎉

22 months agoRollup merge of #100691 - compiler-errors:issue-100690, r=estebank
Matthias Krüger [Sat, 20 Aug 2022 17:32:11 +0000 (19:32 +0200)]
Rollup merge of #100691 - compiler-errors:issue-100690, r=estebank

Make `same_type_modulo_infer` a proper `TypeRelation`

Specifically, this fixes #100690 because we no longer consider a `ReLateBound` and a `ReVar` to be equal. `ReVar` can only be equal to free regions or static.

22 months agoRollup merge of #100642 - mzohreva:mz/update-sgx-abi-cancel-queue, r=Mark-Simulacrum
Matthias Krüger [Sat, 20 Aug 2022 17:32:10 +0000 (19:32 +0200)]
Rollup merge of #100642 - mzohreva:mz/update-sgx-abi-cancel-queue, r=Mark-Simulacrum

Update fortanix-sgx-abi and export some useful SGX usercall traits

Update `fortanix-sgx-abi` to 0.5.0 to add support for cancel queue (see https://github.com/fortanix/rust-sgx/pull/405 and https://github.com/fortanix/rust-sgx/pull/404).

Export some useful traits for processing SGX usercall. This is needed for https://github.com/fortanix/rust-sgx/pull/404 to avoid duplication.

cc `@raoulstrackx` and `@jethrogb`

22 months agoRollup merge of #100596 - TaKO8Ki:remove-unnecessary-stderr-files, r=Mark-Simulacrum
Matthias Krüger [Sat, 20 Aug 2022 17:32:09 +0000 (19:32 +0200)]
Rollup merge of #100596 - TaKO8Ki:remove-unnecessary-stderr-files, r=Mark-Simulacrum

Remove unnecessary stderr files

This patch removes stderr files corresponding to revisions that have already been removed.

22 months agoRollup merge of #100585 - wooorm:patch-1, r=Mark-Simulacrum
Matthias Krüger [Sat, 20 Aug 2022 17:32:08 +0000 (19:32 +0200)]
Rollup merge of #100585 - wooorm:patch-1, r=Mark-Simulacrum

Fix trailing space showing up in example

The current text is rendered as: U+005B ..= U+0060 ``[ \ ] ^ _ ` ``, or (**note the final space!**)
This patch changes that to render as: U+005B ..= U+0060 `` [ \ ] ^ _ ` ``, or (**note no final space!**)

The reason for that, is that CommonMark has a solution for starting or ending inline code with a backtick/grave accent: padding both sides with a space, makes that padding disappear.

22 months agoRollup merge of #99544 - dylni:expose-utf8lossy, r=Mark-Simulacrum
Matthias Krüger [Sat, 20 Aug 2022 17:32:07 +0000 (19:32 +0200)]
Rollup merge of #99544 - dylni:expose-utf8lossy, r=Mark-Simulacrum

Expose `Utf8Lossy` as `Utf8Chunks`

This PR changes the feature for `Utf8Lossy` from `str_internals` to `utf8_lossy` and improves the API. This is done to eventually expose the API as stable.

Proposal: rust-lang/libs-team#54
Tracking Issue: #99543

22 months agoRollup merge of #99415 - ferrocene:pa-reuse-initial, r=Mark-Simulacrum
Matthias Krüger [Sat, 20 Aug 2022 17:32:06 +0000 (19:32 +0200)]
Rollup merge of #99415 - ferrocene:pa-reuse-initial, r=Mark-Simulacrum

Initial implementation of REUSE

This PR implements the first two steps of #99414 by:

* Adding some scaffolding for REUSE. The `.reuse/dep5` file now marks every file as the custom "TODO" license, which I'll remove in a future PR once Debian imports their metadata. The TODO license is needed so that `reuse lint` works.
* Runs `reuse lint` in CI, in the `mingw-check` builder. REUSE currently has a bug when parsing some files in the LLVM source code. This means REUSE will fail when running it in source tarballs of rustc, and that bug prevents us from passing the `--include-submodules` flag in CI. I opened https://github.com/fsfe/reuse-tool/pull/560 upstream with a fix, and as soon as it's merged/released I planned to bump the pinned version to include the fix we need.

r? `@Mark-Simulacrum`

22 months agoExpose `Utf8Lossy` as `Utf8Chunks`
dylni [Sat, 20 Aug 2022 16:49:20 +0000 (12:49 -0400)]
Expose `Utf8Lossy` as `Utf8Chunks`

22 months agoadd TaKO8Ki to translation-related mention groups
Takayuki Maeda [Sat, 20 Aug 2022 11:47:41 +0000 (20:47 +0900)]
add TaKO8Ki to translation-related mention groups

22 months agoAuto merge of #100564 - nnethercote:box-ast-MacCall, r=spastorino
bors [Sat, 20 Aug 2022 10:26:54 +0000 (10:26 +0000)]
Auto merge of #100564 - nnethercote:box-ast-MacCall, r=spastorino

Box the `MacCall` in various types.

r? `@spastorino`

22 months agoAuto merge of #100793 - matthiaskrgr:rollup-dy7rfdh, r=matthiaskrgr
bors [Sat, 20 Aug 2022 07:59:48 +0000 (07:59 +0000)]
Auto merge of #100793 - matthiaskrgr:rollup-dy7rfdh, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #100186 (Mention `as_mut` alongside `as_ref` in borrowck error message)
 - #100383 (Mitigate stale data reads on SGX platform)
 - #100507 (suggest `once_cell::Lazy` for non-const statics)
 - #100617 (Suggest the right help message for as_ref)
 - #100667 (Migrate "invalid variable declaration" errors to SessionDiagnostic)
 - #100709 (Migrate typeck's `used` expected symbol diagnostic to `SessionDiagnostic`)
 - #100723 (Add the diagnostic translation lints to crates that don't emit them)
 - #100729 (Avoid zeroing a 1kb stack buffer on every call to `std::sys::windows::fill_utf16_buf`)
 - #100750 (improved diagnostic for function defined with `def`, `fun`, `func`, or `function` instead of `fn`)
 - #100763 (triagebot: Autolabel `A-rustdoc-json`)

Failed merges:

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

22 months agoRollup merge of #100763 - aDotInTheVoid:triagebot-rdj, r=jyn514
Matthias Krüger [Sat, 20 Aug 2022 05:09:06 +0000 (07:09 +0200)]
Rollup merge of #100763 - aDotInTheVoid:triagebot-rdj, r=jyn514

triagebot: Autolabel `A-rustdoc-json`

22 months agoRollup merge of #100750 - akabinds:akabinds/improved-invalid-function-qual-error...
Matthias Krüger [Sat, 20 Aug 2022 05:09:05 +0000 (07:09 +0200)]
Rollup merge of #100750 - akabinds:akabinds/improved-invalid-function-qual-error, r=davidtwco

improved diagnostic for function defined with `def`, `fun`, `func`, or `function` instead of `fn`

Closes #99751

22 months agoRollup merge of #100729 - thomcc:less-initialized, r=ChrisDenton
Matthias Krüger [Sat, 20 Aug 2022 05:09:04 +0000 (07:09 +0200)]
Rollup merge of #100729 - thomcc:less-initialized, r=ChrisDenton

Avoid zeroing a 1kb stack buffer on every call to `std::sys::windows::fill_utf16_buf`

I've also tried to be slightly more careful about integer overflows, although in practice this is likely still not handled ideally.

r? `@ChrisDenton`

22 months agoRollup merge of #100723 - 5225225:the-easy-ones, r=compiler-errors
Matthias Krüger [Sat, 20 Aug 2022 05:09:03 +0000 (07:09 +0200)]
Rollup merge of #100723 - 5225225:the-easy-ones, r=compiler-errors

Add the diagnostic translation lints to crates that don't emit them

Some of these have a note saying that they should build on a stable compiler, does that mean they shouldn't get these lints? Or can we cfg them out on those?

22 months agoRollup merge of #100709 - JhonnyBillM:port-expected-used-symbol-diagnostic, r=compile...
Matthias Krüger [Sat, 20 Aug 2022 05:09:02 +0000 (07:09 +0200)]
Rollup merge of #100709 - JhonnyBillM:port-expected-used-symbol-diagnostic, r=compiler-errors

Migrate typeck's `used` expected symbol diagnostic to `SessionDiagnostic`

r? ``@davidtwco``

22 months agoRollup merge of #100667 - Xiretza:diag-structs-parser-ivd, r=davidtwco
Matthias Krüger [Sat, 20 Aug 2022 05:09:01 +0000 (07:09 +0200)]
Rollup merge of #100667 - Xiretza:diag-structs-parser-ivd, r=davidtwco

Migrate "invalid variable declaration" errors to SessionDiagnostic

After seeing the great blog post on Inside Rust, I decided to try my hand at this. Just one diagnostic for now to get used to the workflow and to check if this is the way to do it or if there are any problems.

22 months agoRollup merge of #100617 - chenyukang:fix-100605, r=compiler-errors
Matthias Krüger [Sat, 20 Aug 2022 05:09:00 +0000 (07:09 +0200)]
Rollup merge of #100617 - chenyukang:fix-100605, r=compiler-errors

Suggest the right help message for as_ref

Fixes #100605

22 months agoRollup merge of #100507 - cameron1024:suggest-lazy, r=compiler-errors
Matthias Krüger [Sat, 20 Aug 2022 05:08:59 +0000 (07:08 +0200)]
Rollup merge of #100507 - cameron1024:suggest-lazy, r=compiler-errors

suggest `once_cell::Lazy` for non-const statics

Addresses https://github.com/rust-lang/rust/issues/100410

Some questions:
 - removing the `if` seems to include too many cases (e.g. calls to non-const functions inside a `const fn`), but this code excludes the following case:
```rust
const FOO: Foo = non_const_fn();
```
Should we suggest `once_cell` in this case as well?
 - The original issue mentions suggesting `AtomicI32` instead of `Mutex<i32>`, should this PR address that as well?

22 months agoRollup merge of #100383 - fortanix:raoul/aepic_leak_mitigation, r=cuviper
Matthias Krüger [Sat, 20 Aug 2022 05:08:58 +0000 (07:08 +0200)]
Rollup merge of #100383 - fortanix:raoul/aepic_leak_mitigation, r=cuviper

Mitigate stale data reads on SGX platform

Intel disclosed the Stale Data Read vulnerability yesterday. In order to mitigate this issue completely, reading userspace from an SGX enclave must be aligned and in 8-bytes chunks. This PR implements this mitigation

References:
 - https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00657.html
 - https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/advisory-guidance/stale-data-read-from-xapic.html

cc: ``@jethrogb``

22 months agoRollup merge of #100186 - compiler-errors:or-as_mut, r=fee1-dead
Matthias Krüger [Sat, 20 Aug 2022 05:08:57 +0000 (07:08 +0200)]
Rollup merge of #100186 - compiler-errors:or-as_mut, r=fee1-dead

Mention `as_mut` alongside `as_ref` in borrowck error message

Kinda fixes #99426 but I guess that really might be better staying open to see if we could make it suggest `as_mut` in a structured way. Not sure how to change borrowck to know that info tho.

22 months agoUse const instead of static
Chris Denton [Thu, 18 Aug 2022 18:08:49 +0000 (19:08 +0100)]
Use const instead of static

22 months agoSimplify load/store
Chris Denton [Thu, 18 Aug 2022 17:34:19 +0000 (18:34 +0100)]
Simplify load/store

22 months agoSuggest the right help message for as_ref
yukang [Sat, 20 Aug 2022 01:43:37 +0000 (09:43 +0800)]
Suggest the right help message for as_ref

22 months agoAuto merge of #100740 - Dylan-DPC:rollup-0td6yq4, r=Dylan-DPC
bors [Fri, 19 Aug 2022 18:45:41 +0000 (18:45 +0000)]
Auto merge of #100740 - Dylan-DPC:rollup-0td6yq4, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #99576 (Do not allow `Drop` impl on foreign fundamental types)
 - #100081 (never consider unsafe blocks unused if they would be required with deny(unsafe_op_in_unsafe_fn))
 - #100208 (make NOP dyn casts not require anything about the vtable)
 - #100494 (Cleanup rustdoc themes)
 - #100522 (Only check the `DefId` for the recursion check in MIR inliner.)
 - #100592 (Manually implement Debug for ImportKind.)
 - #100598 (Don't fix builtin index when Where clause is found)
 - #100721 (Add diagnostics lints to `rustc_type_ir` module)
 - #100731 (rustdoc: count deref and non-deref as same set of used methods)

Failed merges:

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

22 months agotriagebot: Autolabel `A-rustdoc-json`
Nixon Enraght-Moony [Fri, 19 Aug 2022 16:31:32 +0000 (17:31 +0100)]
triagebot: Autolabel `A-rustdoc-json`

22 months agoFix comment typo
Thom Chiovoloni [Fri, 19 Aug 2022 15:45:21 +0000 (08:45 -0700)]
Fix comment typo

22 months agoAuto merge of #100209 - cjgillot:source-file-index, r=estebank
bors [Fri, 19 Aug 2022 15:31:25 +0000 (15:31 +0000)]
Auto merge of #100209 - cjgillot:source-file-index, r=estebank

Lazily decode SourceFile from metadata

Currently, source files from foreign crates are decoded up-front from metadata.
Spans from those crates were matched with the corresponding source using binary search among those files.

This PR changes the strategy by matching spans to files during encoding. This allows to decode source files on-demand, instead of up-front. The on-disk format for spans becomes: `<tag> <position from start of file> <length> <file index> <crate (if foreign file)>`.

22 months agoRollup merge of #100731 - notriddle:notriddle/deref-methods-1, r=jsha
Dylan DPC [Fri, 19 Aug 2022 06:56:47 +0000 (12:26 +0530)]
Rollup merge of #100731 - notriddle:notriddle/deref-methods-1, r=jsha

rustdoc: count deref and non-deref as same set of used methods

Fixes #100679

22 months agoRollup merge of #100721 - JhonnyBillM:enable-diag-lint-in-type-ir, r=compiler-errors
Dylan DPC [Fri, 19 Aug 2022 06:56:46 +0000 (12:26 +0530)]
Rollup merge of #100721 - JhonnyBillM:enable-diag-lint-in-type-ir, r=compiler-errors

Add diagnostics lints to `rustc_type_ir` module

Module is complete. It doesn’t have any diagnostics.

22 months agoRollup merge of #100598 - ouz-a:91633, r=compiler-errors
Dylan DPC [Fri, 19 Aug 2022 06:56:45 +0000 (12:26 +0530)]
Rollup merge of #100598 - ouz-a:91633, r=compiler-errors

Don't fix builtin index when Where clause is found

Where clause shadows blanket impl for `Index` which causes normalization to not occur, which causes ICE to happen when we typeck.

r? `@compiler-errors`

Fixes #91633

22 months agoRollup merge of #100592 - cjgillot:debug-import-kind, r=TaKO8Ki
Dylan DPC [Fri, 19 Aug 2022 06:56:44 +0000 (12:26 +0530)]
Rollup merge of #100592 - cjgillot:debug-import-kind, r=TaKO8Ki

Manually implement Debug for ImportKind.

This avoids crashing due to an infinite loop when running with `RUSTC_LOG=rustc_resolve`.

22 months agoRollup merge of #100522 - cjgillot:inline-polymorphic-recursion, r=tmiasko
Dylan DPC [Fri, 19 Aug 2022 06:56:43 +0000 (12:26 +0530)]
Rollup merge of #100522 - cjgillot:inline-polymorphic-recursion, r=tmiasko

Only check the `DefId` for the recursion check in MIR inliner.

The current history check compares `Instance`s, so it cannot detect cases of polymorphic recursion where `Substs` change.
This PR makes it so we only compare `DefId`s, ignoring any change in `Substs`.

According to https://github.com/rust-lang/rust/pull/100522#issuecomment-1214769757, in practice only very few inlining decisions change.

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

22 months agoRollup merge of #100494 - GuillaumeGomez:cleanup-themes, r=jsha
Dylan DPC [Fri, 19 Aug 2022 06:56:42 +0000 (12:26 +0530)]
Rollup merge of #100494 - GuillaumeGomez:cleanup-themes, r=jsha

Cleanup rustdoc themes

This PR continues our work to simplify the rustdoc themes by relying more on CSS variables. Interestingly enough, this time it allowed me to realize that we were having a lot of different colors for borders even though the difference is unnoticeable. I used this opportunity to unify them.

The live demo is [here](https://rustdoc.crud.net/imperio/cleanup-themes/std/index.html).

r? `@jsha`

22 months agoRollup merge of #100208 - RalfJung:dyn-upcast-nop, r=petrochenkov
Dylan DPC [Fri, 19 Aug 2022 06:56:41 +0000 (12:26 +0530)]
Rollup merge of #100208 - RalfJung:dyn-upcast-nop, r=petrochenkov

make NOP dyn casts not require anything about the vtable

As suggested [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/dyn-upcasting.20stabilization/near/292151439). This matches what the codegen backends already do, and what Miri did do until https://github.com/rust-lang/rust/pull/99420 when I made it super extra paranoid.

22 months agoRollup merge of #100081 - RalfJung:unused-unsafe-in-unsafe-fn, r=jackh726
Dylan DPC [Fri, 19 Aug 2022 06:56:40 +0000 (12:26 +0530)]
Rollup merge of #100081 - RalfJung:unused-unsafe-in-unsafe-fn, r=jackh726

never consider unsafe blocks unused if they would be required with deny(unsafe_op_in_unsafe_fn)

Judging from https://github.com/rust-lang/rust/issues/71668#issuecomment-1200317370 the consensus nowadays seems to be that we should never consider an unsafe block unused if it was required with `deny(unsafe_op_in_unsafe_fn)`, no matter whether that lint is actually enabled or not. So let's adjust rustc accordingly.

The first commit does the change, the 2nd does some cleanup.

22 months agoRollup merge of #99576 - compiler-errors:foreign-fundamental-drop-is-bad, r=TaKO8Ki
Dylan DPC [Fri, 19 Aug 2022 06:56:38 +0000 (12:26 +0530)]
Rollup merge of #99576 - compiler-errors:foreign-fundamental-drop-is-bad, r=TaKO8Ki

Do not allow `Drop` impl on foreign fundamental types

`Drop` should not be implemented on `Pin<T>` even if `T` is local.

This does not trigger regular orphan rules is because `Pin` is `#[fundamental]`... but we don't allow specialized `Drop` impls anyways, so these rules are not sufficient to prevent this impl on stable. Let's just choose even stricter rules, since we shouldn't be implementing `Drop` on a foreign ADT ever.

Fixes #99575

22 months agoAuto merge of #99541 - timvermeulen:flatten_cleanup, r=the8472
bors [Fri, 19 Aug 2022 02:34:30 +0000 (02:34 +0000)]
Auto merge of #99541 - timvermeulen:flatten_cleanup, r=the8472

Refactor iteration logic in the `Flatten` and `FlatMap` iterators

The `Flatten` and `FlatMap` iterators both delegate to `FlattenCompat`:
```rust
struct FlattenCompat<I, U> {
    iter: Fuse<I>,
    frontiter: Option<U>,
    backiter: Option<U>,
}
```
Every individual iterator method that `FlattenCompat` implements needs to carefully manage this state, checking whether the `frontiter` and `backiter` are present, and storing the current iterator appropriately if iteration is aborted. This has led to methods such as `next`, `advance_by`, and `try_fold` all having similar code for managing the iterator's state.

I have extracted this common logic of iterating the inner iterators with the option to exit early into a `iter_try_fold` method:
```rust
impl<I, U> FlattenCompat<I, U>
where
    I: Iterator<Item: IntoIterator<IntoIter = U>>,
{
    fn iter_try_fold<Acc, Fold, R>(&mut self, acc: Acc, fold: Fold) -> R
    where
        Fold: FnMut(Acc, &mut U) -> R,
        R: Try<Output = Acc>,
    { ... }
}
```
It passes each of the inner iterators to the given function as long as it keep succeeding. It takes care of managing `FlattenCompat`'s state, so that the actual `Iterator` methods don't need to. The resulting code that makes use of this abstraction is much more straightforward:
```rust
fn next(&mut self) -> Option<U::Item> {
    #[inline]
    fn next<U: Iterator>((): (), iter: &mut U) -> ControlFlow<U::Item> {
        match iter.next() {
            None => ControlFlow::CONTINUE,
            Some(x) => ControlFlow::Break(x),
        }
    }

    self.iter_try_fold((), next).break_value()
}
```
Note that despite being implemented in terms of `iter_try_fold`, `next` is still able to benefit from `U`'s `next` method. It therefore does not take the performance hit that implementing `next` directly in terms of `Self::try_fold` causes (in some benchmarks).

This PR also adds `iter_try_rfold` which captures the shared logic of `try_rfold` and `advance_back_by`, as well as `iter_fold` and `iter_rfold` for folding without early exits (used by `fold`, `rfold`, `count`, and `last`).

Benchmark results:
```
                                             before                after
bench_flat_map_sum                       423,255 ns/iter      414,338 ns/iter
bench_flat_map_ref_sum                 1,942,139 ns/iter    2,216,643 ns/iter
bench_flat_map_chain_sum               1,616,840 ns/iter    1,246,445 ns/iter
bench_flat_map_chain_ref_sum           4,348,110 ns/iter    3,574,775 ns/iter
bench_flat_map_chain_option_sum          780,037 ns/iter      780,679 ns/iter
bench_flat_map_chain_option_ref_sum    2,056,458 ns/iter      834,932 ns/iter
```

I added the last two benchmarks specifically to demonstrate an extreme case where `FlatMap::next` can benefit from custom internal iteration of the outer iterator, so take it with a grain of salt. We should probably do a perf run to see if the changes to `next` are worth it in practice.

22 months agoAuto merge of #98851 - klensy:encode_symbols, r=cjgillot
bors [Thu, 18 Aug 2022 23:53:22 +0000 (23:53 +0000)]
Auto merge of #98851 - klensy:encode_symbols, r=cjgillot

rustc_metadata: dedupe strings to prevent multiple copies in rmeta/query cache blow file size

r? `@cjgillot`

Encodes strings in rmeta/query cache so duplicated ones will be encoded as offsets to first strings, reducing file size.

22 months agorustdoc: count deref and non-deref as same set of used methods
Michael Howell [Thu, 18 Aug 2022 22:13:28 +0000 (15:13 -0700)]
rustdoc: count deref and non-deref as same set of used methods

22 months agoAvoid zeroing a 1kb stack buffer on every call to `std::sys::windows::fill_utf16_buf`
Thom Chiovoloni [Thu, 18 Aug 2022 21:51:10 +0000 (14:51 -0700)]
Avoid zeroing a 1kb stack buffer on every call to `std::sys::windows::fill_utf16_buf`

22 months agoadded improved diagnostic for a function defined with an invalid qualifier
akabinds [Thu, 18 Aug 2022 21:14:04 +0000 (16:14 -0500)]
added improved diagnostic for a function defined with an invalid qualifier

22 months agoAuto merge of #98807 - cbeuw:derived-obligation, r=compiler-errors
bors [Thu, 18 Aug 2022 21:12:05 +0000 (21:12 +0000)]
Auto merge of #98807 - cbeuw:derived-obligation, r=compiler-errors

Reword "Required because of the requirements on the impl of ..."

Rephrases the awkward "Required because of the requirements on the impl of `{trait}` for `{type}`" to "required for `{type}` to implement `{trait}`"

22 months agoReword "Required because of the requirements on the impl of ..."
Andy Wang [Mon, 15 Aug 2022 20:31:37 +0000 (21:31 +0100)]
Reword "Required because of the requirements on the impl of ..."

22 months agoAdd diagnostic translation lints to crates that don't emit them
5225225 [Thu, 18 Aug 2022 18:27:29 +0000 (19:27 +0100)]
Add diagnostic translation lints to crates that don't emit them

22 months agoADD - diagnostic lints to type_ir
Jhonny Bill Mena [Thu, 18 Aug 2022 17:33:03 +0000 (13:33 -0400)]
ADD - diagnostic lints to type_ir

Module is completed because it doesn’t have any diagnostics

22 months agoAuto merge of #99860 - oli-obk:revert_97346, r=pnkfelix
bors [Thu, 18 Aug 2022 15:41:30 +0000 (15:41 +0000)]
Auto merge of #99860 - oli-obk:revert_97346, r=pnkfelix

Revert "Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, …

…r=oli-obk"

This reverts commit c703d11dccb4a895c7aead3b2fcd8cea8c483184, reversing
changes made to 64eb9ab869bc3f9ef3645302fbf22e706eea16cf.

it didn't apply cleanly, so now it works the same for RPIT and for TAIT instead of just working for RPIT, but we should keep those in sync anyway. It also exposed a TAIT bug (see the feature gated test that now ICEs).

r? `@pnkfelix`

fixes #99536

22 months agoRemove unused CSS rule
Guillaume Gomez [Thu, 18 Aug 2022 13:56:25 +0000 (15:56 +0200)]
Remove unused CSS rule

22 months agoUpdate existing rustdoc-gui tests and add a new one
Guillaume Gomez [Sat, 13 Aug 2022 13:47:19 +0000 (15:47 +0200)]
Update existing rustdoc-gui tests and add a new one

22 months agoSimplify rustdoc themes by relying more on CSS variables
Guillaume Gomez [Sat, 13 Aug 2022 12:00:23 +0000 (14:00 +0200)]
Simplify rustdoc themes by relying more on CSS variables

22 months agoimport license changes
Pietro Albini [Thu, 18 Aug 2022 14:03:55 +0000 (16:03 +0200)]
import license changes

22 months agocleanup .reuse/dep5
Pietro Albini [Thu, 18 Aug 2022 14:03:26 +0000 (16:03 +0200)]
cleanup .reuse/dep5

22 months agoimport the debian/copyright file from debian
Pietro Albini [Thu, 18 Aug 2022 13:32:45 +0000 (15:32 +0200)]
import the debian/copyright file from debian

Co-Authored-By: Angus Lees <gus@inodes.org>
Co-Authored-By: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Co-Authored-By: Hiroaki Nakamura <hnakamur@gmail.com>
Co-Authored-By: Jordan Justen <jljusten@gmail.com>
Co-Authored-By: Luca Bruno <lucab@debian.org>
Co-Authored-By: Sylvestre Ledru <sylvestre@debian.org>
Co-Authored-By: Ximin Luo <infinity0@debian.org>
22 months agoAuto merge of #100682 - RalfJung:miri, r=RalfJung
bors [Thu, 18 Aug 2022 12:56:21 +0000 (12:56 +0000)]
Auto merge of #100682 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/100614
r? `@ghost`

22 months agoADD - ExpectedUsedSymbol diagnostic to port used() diagnostic
Jhonny Bill Mena [Thu, 18 Aug 2022 12:14:21 +0000 (08:14 -0400)]
ADD - ExpectedUsedSymbol diagnostic to port used() diagnostic

22 months agoAuto merge of #98655 - nnethercote:dont-derive-PartialEq-ne, r=dtolnay
bors [Thu, 18 Aug 2022 10:11:11 +0000 (10:11 +0000)]
Auto merge of #98655 - nnethercote:dont-derive-PartialEq-ne, r=dtolnay

Don't derive `PartialEq::ne`.

Currently we skip deriving `PartialEq::ne` for C-like (fieldless) enums
and empty structs, thus reyling on the default `ne`. This behaviour is
unnecessarily conservative, because the `PartialEq` docs say this:

> Implementations must ensure that eq and ne are consistent with each other:
>
> `a != b` if and only if `!(a == b)` (ensured by the default
> implementation).

This means that the default implementation (`!(a == b)`) is always good
enough. So this commit changes things such that `ne` is never derived.

The motivation for this change is that not deriving `ne` reduces compile
times and binary sizes.

Observable behaviour may change if a user has defined a type `A` with an
inconsistent `PartialEq` and then defines a type `B` that contains an
`A` and also derives `PartialEq`. Such code is already buggy and
preserving bug-for-bug compatibility isn't necessary.

Two side-effects of the change:
- There is only one error message produced for types where `PartialEq`
  cannot be derived, instead of two.
- For coverage reports, some warnings about generated `ne` methods not
  being executed have disappeared.

Both side-effects seem fine, and possibly preferable.

22 months agoAuto merge of #100708 - matthiaskrgr:rollup-vl0olnj, r=matthiaskrgr
bors [Thu, 18 Aug 2022 07:09:06 +0000 (07:09 +0000)]
Auto merge of #100708 - matthiaskrgr:rollup-vl0olnj, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #97962 (Make must_not_suspend lint see through references when drop tracking is enabled)
 - #99966 (avoid assertion failures in try_to_scalar_int)
 - #100637 (Improving Fuchsia rustc support documentation)
 - #100643 (Point at a type parameter shadowing another type)
 - #100651 (Migrations for rustc_expand transcribe.rs)
 - #100669 (Attribute cleanups)
 - #100670 (Fix documentation of rustc_parse::parser::Parser::parse_stmt_without_recovery)
 - #100674 (Migrate lint reports in typeck::check_unused to LintDiagnostic)
 - #100688 (`ty::Error` does not match other types for region constraints)

Failed merges:

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

22 months agoWindows: Load synch functions together
Chris Denton [Thu, 18 Aug 2022 06:34:25 +0000 (07:34 +0100)]
Windows: Load synch functions together

Attempt to load all the required sync functions and fail if any one of them fails.

This reintroduces a macro for optional loading of functions but keeps it separate from the fallback macro rather than having that do two different jobs.

22 months agoRollup merge of #100688 - compiler-errors:issue-100684, r=wesleywiser
Matthias Krüger [Thu, 18 Aug 2022 03:10:51 +0000 (05:10 +0200)]
Rollup merge of #100688 - compiler-errors:issue-100684, r=wesleywiser

`ty::Error` does not match other types for region constraints

Fixes #100684

22 months agoRollup merge of #100674 - PragmaTwice:mig-typeck-unused-crate-diag, r=davidtwco
Matthias Krüger [Thu, 18 Aug 2022 03:10:50 +0000 (05:10 +0200)]
Rollup merge of #100674 - PragmaTwice:mig-typeck-unused-crate-diag, r=davidtwco

Migrate lint reports in typeck::check_unused to LintDiagnostic

In this PR, I migrate two lint reports in `typeck::check_unused` by `LintDiagnostic`, all of which is about extern crates.

```@rustbot``` label +A-translation
r? rust-lang/diagnostics

22 months agoRollup merge of #100670 - Xiretza:parser-stmt-force-collect-docs, r=davidtwco
Matthias Krüger [Thu, 18 Aug 2022 03:10:49 +0000 (05:10 +0200)]
Rollup merge of #100670 - Xiretza:parser-stmt-force-collect-docs, r=davidtwco

Fix documentation of rustc_parse::parser::Parser::parse_stmt_without_recovery

Something seems to have gotten out of sync during the creation of #81177, where both the argument and comment were introduced.

22 months agoRollup merge of #100669 - nnethercote:attribute-cleanups, r=spastorino
Matthias Krüger [Thu, 18 Aug 2022 03:10:48 +0000 (05:10 +0200)]
Rollup merge of #100669 - nnethercote:attribute-cleanups, r=spastorino

Attribute cleanups

r? `@ghost`

22 months agoRollup merge of #100651 - nidnogg:diagnostics_migration_expand_transcribe, r=davidtwco
Matthias Krüger [Thu, 18 Aug 2022 03:10:47 +0000 (05:10 +0200)]
Rollup merge of #100651 - nidnogg:diagnostics_migration_expand_transcribe, r=davidtwco

Migrations for rustc_expand transcribe.rs

This PR includes some migrations to the new diagnostics API for the `rustc_expand` module.
r? ```@davidtwco```

22 months agoRollup merge of #100643 - TaKO8Ki:point-at-type-parameter-shadowing-another-type...
Matthias Krüger [Thu, 18 Aug 2022 03:10:46 +0000 (05:10 +0200)]
Rollup merge of #100643 - TaKO8Ki:point-at-type-parameter-shadowing-another-type, r=estebank

Point at a type parameter shadowing another type

This patch fixes a part of #97459.

22 months agoRollup merge of #100637 - andrewpollack:fuchsia-docs-adjustments, r=tmandry
Matthias Krüger [Thu, 18 Aug 2022 03:10:45 +0000 (05:10 +0200)]
Rollup merge of #100637 - andrewpollack:fuchsia-docs-adjustments, r=tmandry

Improving Fuchsia rustc support documentation

* Adjusting `package/meta/package` to fit current schema
* Adding repository server step
* Adjusting step to give default repository
* Adding "recreate" step for easier step following

22 months agoRollup merge of #99966 - RalfJung:try-dont-panic, r=lcnr
Matthias Krüger [Thu, 18 Aug 2022 03:10:42 +0000 (05:10 +0200)]
Rollup merge of #99966 - RalfJung:try-dont-panic, r=lcnr

avoid assertion failures in try_to_scalar_int

Given that this is called `try_to_scalar_int`, we probably shouldn't `assert_int` here. Similarly `try_to_bits` also doesn't `assert!` that the size is correct.

Also add some `track_caller` for debugging, while we are at it.

r? ```@oli-obk```

22 months agoRollup merge of #97962 - eholk:drop-tracking-must-not-suspend, r=cjgillot
Matthias Krüger [Thu, 18 Aug 2022 03:10:41 +0000 (05:10 +0200)]
Rollup merge of #97962 - eholk:drop-tracking-must-not-suspend, r=cjgillot

Make must_not_suspend lint see through references when drop tracking is enabled

See #97333.

With drop tracking enabled, sometimes values that were previously linted are now considered dropped and not linted. This change makes must_not_suspend traverse through references to still catch these values.

Unfortunately, this leads to duplicate warnings in some cases (e.g. [dedup.rs](https://cs.github.com/rust-lang/rust/blob/9a74608543d499bcc7dd505e195e8bfab9447315/src/test/ui/lint/must_not_suspend/dedup.rs#L4)), so we only use the new behavior when drop tracking is enabled.

cc ``@guswynn``

22 months agoAdd LLVM15-specific codegen test for `try`/`?`s that now optimize away
Scott McMurray [Wed, 17 Aug 2022 19:09:59 +0000 (12:09 -0700)]
Add LLVM15-specific codegen test for `try`/`?`s that now optimize away

These still generated a bunch of code back in Rust 1.63 (<https://rust.godbolt.org/z/z31P8h6rz>), but with LLVM 15 merged they no longer do :tada:

22 months agoMake same_type_modulo_infer a proper TypeRelation
Michael Goulet [Wed, 17 Aug 2022 19:02:55 +0000 (19:02 +0000)]
Make same_type_modulo_infer a proper TypeRelation

22 months agoIgnore substs when checking inlining history.
Camille GILLOT [Sun, 14 Aug 2022 09:28:28 +0000 (11:28 +0200)]
Ignore substs when checking inlining history.

22 months agoty::Error does not match other types for region constraints
Michael Goulet [Wed, 17 Aug 2022 17:23:52 +0000 (17:23 +0000)]
ty::Error does not match other types for region constraints

22 months agoMigrate "invalid variable declaration" errors to SessionDiagnostic
Xiretza [Wed, 17 Aug 2022 08:06:24 +0000 (10:06 +0200)]
Migrate "invalid variable declaration" errors to SessionDiagnostic

22 months agoHotfix for duplicated slug name on VarStillRepeating struct
nidnogg [Wed, 17 Aug 2022 16:13:07 +0000 (13:13 -0300)]
Hotfix for duplicated slug name on VarStillRepeating struct

22 months agoAuto merge of #100677 - matthiaskrgr:rollup-au41ho1, r=matthiaskrgr
bors [Wed, 17 Aug 2022 14:49:05 +0000 (14:49 +0000)]
Auto merge of #100677 - matthiaskrgr:rollup-au41ho1, r=matthiaskrgr

Rollup of 15 pull requests

Successful merges:

 - #99474 (Rustdoc json tests: New `@hasexact` test command)
 - #99972 (interpret: only consider 1-ZST when searching for receiver)
 - #100018 (Clean up `LitKind`)
 - #100379 (triagebot: add translation-related mention groups)
 - #100389 (Do not report cycle error when inferring return type for suggestion)
 - #100489 (`is_knowable` use `Result` instead of `Option`)
 - #100532 (unwind: don't build dependency when building for Miri)
 - #100608 (needless separation of impl blocks)
 - #100621 (Pass +atomics-32 feature for {arm,thumb}v4t-none-eabi)
 - #100646 (Migrate emoji identifier diagnostics to `SessionDiagnostic` in rustc_interface)
 - #100652 (Remove deferred sized checks (make them eager))
 - #100655 (Update books)
 - #100656 (Update cargo)
 - #100660 (Fixed a few documentation errors)
 - #100661 (Fixed a few documentation errors)

Failed merges:

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

22 months agoMoved structs to rustc_expand::errors, added several more migrations, fixed slug...
nidnogg [Wed, 17 Aug 2022 14:20:37 +0000 (11:20 -0300)]
Moved structs to rustc_expand::errors, added several more migrations, fixed slug name

22 months agoMoved structs to rustc_expand::errors, added several more migrations, fixed slug...
nidnogg [Wed, 17 Aug 2022 14:18:19 +0000 (11:18 -0300)]
Moved structs to rustc_expand::errors, added several more migrations, fixed slug name

22 months agoremove #[primary_span]
PragmaTwice [Wed, 17 Aug 2022 14:08:06 +0000 (22:08 +0800)]
remove #[primary_span]

22 months agoupdate Miri
Ralf Jung [Wed, 17 Aug 2022 13:09:33 +0000 (09:09 -0400)]
update Miri

22 months agofix test file
PragmaTwice [Wed, 17 Aug 2022 13:05:21 +0000 (21:05 +0800)]
fix test file

22 months agouse `suggestion_short` in `LintDiagnostic`
Twice [Wed, 17 Aug 2022 12:45:18 +0000 (20:45 +0800)]
use `suggestion_short` in `LintDiagnostic`

Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
22 months agoRollup merge of #100661 - PunkyMunky64:patch-1, r=thomcc
Matthias Krüger [Wed, 17 Aug 2022 10:33:02 +0000 (12:33 +0200)]
Rollup merge of #100661 - PunkyMunky64:patch-1, r=thomcc

Fixed a few documentation errors

Quick pull request; IEEE-754, not IEEE-745. May save someone a quick second some time.

22 months agoRollup merge of #100660 - PunkyMunky64:patch-2, r=thomcc
Matthias Krüger [Wed, 17 Aug 2022 10:33:01 +0000 (12:33 +0200)]
Rollup merge of #100660 - PunkyMunky64:patch-2, r=thomcc

Fixed a few documentation errors

Quick pull request; IEEE-754, not IEEE-745. May save someone a quick second some time.

22 months agoRollup merge of #100656 - ehuss:update-cargo, r=ehuss
Matthias Krüger [Wed, 17 Aug 2022 10:33:00 +0000 (12:33 +0200)]
Rollup merge of #100656 - ehuss:update-cargo, r=ehuss

Update cargo

3 commits in efd4ca3dc0b89929dc8c5f5c023d25978d76cb61..9809f8ff33c2b998919fd0432c626f0f7323697a
2022-08-12 01:28:28 +0000 to 2022-08-16 22:10:06 +0000
- Improve error message for an array value in the manifest (rust-lang/cargo#10944)
- Fix file locking being not supported on Android raising an error (rust-lang/cargo#10975)
- Bump to 0.66.0, update changelog (rust-lang/cargo#10983)

22 months agoRollup merge of #100655 - ehuss:update-books, r=ehuss
Matthias Krüger [Wed, 17 Aug 2022 10:32:58 +0000 (12:32 +0200)]
Rollup merge of #100655 - ehuss:update-books, r=ehuss

Update books

## nomicon

2 commits in 8d1e4dccf71114ff56f328f671f2026d8e6b62a2..8e6aa3448515a0654e347b5e2510f1d4bc4d5a64
2022-07-18 18:12:35 -0400 to 2022-08-15 15:36:13 -0700
- Update the `repr(transparent)` section to reflect the current state (rust-lang/nomicon#376)
- [typo] typo on limits of lifetime chapter (rust-lang/nomicon#377)

## reference

5 commits in f3d3953bf3b158d596c96d55ce5366f9f3f972e9..e647eb102890e8927f488bea12672b079eff8d9d
2022-08-01 17:17:37 -0700 to 2022-08-16 11:35:27 -0700
- #[non_exhaustive] on variant blocks cross-crate as casts (rust-lang/reference#1249)
- Revert let chains reference docs (rust-lang/reference#1251)
- Update subtyping.md (rust-lang/reference#1240)
- a fix about .await (rust-lang/reference#1245)
- Be less specific about the representation of `+bundle` (rust-lang/reference#1246)

## book

2 commits in 36383b4da21dbd0a0781473bc8ad7ef0ed1b6751..42ca0ef484fcc8437a0682cee23abe4b7c407d52
2022-07-19 21:03:20 -0400 to 2022-08-12 21:52:02 -0400
- Missing period at end of sentence
- Fix grammar in ch06-02

## rust-by-example

8 commits in ee342dc91e1ba1bb1e1f1318f84bbe3bfac04798..03301f8ae55fa6f20f7ea152a517598e6db2cdb7
2022-07-27 11:06:36 -0300 to 2022-08-14 08:51:44 -0300
- Update print.md (rust-lang/rust-by-example#1597)
- in Meta, replace 'playpen' with 'playground' (rust-lang/rust-by-example#1596)
- Update doc comment to link to name field without compilation warning (rust-lang/rust-by-example#1595)
- add line numbers for playpen fixes rust-lang/rust-by-example#1593 (rust-lang/rust-by-example#1594)
- clarify that the map-reduce example relies on static data (rust-lang/rust-by-example#1592)
- Update flow_control.md (rust-lang/rust-by-example#1591)
- Remove duplicate line in the hello/print.md file (rust-lang/rust-by-example#1590)
- Make rust editable in chapter on defaults (rust-lang/rust-by-example#1589)

## rustc-dev-guide

15 commits in 04f3cf0bb2f5a6ee2bfc4b1a6a6cd8c11d1c5531..d3daa1f28e169087becbc5e2b49ac91ca0405a44
2022-07-31 07:46:57 +0200 to 2022-08-13 10:00:38 +0900
- Improve the "Diagnostic items" chapter (rust-lang/rustc-dev-guide#1427)
- date-check: crates-io
- fix/improve compiler-debugging
- Update src/compiler-debugging.md
- add gdb tips for symbol-mangling-version
- move references down to avoid clutter (rust-lang/rustc-dev-guide#1420)
- update date-check format on github issue (rust-lang/rustc-dev-guide#1416)
- Fix legend colors in dark mode
- Add color for downloaded nodes
- Add colors to diagram
- Add bootstrapping diagram
- date-check: rustc_codegen_ssa is still alive
- note is now too old to be relevant
- date-check: be more strict
- make date-check more lightweight (rust-lang/rustc-dev-guide#1394)

## edition-guide

3 commits in c55611dd6c58bdeb52423b5c52fd0f3c93615ba8..6038be9d37d7251c966b486154af621d1794d7af
2022-02-21 14:21:39 +0100 to 2022-08-15 08:12:42 -0700
- use title "The Rust Edition Guide" everywhere (rust-lang/edition-guide#280)
- "Creating a new project": add example using 'cargo new --edition YEAR' (rust-lang/edition-guide#279)
- fixes rust-lang/edition-guide#277: mention rust 1.0 release month and year (rust-lang/edition-guide#278)

22 months agoRollup merge of #100652 - compiler-errors:no-defer-sized-checks, r=TaKO8Ki
Matthias Krüger [Wed, 17 Aug 2022 10:32:57 +0000 (12:32 +0200)]
Rollup merge of #100652 - compiler-errors:no-defer-sized-checks, r=TaKO8Ki

Remove deferred sized checks (make them eager)

Improves diagnostics spans... this doesn't seem to be the case anymore:

```rust
// Some additional `Sized` obligations badly affect type inference.
// These obligations are added in a later stage of typeck.
pub(super) deferred_sized_obligations:
        RefCell<Vec<(Ty<'tcx>, Span, traits::ObligationCauseCode<'tcx>)>>,
```

22 months agoRollup merge of #100646 - finalchild:emoji-diag, r=compiler-errors
Matthias Krüger [Wed, 17 Aug 2022 10:32:56 +0000 (12:32 +0200)]
Rollup merge of #100646 - finalchild:emoji-diag, r=compiler-errors

Migrate emoji identifier diagnostics to `SessionDiagnostic` in rustc_interface

* Migrate emoji identifier diagnostics to `interface_ferris_identifier` and `interface_emoji_identifier`.

This is my first PR! I'm learning how to migrate these diagnostics. Thanks in advance.

r? rust-lang/diagnostics

22 months agoRollup merge of #100621 - taiki-e:armv4t-atomics-32, r=cuviper
Matthias Krüger [Wed, 17 Aug 2022 10:32:55 +0000 (12:32 +0200)]
Rollup merge of #100621 - taiki-e:armv4t-atomics-32, r=cuviper

Pass +atomics-32 feature for {arm,thumb}v4t-none-eabi

Similar to https://github.com/rust-lang/rust/commit/89582e8193e0da64a54c4ffae7f9fa64ed9fe2af, but for ARMv4t.
Pre-v6 ARM target does not have atomic CAS, except for Linux and Android where atomic CAS is provided by compiler-builtins. So, there is a similar issue as thumbv6m.

I have confirmed that enabling the `atomics-32` target feature fixes the problem in the project affected by this issue. (https://github.com/taiki-e/portable-atomic/pull/28#discussion_r946604136)

Closes #100619

r? ``@nikic``
cc ``@Lokathor``

22 months agoRollup merge of #100608 - tshepang:needless-separation, r=TaKO8Ki
Matthias Krüger [Wed, 17 Aug 2022 10:32:54 +0000 (12:32 +0200)]
Rollup merge of #100608 - tshepang:needless-separation, r=TaKO8Ki

needless separation of impl blocks

22 months agoRollup merge of #100532 - RalfJung:unwind-miri, r=Mark-Simulacrum
Matthias Krüger [Wed, 17 Aug 2022 10:32:53 +0000 (12:32 +0200)]
Rollup merge of #100532 - RalfJung:unwind-miri, r=Mark-Simulacrum

unwind: don't build dependency when building for Miri

This is basically re-submitting https://github.com/rust-lang/rust/pull/94813.

In that PR there was a suggestion to instead have bootstrap set a `RUST_CHECK` env var and use that rather than doing something Miri-specific. However, such an env var would mean that when switching between `./x.py check` and `./x.py build`, the build script gets re-run each time, which doesn't seem good. So I think for now checking for Miri probably causes fewer problems.

r? ````@Mark-Simulacrum````

22 months agoRollup merge of #100489 - lcnr:is_knowable-Result, r=davidtwco
Matthias Krüger [Wed, 17 Aug 2022 10:32:52 +0000 (12:32 +0200)]
Rollup merge of #100489 - lcnr:is_knowable-Result, r=davidtwco

`is_knowable` use `Result` instead of `Option`

22 months agoRollup merge of #100389 - compiler-errors:return-type-suggestion-cycle, r=cjgillot
Matthias Krüger [Wed, 17 Aug 2022 10:32:51 +0000 (12:32 +0200)]
Rollup merge of #100389 - compiler-errors:return-type-suggestion-cycle, r=cjgillot

Do not report cycle error when inferring return type for suggestion

The UI test is a good example of a case where this happens. The cycle is due to needing the value of the return type `-> _` to compute the variances of items in the crate, but then needing the variances of the items in the crate to do typechecking to infer what `-> _`'s real type is.

Since we're already gonna emit an error in astconv, just delay the cycle bug as an error.