]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #96432 - SparrowLii:dbg_scope, r=davidtwco
Dylan DPC [Thu, 28 Apr 2022 00:40:34 +0000 (02:40 +0200)]
Rollup merge of #96432 - SparrowLii:dbg_scope, r=davidtwco

not need `Option` for `dbg_scope`

This PR fixes a few FIXME about not using `Option` in `dbg_scope` field of `DebugScope`, during `create_function_debug_context` func in codegen parts.
Added a `BitSet<SourceScope>` parameter to `make_mir_scope` to indicate whether the `DebugScope` has been instantiated.
cc ````@eddyb````

2 years agoRollup merge of #96421 - nnethercote:less-NoDelim, r=petrochenkov
Dylan DPC [Thu, 28 Apr 2022 00:40:34 +0000 (02:40 +0200)]
Rollup merge of #96421 - nnethercote:less-NoDelim, r=petrochenkov

Less `NoDelim`

Currently there are several places where `NoDelim` (which really means "implicit delimiter" or "invisible delimiter") is used to mean "no delimiter". The name `NoDelim` is a bit misleading, and may be a cause.

This PR changes these places, e.g. by changing a `DelimToken` to `Option<DelimToken>` and then using `None` to mean "no delimiter". As a result, the *only* place where `NoDelim` values are now produced is within:
- `Delimiter::to_internal()`, when converting from `Delimiter::None`.
- `FlattenNonterminals::process_token()`, when converting `TokenKind::Interpolated`.

r? ````@petrochenkov````

2 years agoRollup merge of #96397 - AronParker:issue-96368-fix, r=dtolnay
Dylan DPC [Thu, 28 Apr 2022 00:40:33 +0000 (02:40 +0200)]
Rollup merge of #96397 - AronParker:issue-96368-fix, r=dtolnay

Make EncodeWide implement FusedIterator

[`EncodeUtf16`](https://doc.rust-lang.org/std/str/struct.EncodeUtf16.html) and [`EncodeWide`](https://doc.rust-lang.org/std/os/windows/ffi/struct.EncodeWide.html) currently serve similar purposes: They convert from UTF-8 to UTF-16 and WTF-8 to WTF-16, respectively. `EncodeUtf16` wraps a &str, whereas `EncodeWide` wraps an &OsStr.

When Iteration has concluded, these iterators wrap an empty slice, which will forever yield `None` values. Hence, `EncodeUtf16` rightfully implements `FusedIterator`. However, `EncodeWide` in contrast does not, even though it serves an almost identical purpose.

This PR attempts to fix that issue. I consider this change minor and non-controversial, hence why I have not added a RFC/FCP. Please let me know if the stability attribute is wrong or contains a wrong version number. Thanks in advance.

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

2 years agoRollup merge of #96377 - compiler-errors:infer-rustfix, r=petrochenkov
Dylan DPC [Thu, 28 Apr 2022 00:40:32 +0000 (02:40 +0200)]
Rollup merge of #96377 - compiler-errors:infer-rustfix, r=petrochenkov

make `fn() -> _ { .. }` suggestion MachineApplicable

This might not be valid, but it would be nice to promote this to `MachineApplicable` so people can use rustfix here.

Also de65fcf009d07019689cfad7f327667e390a325d is to [restore the suggestion for `issue-77179.rs`](https://github.com/rust-lang/rust/commit/de65fcf009d07019689cfad7f327667e390a325d#diff-12e43fb5d6d12ec7cb5c6b48204a18d113cf5de0e12eb71a358b639bd9aadaf0R8). (though in this case, the code in that issue still doesn't compile, so it's not marked with rustfix).

2 years agoAuto merge of #96179 - klensy:bump-deps-04-22, r=Mark-Simulacrum
bors [Wed, 27 Apr 2022 16:20:59 +0000 (16:20 +0000)]
Auto merge of #96179 - klensy:bump-deps-04-22, r=Mark-Simulacrum

Bump deps

Update few deps:

First commit: vulnerable or yanked ones:
* openssl-src 111.17.0+1.1.1m -> 111.18.0+1.1.1n vuln https://rustsec.org/advisories/RUSTSEC-2022-0014
* crossbeam-channel 0.5.2 -> 0.5.4 yanked: https://github.com/crossbeam-rs/crossbeam/pull/802 (https://github.com/crossbeam-rs/crossbeam/blob/crossbeam-channel-0.5.4/crossbeam-channel/CHANGELOG.md)
* crossbeam-utils 0.8.6 -> 0.8.8 yanked: https://github.com/crossbeam-rs/crossbeam/security/advisories/GHSA-qc84-gqf4-9926 (https://github.com/crossbeam-rs/crossbeam/blob/crossbeam-utils-0.8.8/crossbeam-utils/CHANGELOG.md)

Second commit: no notable changes, most of them touched only to remove other ones:
* Updating ammonia v3.1.3 -> v3.2.0
* Updating html5ever v0.25.1 -> v0.26.0
* Updating markup5ever v0.10.1 -> v0.11.0
* Removing markup5ever_rcdom v0.1.0
* Updating phf v0.8.0 -> v0.10.1
* Updating phf_codegen v0.8.0 -> v0.10.0
* Updating phf_generator v0.8.0 -> v0.10.0
* Updating phf_shared v0.8.0 -> v0.10.0
* Updating rand v0.8.4 -> v0.8.5
* Removing rand_hc v0.3.0
* Removing rand_pcg v0.2.1
* Updating string_cache v0.8.0 -> v0.8.3
* Updating string_cache_codegen v0.5.1 -> v0.5.2
* Removing xml5ever v0.16.1

drops markup5ever_rcdom, rand_hc, rand_pcg, xml5ever versions

* rand 0.8.4 -> 0.8.5 (https://github.com/rust-random/rand/blob/0.8.5/CHANGELOG.md#085---2021-08-20)

Third one is perf oriented:
* proc-macro2 v1.0.30 -> v1.0.37 https://github.com/dtolnay/proc-macro2/compare/1.0.30...1.0.37 (https://github.com/dtolnay/proc-macro2/releases, for example https://github.com/dtolnay/proc-macro2/releases/tag/1.0.36)
* quote v1.0.7 -> v1.0.18 https://github.com/dtolnay/quote/compare/1.0.7...1.0.18 (https://github.com/dtolnay/quote/releases) multiple perf improvements: https://github.com/dtolnay/quote/releases/tag/1.0.16, https://github.com/dtolnay/quote/releases/tag/1.0.14, https://github.com/dtolnay/quote/releases/tag/1.0.11
* syn v1.0.80 -> v1.0.91 https://github.com/dtolnay/syn/compare/1.0.80...1.0.91 (https://github.com/dtolnay/syn/releases): didn't find good examples, but given, that there exist private api across `proc-macro2`, `quote` by the same author, *i think* it may take advantage of it.

2 years agoAuto merge of #95170 - jyn514:ci-llvm, r=Mark-Simulacrum
bors [Wed, 27 Apr 2022 13:27:22 +0000 (13:27 +0000)]
Auto merge of #95170 - jyn514:ci-llvm, r=Mark-Simulacrum

Move `download-ci-llvm` out of bootstrap.py

This is ready for review. It has been tested on Windows, Linux, and NixOS.

The second commit ports the changes from https://github.com/rust-lang/rust/pull/95234 to Rust; I can remove it if desired.

Helps with https://github.com/rust-lang/rust/issues/94829.

As a follow-up, this makes it possible to avoid downloading llvm until it's needed for building `rustc_llvm`; it would be nice to do that, but it shouldn't go in the first draft. It might also be possible to avoid requiring python until tests run (currently there's a check in `sanity.rs`), but I haven't looked too much into that.

`@rustbot` label +A-rustbuild

2 years agoAuto merge of #96371 - c410-f3r:z-errors, r=petrochenkov
bors [Wed, 27 Apr 2022 10:46:32 +0000 (10:46 +0000)]
Auto merge of #96371 - c410-f3r:z-errors, r=petrochenkov

Move some tests to more reasonable places

cc https://github.com/rust-lang/rust/issues/73494
r? `@petrochenkov`

2 years agoAuto merge of #96195 - sunfishcode:sunfishcode/handle-or-error-type, r=joshtriplett
bors [Wed, 27 Apr 2022 03:42:59 +0000 (03:42 +0000)]
Auto merge of #96195 - sunfishcode:sunfishcode/handle-or-error-type, r=joshtriplett

 Define a dedicated error type for `HandleOrNull` and `HandleOrInvalid`.

Define `NullHandleError` and `InvalidHandleError` types, that implement std::error::Error, and use them as the error types in `HandleOrNull` and `HandleOrInvalid`,

This addresses [this concern](https://github.com/rust-lang/rust/issues/87074#issuecomment-1080031167).

This is the same as #95387.

r? `@joshtriplett`

2 years agoMove some tests to more reasonable places
Caio [Wed, 27 Apr 2022 02:38:04 +0000 (23:38 -0300)]
Move some tests to more reasonable places

2 years agoTAITs are suggestable
Michael Goulet [Mon, 25 Apr 2022 03:41:37 +0000 (20:41 -0700)]
TAITs are suggestable

2 years agomake `fn() -> _ {}` suggestion MachineApplicable
Michael Goulet [Mon, 25 Apr 2022 03:11:51 +0000 (20:11 -0700)]
make `fn() -> _ {}` suggestion MachineApplicable

2 years agoAuto merge of #96459 - Dylan-DPC:rollup-de6ud9d, r=Dylan-DPC
bors [Wed, 27 Apr 2022 01:01:58 +0000 (01:01 +0000)]
Auto merge of #96459 - Dylan-DPC:rollup-de6ud9d, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #92569 (Improve Error Messaging for Unconstructed Structs and Enum Variants in Generic Contexts)
 - #96370 (Cleanup `report_method_error` a bit)
 - #96383 (Fix erased region escaping into wfcheck due to #95395)
 - #96385 (Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL)
 - #96410 (rustdoc: do not write `{{root}}` in `pub use ::foo` docs)
 - #96430 (Fix handling of `!` in rustdoc search)

Failed merges:

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

2 years agoRollup merge of #96430 - GuillaumeGomez:search-exclamation, r=notriddle
Dylan DPC [Wed, 27 Apr 2022 00:47:12 +0000 (02:47 +0200)]
Rollup merge of #96430 - GuillaumeGomez:search-exclamation, r=notriddle

Fix handling of `!` in rustdoc search

Fixes #96399.

I also updated the eBNF.

cc `@jsha`
r? `@notriddle`

2 years agoRollup merge of #96410 - notriddle:notriddle/issue-95873, r=GuillaumeGomez
Dylan DPC [Wed, 27 Apr 2022 00:47:11 +0000 (02:47 +0200)]
Rollup merge of #96410 - notriddle:notriddle/issue-95873, r=GuillaumeGomez

rustdoc: do not write `{{root}}` in `pub use ::foo` docs

Fixes #95873

2 years agoRollup merge of #96385 - marmeladema:nll-fix-trait-lifetime-bound-suggestions, r...
Dylan DPC [Wed, 27 Apr 2022 00:47:11 +0000 (02:47 +0200)]
Rollup merge of #96385 - marmeladema:nll-fix-trait-lifetime-bound-suggestions, r=jackh726

Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL

This is done by replacing the duplicated (and very partial) implementation from borrowck with one inspsired from `NiceRegionError::try_report_static_impl_trait` and by re-using `suggest_new_region_bound`.

Fixes #96277

r? ```@jackh726```

2 years agoRollup merge of #96383 - compiler-errors:issue-96381, r=estebank
Dylan DPC [Wed, 27 Apr 2022 00:47:10 +0000 (02:47 +0200)]
Rollup merge of #96383 - compiler-errors:issue-96381, r=estebank

Fix erased region escaping into wfcheck due to #95395

We can just use `liberate_late_bound_regions` instead of `erase_late_bound_regions`... This gives us `ReEarlyBound` instead of `ReErased`, the former being something typeck actually knows how to deal with...

Fixes #96381

Side-note: We only actually get far enough in the compiler pipeline to cause this ICE when we're invoking rustdoc. We actually abort rustc right before wfcheck because of the error that we emit (having `_` in the type signature). Why does rustdoc keep going even though we raise an error?

2 years agoRollup merge of #96370 - compiler-errors:cleanup-report_method_error, r=estebank
Dylan DPC [Wed, 27 Apr 2022 00:47:07 +0000 (02:47 +0200)]
Rollup merge of #96370 - compiler-errors:cleanup-report_method_error, r=estebank

Cleanup `report_method_error` a bit

1. Remove an unnecessary indentation level
2. Split out a couple of large functions from this humongo function body

2 years agoRollup merge of #92569 - George-lewis:87181, r=estebank
Dylan DPC [Wed, 27 Apr 2022 00:47:07 +0000 (02:47 +0200)]
Rollup merge of #92569 - George-lewis:87181, r=estebank

Improve Error Messaging for Unconstructed Structs and Enum Variants in Generic Contexts

Improves error messaging for empty-tuple structs and enum variants in certain generic contexts. See new ui tests for examples.

Closes #87181

2 years agoMake explicit an unreachable `NoDelim` case in `rustfmt`.
Nicholas Nethercote [Tue, 26 Apr 2022 05:09:11 +0000 (15:09 +1000)]
Make explicit an unreachable `NoDelim` case in `rustfmt`.

2 years agoAvoid producing `NoDelim` values in `FrameData`.
Nicholas Nethercote [Tue, 26 Apr 2022 06:21:55 +0000 (16:21 +1000)]
Avoid producing `NoDelim` values in `FrameData`.

2 years agoAuto merge of #96425 - oli-obk:fix_incremental_regression_unsafety_checking, r=compil...
bors [Tue, 26 Apr 2022 22:35:40 +0000 (22:35 +0000)]
Auto merge of #96425 - oli-obk:fix_incremental_regression_unsafety_checking, r=compiler-errors

Fix incremental perf regression unsafety checking

Perf regression introduced in #96294

We will simply avoid emitting the name of the unsafe function in MIR unsafeck, since we're moving to THIR unsafeck anyway.

2 years agoAvoid producing `NoDelim` values in `Frame`.
Nicholas Nethercote [Tue, 26 Apr 2022 05:38:10 +0000 (15:38 +1000)]
Avoid producing `NoDelim` values in `Frame`.

The code currently ignores the actual delimiter on the RHS and fakes up
a `NoDelim`/`DelimSpan::dummy()` one. This commit changes it to use the
actual delimiter.

The commit also reorders the fields for the `Delimited` variant to match
the `Sequence` variant.

2 years agoAvoid producing `NoDelim` values in `MacArgs::delim()`.
Nicholas Nethercote [Tue, 26 Apr 2022 05:21:15 +0000 (15:21 +1000)]
Avoid producing `NoDelim` values in `MacArgs::delim()`.

2 years agoAvoid producing `NoDelim` values in `TokenCursorFrame`.
Nicholas Nethercote [Tue, 26 Apr 2022 03:14:38 +0000 (13:14 +1000)]
Avoid producing `NoDelim` values in `TokenCursorFrame`.

2 years agoTidy
George [Tue, 26 Apr 2022 21:05:49 +0000 (17:05 -0400)]
Tidy

2 years agoAdd new diagnostic
George [Tue, 26 Apr 2022 21:04:44 +0000 (17:04 -0400)]
Add new diagnostic

2 years agoFix the filename in the expected error message.
Dan Gohman [Tue, 26 Apr 2022 19:47:24 +0000 (12:47 -0700)]
Fix the filename in the expected error message.

2 years agoUpdate rustdoc search test to check `!`
Guillaume Gomez [Tue, 26 Apr 2022 11:58:43 +0000 (13:58 +0200)]
Update rustdoc search test to check `!`

2 years agoUpdate rustdoc search parser to handle `!` correctly
Guillaume Gomez [Tue, 26 Apr 2022 11:58:23 +0000 (13:58 +0200)]
Update rustdoc search parser to handle `!` correctly

2 years agoAdd `only-windows` versions of the coerce-issue-49593-box-never test.
Dan Gohman [Tue, 26 Apr 2022 16:52:22 +0000 (09:52 -0700)]
Add `only-windows` versions of the coerce-issue-49593-box-never test.

2 years agoAuto merge of #96428 - GuillaumeGomez:rollup-4noqr33, r=GuillaumeGomez
bors [Tue, 26 Apr 2022 15:59:46 +0000 (15:59 +0000)]
Auto merge of #96428 - GuillaumeGomez:rollup-4noqr33, r=GuillaumeGomez

Rollup of 8 pull requests

Successful merges:

 - #94022 (Clarify that `Cow::into_owned` returns owned data)
 - #94703 (Fix codegen bug in "ptx-kernel" abi related to arg passing)
 - #95949 (Implement Default for AssertUnwindSafe)
 - #96361 (Switch JS code to ES6)
 - #96372 (Suggest calling method on nested field when struct is missing method)
 - #96386 (simplify `describe_field` func in borrowck's diagnostics part)
 - #96400 (Correct documentation for `Rvalue::ShallowInitBox`)
 - #96415 (Remove references to git.io)

Failed merges:

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

2 years agoRevert "add `DefId` to unsafety violations and display function path in E0133"
Oli Scherer [Tue, 26 Apr 2022 10:43:00 +0000 (10:43 +0000)]
Revert "add `DefId` to unsafety violations and display function path in E0133"

This reverts commit 8b8f6653cfd54525714f02efe7af0a0f830e185c.

2 years agoUpdate src/test/rustdoc/issue-95873.rs
Michael Howell [Tue, 26 Apr 2022 14:13:30 +0000 (07:13 -0700)]
Update src/test/rustdoc/issue-95873.rs

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2 years agonot need `Option` for `dbg_scope`
SparrowLii [Tue, 26 Apr 2022 13:00:19 +0000 (21:00 +0800)]
not need `Option` for `dbg_scope`

2 years agoRollup merge of #96415 - ehuss:git-io, r=bjorn3
Guillaume Gomez [Tue, 26 Apr 2022 11:22:31 +0000 (13:22 +0200)]
Rollup merge of #96415 - ehuss:git-io, r=bjorn3

Remove references to git.io

The git.io service is shutting down soon (see https://github.blog/changelog/2022-04-25-git-io-deprecation/). This removes the references of those short links with the actual destination.

2 years agoRollup merge of #96400 - JakobDegen:shallow-init-docs, r=Dylan-DPC
Guillaume Gomez [Tue, 26 Apr 2022 11:22:30 +0000 (13:22 +0200)]
Rollup merge of #96400 - JakobDegen:shallow-init-docs, r=Dylan-DPC

Correct documentation for `Rvalue::ShallowInitBox`

As a part of the big MIR docs PR, I had added a comment indicating that `Rvalue::ShallowInitBox` is disallowed after drop elaboration, but this is not true (no idea why I thought it was). Codegen has support for it, and trying to enforce this rule in the validator causes compiling core to ICE on the very first `box` statement.

That being said, this `Rvalue` probably *should* be banned after drop elaboration - it doesn't seem like it's still useful for much. However, I do not have time right now to actually go investigate how difficult a change that is to make, so in the meantime fixing the docs to reflect the current situation seems like the right step.

r? rust-lang/mir-opt

2 years agoRollup merge of #96386 - SparrowLii:des_field, r=jackh726
Guillaume Gomez [Tue, 26 Apr 2022 11:22:29 +0000 (13:22 +0200)]
Rollup merge of #96386 - SparrowLii:des_field, r=jackh726

simplify `describe_field` func in borrowck's diagnostics part

This PR simplify the `describe_field` func in borrowck's diagnostics part, besides fix the FIXME in it.

2 years agoRollup merge of #96372 - compiler-errors:field-method-suggest, r=oli-obk
Guillaume Gomez [Tue, 26 Apr 2022 11:22:29 +0000 (13:22 +0200)]
Rollup merge of #96372 - compiler-errors:field-method-suggest, r=oli-obk

Suggest calling method on nested field when struct is missing method

Similar to the suggestion to change `x.field` to `x.nested.field`, implement a similar suggestion for when `x.method()` should be replaced with `x.nested.method()`.

2 years agoRollup merge of #96361 - GuillaumeGomez:es6, r=notriddle
Guillaume Gomez [Tue, 26 Apr 2022 11:22:28 +0000 (13:22 +0200)]
Rollup merge of #96361 - GuillaumeGomez:es6, r=notriddle

Switch JS code to ES6

Considering it's already quite big, I'll do the remaining files in another PR.

Part of #93058.

r? ``@notriddle``

2 years agoRollup merge of #95949 - SoniEx2:patch-5, r=m-ou-se
Guillaume Gomez [Tue, 26 Apr 2022 11:22:27 +0000 (13:22 +0200)]
Rollup merge of #95949 - SoniEx2:patch-5, r=m-ou-se

Implement Default for AssertUnwindSafe

Trait impls are still insta-stable yeah...?

2 years agoRollup merge of #94703 - kjetilkjeka:nvptx-kernel-args-abi2, r=nagisa
Guillaume Gomez [Tue, 26 Apr 2022 11:22:27 +0000 (13:22 +0200)]
Rollup merge of #94703 - kjetilkjeka:nvptx-kernel-args-abi2, r=nagisa

Fix codegen bug in "ptx-kernel" abi related to arg passing

I found a codegen bug in the nvptx abi related to that args are passed as ptrs ([see comment](https://github.com/rust-lang/rust/issues/38788#issuecomment-1048999928)), this is not as specified in the [ptx-interoperability doc](https://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/) or how C/C++ does it. It will also almost always fail in practice since device/host uses different memory spaces for most hardware.

This PR fixes the bug and add tests for passing structs to ptx kernels.

I observed that all nvptx assembly tests had been marked as [ignore a long time ago](https://github.com/rust-lang/rust/pull/59752#issuecomment-501713428). I'm not sure if the new one should be marked as ignore, it passed on my computer but it might fail if ptx-linker is missing on the server? I guess this is outside scope for this PR and should be looked at in a different issue/PR.

I only fixed the nvptx64-nvidia-cuda target and not the potential code paths for the non-existing 32bit target. Even though 32bit nvptx is not a supported target there are still some code under the hood supporting codegen for 32 bit ptx. I was advised to create an MCP to find out if this code should be removed or updated.

Perhaps ``@RDambrosio016`` would have interest in taking a quick look at this.

2 years agoRollup merge of #94022 - jongiddy:cow-into-owned-docs, r=Dylan-DPC
Guillaume Gomez [Tue, 26 Apr 2022 11:22:26 +0000 (13:22 +0200)]
Rollup merge of #94022 - jongiddy:cow-into-owned-docs, r=Dylan-DPC

Clarify that `Cow::into_owned` returns owned data

Two sections of the `Cow::into_owned` docs imply that `into_owned` returns a `Cow`. Clarify that it returns the underlying owned object, either cloned or extracted from the `Cow`.

2 years agoAuto merge of #96424 - oli-obk:miri_update, r=oli-obk
bors [Tue, 26 Apr 2022 10:14:05 +0000 (10:14 +0000)]
Auto merge of #96424 - oli-obk:miri_update, r=oli-obk

update miri submodule

r? `@ghost`

fixes  #96402

2 years agoupdate miri submodule
Oli Scherer [Tue, 26 Apr 2022 09:41:00 +0000 (09:41 +0000)]
update miri submodule

2 years agoAuto merge of #94034 - willcrichton:fix-trait-suggestion-for-binops, r=estebank
bors [Tue, 26 Apr 2022 07:29:15 +0000 (07:29 +0000)]
Auto merge of #94034 - willcrichton:fix-trait-suggestion-for-binops, r=estebank

Fix incorrect suggestion for trait bounds involving binary operators

This PR fixes #93927, #92347, #93744 by replacing the bespoke trait-suggestion logic in `op.rs` with a more common code path.

The downside is that this fix causes some suggestions to not include an `Output=` type, reducing their usefulness.

Note that this causes one case in the `missing-bounds.rs` test to fail rustfix. So I would need to move that code into a separate non-fix test if this PR is otherwise acceptable.

2 years agoAuto merge of #96404 - tmandry:roll-llvm, r=cuviper
bors [Tue, 26 Apr 2022 04:48:33 +0000 (04:48 +0000)]
Auto merge of #96404 - tmandry:roll-llvm, r=cuviper

Update LLVM submodule

* [[fuchsia] Don't include duplicate profiling symbols for Fuchsia
](https://github.com/rust-lang/llvm-project/commit/326efc90ac5bf79a8fdd90898addf86bb6a6e404)
* [[MIPS] Initial support for MIPS-I load delay slots
](https://github.com/rust-lang/llvm-project/commit/161fd6b0b10464dd3f7ed50af7aea7df5a1acccf)

r? `@rust-lang/wg-llvm`

2 years agoUpdate unop path, fix tests
Will Crichton [Tue, 26 Apr 2022 02:14:09 +0000 (19:14 -0700)]
Update unop path, fix tests

2 years agoAuto merge of #96414 - Dylan-DPC:rollup-t4ofhoa, r=Dylan-DPC
bors [Tue, 26 Apr 2022 01:52:46 +0000 (01:52 +0000)]
Auto merge of #96414 - Dylan-DPC:rollup-t4ofhoa, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #90312 (Fix some confusing wording and improve slice-search-related docs)
 - #96149 (Remove unused macro rules)
 - #96279 (rustdoc: Remove .woff font files)
 - #96355 (Better handle too many `#` recovery in raw str)
 - #96379 (delay bug when adjusting `NeverToAny` twice during diagnostic code)
 - #96384 (do not consider two extern types to be similar)

Failed merges:

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

2 years agoReplace suggest_constraining_param with suggest_restricting_param_bound
Will Crichton [Tue, 15 Feb 2022 22:49:16 +0000 (14:49 -0800)]
Replace suggest_constraining_param with suggest_restricting_param_bound
to fix incorrect suggestion for trait bounds involving binary operators.
Fixes #93927, #92347, #93744.

2 years agoRemove references to git.io
Eric Huss [Tue, 26 Apr 2022 00:05:58 +0000 (17:05 -0700)]
Remove references to git.io

2 years agoRollup merge of #96384 - lcnr:extern-types-similar, r=compiler-errors
Dylan DPC [Mon, 25 Apr 2022 23:21:24 +0000 (01:21 +0200)]
Rollup merge of #96384 - lcnr:extern-types-similar, r=compiler-errors

do not consider two extern types to be similar

2 years agoRollup merge of #96379 - PrestonFrom:issue_96335, r=compiler-errors
Dylan DPC [Mon, 25 Apr 2022 23:21:23 +0000 (01:21 +0200)]
Rollup merge of #96379 - PrestonFrom:issue_96335, r=compiler-errors

delay bug when adjusting `NeverToAny` twice during diagnostic code

Addresses Issue 96335 (https://github.com/rust-lang/rust/issues/96335) by using `delay_span_bug` instead of an assert and returning an error type from `check_expr_meets_expectation_or_error`.

Fixes #96335

2 years agoRollup merge of #96355 - estebank:issue-95030, r=compiler-errors
Dylan DPC [Mon, 25 Apr 2022 23:21:22 +0000 (01:21 +0200)]
Rollup merge of #96355 - estebank:issue-95030, r=compiler-errors

Better handle too many `#` recovery in raw str

Point at all the unnecessary trailing `#`.
Better handle interaction with outer attributes when `;` is missing.

Fix #95030.

2 years agoRollup merge of #96279 - GuillaumeGomez:remove-woff-fonts, r=camelid,jsha
Dylan DPC [Mon, 25 Apr 2022 23:21:21 +0000 (01:21 +0200)]
Rollup merge of #96279 - GuillaumeGomez:remove-woff-fonts, r=camelid,jsha

rustdoc: Remove .woff font files

Copying `@jsha's` great comment:

> Right now we ship 1.5MB of woff files in the rustdoc binary, and 1MB of woff2 files, for a total of 2.5MB.
>
> Per:
>
> https://caniuse.com/woff
> https://caniuse.com/woff2
>
> The only listed browser that supports woff and not woff2 is IE, which is not supported per https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md.
>
> I propose we stop shipping woff files and save 1.5MB from the rustdoc binary (and from each doc build).

r? `@jsha`

2 years agoRollup merge of #96149 - est31:remove_unused_macro_matchers, r=petrochenkov
Dylan DPC [Mon, 25 Apr 2022 23:21:20 +0000 (01:21 +0200)]
Rollup merge of #96149 - est31:remove_unused_macro_matchers, r=petrochenkov

Remove unused macro rules

Removes rules of internal macros that weren't triggered.

2 years agoRollup merge of #90312 - r00ster91:search, r=Dylan-DPC
Dylan DPC [Mon, 25 Apr 2022 23:21:20 +0000 (01:21 +0200)]
Rollup merge of #90312 - r00ster91:search, r=Dylan-DPC

Fix some confusing wording and improve slice-search-related docs

This adds more links between `contains` and `binary_search` because I do think they have some relevant connections. If your (big) slice happens to be sorted and you know it, surely you should be using `[3; 100].binary_search(&5).is_ok()` over `[3; 100].contains(&5)`?
This also fixes the confusing "searches this sorted X" wording which just sounds really weird because it doesn't know whether it's actually sorted. It should be but it may not be. The new wording should make it clearer that you will probably want to sort it and in the same sentence it also mentions the related function `contains`.
Similarly, this mentions `binary_search` on `contains`' docs.
This also fixes some other minor stuff and inconsistencies.

2 years agoAuto merge of #96294 - Emilgardis:def_id-in-unsafetyviolationdetails, r=oli-obk
bors [Mon, 25 Apr 2022 23:03:50 +0000 (23:03 +0000)]
Auto merge of #96294 - Emilgardis:def_id-in-unsafetyviolationdetails, r=oli-obk

Display function path in unsafety violations - E0133

adds `DefId` to `UnsafetyViolationDetails`

this enables consumers to access the function definition that was reported to be unsafe and also changes the output for some E0133 diagnostics

2 years agorustdoc: do not write `{{root}}` in `pub use ::foo` docs
Michael Howell [Mon, 25 Apr 2022 22:38:43 +0000 (15:38 -0700)]
rustdoc: do not write `{{root}}` in `pub use ::foo` docs

2 years agoFix issue 96381
Michael Goulet [Mon, 25 Apr 2022 06:32:59 +0000 (23:32 -0700)]
Fix issue 96381

2 years agoUpdate LLVM submodule
Tyler Mandry [Mon, 25 Apr 2022 19:57:08 +0000 (12:57 -0700)]
Update LLVM submodule

2 years agoAuto merge of #96116 - ouz-a:mir-opt, r=oli-obk
bors [Mon, 25 Apr 2022 19:34:52 +0000 (19:34 +0000)]
Auto merge of #96116 - ouz-a:mir-opt, r=oli-obk

Make derefer work everwhere

Follow up work on previous PR's #95649 and #95857.

r? rust-lang/mir-opt

_Co-Authored-By: `@oli-obk_`

2 years agoCorrect documentation for `ShallowInitBox`
Jakob Degen [Mon, 25 Apr 2022 18:24:14 +0000 (14:24 -0400)]
Correct documentation for `ShallowInitBox`

2 years agoMake EncodeWide implement FusedIterator
Aron Parker [Mon, 25 Apr 2022 16:38:47 +0000 (18:38 +0200)]
Make EncodeWide implement FusedIterator

2 years agoAuto merge of #95604 - nbdd0121:used2, r=petrochenkov
bors [Mon, 25 Apr 2022 16:14:54 +0000 (16:14 +0000)]
Auto merge of #95604 - nbdd0121:used2, r=petrochenkov

Generate synthetic object file to ensure all exported and used symbols participate in the linking

Fix #50007 and #47384

This is the synthetic object file approach that I described in https://github.com/rust-lang/rust/pull/95363#issuecomment-1079932354, allowing all exported and used symbols to be linked while still allowing them to be GCed.

Related #93791, #95363

r? `@petrochenkov`
cc `@carbotaniuman`

2 years agoAdd test for asserting correct generation of ptx-kernel args
Kjetil Kjeka [Mon, 7 Mar 2022 14:15:26 +0000 (15:15 +0100)]
Add test for asserting correct generation of ptx-kernel args

2 years agoStop exporting rust_eh_personality and friends from cdylib
Gary Guo [Mon, 25 Apr 2022 13:06:30 +0000 (14:06 +0100)]
Stop exporting rust_eh_personality and friends from cdylib

2 years agoAuto merge of #96246 - SparrowLii:bound_contxet, r=compiler-errors
bors [Mon, 25 Apr 2022 10:46:58 +0000 (10:46 +0000)]
Auto merge of #96246 - SparrowLii:bound_contxet, r=compiler-errors

Add `BoundKind` in `visit_param_bounds` to check questions in bounds

From the FIXME in the impl of `AstValidator`. Better bound checks by adding `BoundCtxt` type parameter to `visit_param_bound`

cc `@ecstatic-morse`

2 years agoavoid fully qualifying error output of issue-43733 test
Emil Gardström [Sun, 24 Apr 2022 17:03:59 +0000 (19:03 +0200)]
avoid fully qualifying error output of issue-43733 test

2 years agosimplify `describe_field` func in borrowck's diagnostics part
SparrowLii [Mon, 25 Apr 2022 08:09:36 +0000 (16:09 +0800)]
simplify `describe_field` func in borrowck's diagnostics part

2 years agoAuto merge of #95246 - ChrisDenton:command-args, r=joshtriplett
bors [Mon, 25 Apr 2022 07:28:09 +0000 (07:28 +0000)]
Auto merge of #95246 - ChrisDenton:command-args, r=joshtriplett

Windows Command: Don't run batch files using verbatim paths

Fixes #95178

Note that the first commit does some minor refactoring (moving command line argument building to args.rs). The actual changes are in the second.

2 years agoRecover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL
marmeladema [Sun, 24 Apr 2022 14:44:09 +0000 (16:44 +0200)]
Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL

2 years agodo not consider two extern types to be similar
lcnr [Mon, 25 Apr 2022 06:51:26 +0000 (08:51 +0200)]
do not consider two extern types to be similar

2 years agoDelay bug when adjusting NeverToAny twice during diagnostic
Preston From [Sun, 24 Apr 2022 08:00:12 +0000 (02:00 -0600)]
Delay bug when adjusting NeverToAny twice during diagnostic

2 years agoAuto merge of #96106 - jihiggins:issue-96060, r=Mark-Simulacrum
bors [Mon, 25 Apr 2022 04:24:10 +0000 (04:24 +0000)]
Auto merge of #96106 - jihiggins:issue-96060, r=Mark-Simulacrum

Add type_name info to [TIMING] log output

Adds type_name to the [TIMING] log output:
```
[TIMING] (bootstrap::compile::Sysroot) Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } -- 0.020
[TIMING] (bootstrap::builder::Builder::sysroot_libdir::Libdir) Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } -- 0.007
```

Not sure if that's the best way to format it. Thought about replacing the struct's name with the type_name output, but that feels kind of hacky?

Closes #96060

2 years agoUse `build/tmp` instead of adding a dependency on `tempfile`.
Joshua Nelson [Sun, 10 Apr 2022 19:24:11 +0000 (14:24 -0500)]
Use `build/tmp` instead of adding a dependency on `tempfile`.

2 years agoAllow quotes around `nixos` in /etc/os-release
Joshua Nelson [Wed, 23 Mar 2022 23:17:44 +0000 (23:17 +0000)]
Allow quotes around `nixos` in /etc/os-release

2 years agoMove download-ci-llvm to rustbuild
Joshua Nelson [Mon, 21 Mar 2022 13:59:34 +0000 (08:59 -0500)]
Move download-ci-llvm to rustbuild

This attempts to keep the logic as close to the original python as possible.
`probably_large` has been removed, since it was always `True`, and UTF-8 paths are no longer supported when patching files for NixOS.
I can readd UTF-8 support if desired.

Note that this required making `llvm_link_shared` computed on-demand,
since we don't know whether it will be static or dynamic until we download LLVM from CI.

2 years agosuggestion if struct field has method
Michael Goulet [Sun, 24 Apr 2022 23:45:39 +0000 (16:45 -0700)]
suggestion if struct field has method

2 years agopull some methods out of report_method_error
Michael Goulet [Sun, 24 Apr 2022 22:24:20 +0000 (15:24 -0700)]
pull some methods out of report_method_error

2 years agoAuto merge of #96369 - matthiaskrgr:rollup-q18w4v2, r=matthiaskrgr
bors [Sun, 24 Apr 2022 22:20:56 +0000 (22:20 +0000)]
Auto merge of #96369 - matthiaskrgr:rollup-q18w4v2, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #95395 (Better error message for `_` in function signature in `impl Trait for Ty`)
 - #96090 (Implement MIR opt unit tests)
 - #96107 ([test] Add test cases for untested functions for VecDeque)
 - #96212 (Use revisions instead of nll compare mode for `/regions/` ui tests)
 - #96215 (Drop support for legacy PM with LLVM 15)
 - #96366 (bootstrap: Remove dead code in rustdoc shim)

Failed merges:

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

2 years agoRollup merge of #96366 - jyn514:remove-dead-code, r=Mark-Simulacrum
Matthias Krüger [Sun, 24 Apr 2022 22:11:03 +0000 (00:11 +0200)]
Rollup merge of #96366 - jyn514:remove-dead-code, r=Mark-Simulacrum

bootstrap: Remove dead code in rustdoc shim

The `RUSTDOC_RESOURCE_SUFFIX` variable was never actually set.

2 years agoRollup merge of #96215 - nikic:legacy-pm-removal, r=nagisa
Matthias Krüger [Sun, 24 Apr 2022 22:11:02 +0000 (00:11 +0200)]
Rollup merge of #96215 - nikic:legacy-pm-removal, r=nagisa

Drop support for legacy PM with LLVM 15

LLVM 15 already removes some of the legacy PM APIs we're using. This patch forces use of NewPM with LLVM 15 (with `-Z new-llvm-pass-manager=no` throwing a warning) and stubs out various FFI methods with a report_fatal_error on LLVM 15.

For LLVMPassManagerBuilderPopulateLTOPassManager() I went with adding our own wrapper, as the alternative would be to muck about with weak symbols, which seems to be non-trivial as far as cross-platform support is concerned (std has `weak!` for this purpose, but only as an internal utility.)

Fixes #96072.
Fixes #96362.

2 years agoRollup merge of #96212 - marmeladema:nll-revisions-regions, r=jackh726
Matthias Krüger [Sun, 24 Apr 2022 22:11:01 +0000 (00:11 +0200)]
Rollup merge of #96212 - marmeladema:nll-revisions-regions, r=jackh726

Use revisions instead of nll compare mode for `/regions/` ui tests

Created https://github.com/rust-lang/rust/issues/96211 for the duplicated mismatched types errors

r? `@jackh726`

2 years agoRollup merge of #96107 - Gumichocopengin8:test/vec-deque, r=Mark-Simulacrum
Matthias Krüger [Sun, 24 Apr 2022 22:11:00 +0000 (00:11 +0200)]
Rollup merge of #96107 - Gumichocopengin8:test/vec-deque, r=Mark-Simulacrum

[test] Add test cases for untested functions for VecDeque

Added test cases of the following functions
- get
- get_mut
- swap
- reserve_exact
- try_reserve_exact
- try_reserve
- contains
- rotate_left
- rotate_right
- binary_search
- binary_search_by
- binary_search_by_key

2 years agoRollup merge of #96090 - JakobDegen:mir-tests, r=nagisa
Matthias Krüger [Sun, 24 Apr 2022 22:10:59 +0000 (00:10 +0200)]
Rollup merge of #96090 - JakobDegen:mir-tests, r=nagisa

Implement MIR opt unit tests

This implements rust-lang/compiler-team#502 .

There's not much to say here, this implementation does everything as proposed. I also added the flag to a bunch of existing tests (mostly those to which I could add it without causing huge diffs due to changes in line numbers). Summarizing the changes to test outputs:
 - Every time an `MirPatch` is created, it adds a cleanup block to the body if it did not exist already. If this block is unused (as is usually the case), it usually gets removed soon after by some pass calling `SimplifyCFG` for unrelated reasons (in many cases this cycle happens quite a few times for a single body). We now run `SimplifyCFG` less often, so those blocks end up in some of our outputs. I looked at changing `MirPatch` to not do this, but that seemed too complicated for this PR. I may still do that in a follow-up.
 - The `InstCombine` test had set `-C opt-level=0` in its flags and so there were no storage markers. I don't really see a good motivation for doing this, so bringing it back in line with what everything else does seems correct.
 - One of the `EarlyOtherwiseBranch` tests had `UnreachableProp` running on it. Preventing that kind of thing is the goal of this feature, so this seems fine.

For the remaining tests for which this feature might be useful, we can gradually migrate them as opportunities present themselves.

In terms of documentation, I plan on submitting a PR to the rustc dev guide in the near future documenting this and other recent changes to MIR. If there's any other places to update, do let me know

r? `@nagisa`

2 years agoRollup merge of #95395 - compiler-errors:infer-on-impl-for-trait, r=oli-obk
Matthias Krüger [Sun, 24 Apr 2022 22:10:59 +0000 (00:10 +0200)]
Rollup merge of #95395 - compiler-errors:infer-on-impl-for-trait, r=oli-obk

Better error message for `_` in function signature in `impl Trait for Ty`

Provides a replacement suggestion for when `_` is present in the function signature for `impl Trait for Ty`, using the substitutions from the trait to compute the exact type.

Fixes #95097

2 years agoremove indentation in report_method_error
Michael Goulet [Sun, 24 Apr 2022 22:05:06 +0000 (15:05 -0700)]
remove indentation in report_method_error

2 years agoFix suggestion for `_` on return type for fn in impl for Trait
Michael Goulet [Mon, 28 Mar 2022 02:43:08 +0000 (19:43 -0700)]
Fix suggestion for `_` on return type for fn in impl for Trait

2 years agoSuggest replacing `_` in type signature of impl for Trait
Michael Goulet [Mon, 28 Mar 2022 02:43:05 +0000 (19:43 -0700)]
Suggest replacing `_` in type signature of impl for Trait

2 years agoEnsure `#[used]` symbols are preserved in LTO
Gary Guo [Sun, 24 Apr 2022 21:32:05 +0000 (22:32 +0100)]
Ensure `#[used]` symbols are preserved in LTO

2 years agoRemove dead code in rustdoc shim
Joshua Nelson [Sun, 24 Apr 2022 19:53:49 +0000 (14:53 -0500)]
Remove dead code in rustdoc shim

The `RUSTDOC_RESOURCE_SUFFIX` variable was never actually set.

2 years agoUse revisions instead of nll compare mode for `/regions/` ui tests
marmeladema [Tue, 19 Apr 2022 10:56:18 +0000 (12:56 +0200)]
Use revisions instead of nll compare mode for `/regions/` ui tests

2 years agoAuto merge of #94609 - esp-rs:esp-idf-stat-type-fixes, r=Mark-Simulacrum
bors [Sun, 24 Apr 2022 19:16:20 +0000 (19:16 +0000)]
Auto merge of #94609 - esp-rs:esp-idf-stat-type-fixes, r=Mark-Simulacrum

espidf: fix stat

Marking as draft as currently dependant on [a libc fix](https://github.com/rust-lang/libc/pull/2708) and release.

2 years agotest: add test cases for VecDeque
Keita Nonaka [Fri, 15 Apr 2022 23:33:55 +0000 (16:33 -0700)]
test: add test cases for VecDeque

2 years agoonly show a simple description in E0133 span label
Emil Gardström [Sun, 24 Apr 2022 12:42:30 +0000 (14:42 +0200)]
only show a simple description in E0133 span label

2 years agoadd `DefId` to unsafety violations and display function path in E0133
Emil Gardström [Sun, 24 Apr 2022 12:08:23 +0000 (14:08 +0200)]
add `DefId` to unsafety violations and display function path in E0133

this enables consumers to access the function definition that was reported to be unsafe

2 years agoAuto merge of #96363 - matthiaskrgr:rollup-mthdja5, r=matthiaskrgr
bors [Sun, 24 Apr 2022 16:22:40 +0000 (16:22 +0000)]
Auto merge of #96363 - matthiaskrgr:rollup-mthdja5, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #94893 (diagnostics: regression test for `<usize as Iterator>::rev`)
 - #95504 (Add `x {check,build,doc} {compiler,library}` aliases.)
 - #96237 (compiletest: combine `--*-python` args)
 - #96303 (Improve bootstrap tests)
 - #96352 (Improve span for `consider adding an explicit lifetime bound` suggestions under NLL)

Failed merges:

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

2 years agoRollup merge of #96352 - marmeladema:fix-nll-lifetime-bound-suggestions, r=jackh726
Matthias Krüger [Sun, 24 Apr 2022 16:00:27 +0000 (18:00 +0200)]
Rollup merge of #96352 - marmeladema:fix-nll-lifetime-bound-suggestions, r=jackh726

Improve span for `consider adding an explicit lifetime bound` suggestions under NLL

Because NLL borrowck is run after typeck, `in_progress_typeck_results` was always `None` which was preventing the retrieval of the span to which the suggestion is suppose to add the lifetime bound.
We now manually pass the `LocalDefId` owner to `construct_generic_bound_failure` so that under NLL, we give the owner id of the current body.

This helps with #96332

2 years agoRollup merge of #96303 - jyn514:improved-bootstrap-tests, r=Mark-Simulacrum
Matthias Krüger [Sun, 24 Apr 2022 16:00:27 +0000 (18:00 +0200)]
Rollup merge of #96303 - jyn514:improved-bootstrap-tests, r=Mark-Simulacrum

Improve bootstrap tests

- Don't checkout submodules in bootstrap tests

  This doesn't cause any tests to fail, and can greatly speed them up.

- Add a test for --exclude test::XXX

  I didn't know that the `test::` syntax was valid before, and it doesn't seem to be documented anywhere. Add a test so it doesn't regress accidentally, and as executable documentation.
  This also moves the `exclude` tests out of `dist`, to avoid assertion errors when the `cmd` passed to configure didn't match the `subcommand` used.

- Use run_build helper consistently across most bootstrap tests
  This is not super important to do, but the consistency is nice.

  I didn't change any tests that call `configure("dist")` and then override the subcommand - doing
that at all is pretty sketchy, but I don't want to mess with it while already doing a refactor.

Found while working on the "one call to Step for all paths" change mentioned in https://github.com/rust-lang/rust/pull/95503#issuecomment-1105914384, but independent of that work.

cc `@pietroalbini` for the `--exclude` test, git blame says you added support for it originally.

2 years agoRollup merge of #96237 - AlecGoncharow:issue-96011-fix, r=Mark-Simulacrum
Matthias Krüger [Sun, 24 Apr 2022 16:00:26 +0000 (18:00 +0200)]
Rollup merge of #96237 - AlecGoncharow:issue-96011-fix, r=Mark-Simulacrum

compiletest: combine `--*-python` args

Since these arguments are now always the same, combine them into a
singular `--python` argument.

Fixes #96011