Commit Graph

171194 Commits

Author SHA1 Message Date
David Wood
a0624eb6c9 lint: port expectation diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30 08:59:21 +01:00
David Wood
2a69640eb2 lint: port enum intrinsics diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30 08:59:21 +01:00
David Wood
0f4c4c5e18 lint: port array-into-iter diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30 08:59:19 +01:00
David Wood
7d2eba6311 middle: translation in LintDiagnosticBuilder
Accept `DiagnosticMessage` in `LintDiagnosticBuilder::build` so that
lints can be built with translatable diagnostic messages.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30 08:58:41 +01:00
bors
a9eb9c52f3 Auto merge of #98649 - RalfJung:guardians-of-mir, r=oli-obk
move MIR syntax into a dedicated file and ping some people whenever it changes

Adding or changing MIR operations/statements/whatever should be under significant scrutiny wrt their wider impact, specified semantics, and so on. So let's start by putting all that into a dedicated file and pinging some people whenever that file changes.

This PR only moves definitions around, and then fiddles with imports until it all works again.
2022-06-30 03:50:35 +00:00
bors
5d3c6d6c83 Auto merge of #98691 - matthiaskrgr:rollup-ymsa64p, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #96727 (Make TAIT behave exactly like RPIT)
 - #98681 (rustdoc-json: Make default value of blanket impl assoc types work)
 - #98682 (add tests for ICE 94432)
 - #98683 (add test for ice 68875)
 - #98685 (Replace `sort_modules_alphabetically` boolean with enum)
 - #98687 (add test for 47814)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-30 01:02:24 +00:00
Ralf Jung
6c990f48af fix doc issues 2022-06-29 19:18:30 -04:00
Matthias Krüger
943c6c7444
Rollup merge of #98687 - matthiaskrgr:test_47814, r=compiler-errors
add test for 47814

not sure if the issue should actually get closed though, hm

r? ``@compiler-errors``
2022-06-30 00:23:55 +02:00
Matthias Krüger
57c683afab
Rollup merge of #98685 - camelid:sorting-flag, r=GuillaumeGomez
Replace `sort_modules_alphabetically` boolean with enum

This fixes the long-standing FIXME there and makes the code easier to
understand. The reference to modules in both the old and new names seems
potentially wrong since I believe it applies to all items.

r? ``@GuillaumeGomez``
2022-06-30 00:23:54 +02:00
Matthias Krüger
ad682ad391
Rollup merge of #98683 - matthiaskrgr:ice-test-68875, r=compiler-errors
add test for ice 68875

Fixes #68875
2022-06-30 00:23:53 +02:00
Matthias Krüger
19f45e29b9
Rollup merge of #98682 - matthiaskrgr:test-94432, r=compiler-errors
add tests for ICE 94432

Fixes #94432
2022-06-30 00:23:52 +02:00
Matthias Krüger
6d6b30ccbf
Rollup merge of #98681 - Enselic:rustdoc-json-default-assoc-type-blanket-impl, r=GuillaumeGomez
rustdoc-json: Make default value of blanket impl assoc types work

Closes #98658

r? ``@GuillaumeGomez``

``@rustbot`` labels +A-rustdoc-json
2022-06-30 00:23:51 +02:00
Matthias Krüger
48170d5a1c
Rollup merge of #96727 - oli-obk:no_expect, r=lcnr
Make TAIT behave exactly like RPIT

fixes https://github.com/rust-lang/rust/issues/96552

This makes type-alias-impl-trait behave like return-position-impl-trait. Unfortunately it also causes some cases to stop compiling due to "needing type annotations" and makes panicking cause fallback for the hidden type to `()`.

All of these are addressable, but we should probably address them for RPIT and TAIT together

r? ``@lcnr``
2022-06-30 00:23:50 +02:00
bors
bf45371f26 Auto merge of #98520 - RalfJung:invalid, r=compiler-errors
interpret: adjust error from constructing an invalid value
2022-06-29 22:21:43 +00:00
Matthias Krüger
c9f2865472 add test for 47814
not sure if the issue should actually get closed though, hm

r? @compiler-errors
2022-06-29 22:29:02 +02:00
Noah Lev
be0b1121e9 Replace sort_modules_alphabetically boolean with enum
This fixes the long-standing FIXME there and makes the code easier to
understand. The reference to modules in both the old and new names seems
potentially wrong since I believe it applies to all items.
2022-06-29 13:04:43 -07:00
Ralf Jung
a58d8f6616 ping more people
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2022-06-29 16:03:24 -04:00
Ralf Jung
ab01a73151 move MIR syntax into a dedicated file and ping some people whenever it changes 2022-06-29 16:03:24 -04:00
Matthias Krüger
5f75e7104a add test for ice 68875
Fixes #68875
2022-06-29 21:38:42 +02:00
Matthias Krüger
726d6136e3 add tests for ICE 94432
Fixes #94432
2022-06-29 21:30:19 +02:00
Martin Nordholts
ba87c934ea rustdoc-json: Make default value of blanket impl assoc types work 2022-06-29 21:05:51 +02:00
bors
ddcbba036a Auto merge of #98680 - matthiaskrgr:rollup-1bkrrn9, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #98434 (Ensure that `static_crt` is set in the bootstrapper whenever using `cc-rs` to get a compiler command line.)
 - #98636 (Triagebot: Fix mentions word wrapping.)
 - #98642 (Fix #98260)
 - #98643 (Improve pretty printing of valtrees for references)
 - #98646 (rustdoc: fix bugs in main.js popover help and settings)
 - #98647 (Update cargo)
 - #98652 (`alloc`: clean and ensure `no_global_oom_handling`  builds are warning-free)
 - #98660 (Unbreak stage1 tests via ignore-stage1 in `proc-macro/invalid-punct-ident-1.rs`.)
 - #98665 (Use verbose help for deprecation suggestion)
 - #98668 (Avoid some `&str` to `String` conversions with `MultiSpan::push_span_label`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-29 18:42:19 +00:00
Matthias Krüger
d34c4ca9be
Rollup merge of #98668 - TaKO8Ki:avoid-many-&str-to-string-conversions, r=Dylan-DPC
Avoid some `&str` to `String` conversions with `MultiSpan::push_span_label`

This patch removes some`&str` to `String` conversions with `MultiSpan::push_span_label`.
2022-06-29 20:35:07 +02:00
Matthias Krüger
d708bc45c4
Rollup merge of #98665 - ChrisDenton:deprecated-suggestion, r=compiler-errors
Use verbose help for deprecation suggestion

Fixes #98631

r? `@compiler-errors`
2022-06-29 20:35:06 +02:00
Matthias Krüger
bba00b5855
Rollup merge of #98660 - eddyb:invalid-punct-stage1, r=lqd
Unbreak stage1 tests via ignore-stage1 in `proc-macro/invalid-punct-ident-1.rs`.

#98188 broke `./x.py test --stage 1` (which I thought we ran in PR CI, cc `@rust-lang/infra)` i.e. the default `./x.py test` in dev checkouts, as the panic in `src/test/ui/proc-macro/invalid-punct-ident-1.rs` moved from the server (`rustc`) to the client (proc macro), and that means it's now affected by #59998.

I made the test look like `src/test/ui-fulldeps/issue-76270-panic-in-libproc-macro.rs` tho I'm a bit confused why that one is in `src/test/ui-fulldeps`, it should still work in `src/test/ui`, no? (cc `@Aaron1011)`
2022-06-29 20:35:05 +02:00
Matthias Krüger
7dedec7be7
Rollup merge of #98652 - ojeda:warning-free-no_global_oom_handling, r=joshtriplett
`alloc`: clean and ensure `no_global_oom_handling`  builds are warning-free

Rust 1.62.0 introduced a couple new `unused_imports` warnings
in `no_global_oom_handling` builds, making a total of 5 warnings.

<details>

```txt
warning: unused import: `Unsize`
 --> library/alloc/src/boxed/thin.rs:6:33
  |
6 | use core::marker::{PhantomData, Unsize};
  |                                 ^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `from_fn`
  --> library/alloc/src/string.rs:51:18
   |
51 | use core::iter::{from_fn, FusedIterator};
   |                  ^^^^^^^

warning: unused import: `core::ops::Deref`
  --> library/alloc/src/vec/into_iter.rs:12:5
   |
12 | use core::ops::Deref;
   |     ^^^^^^^^^^^^^^^^

warning: associated function `shrink` is never used
   --> library/alloc/src/raw_vec.rs:424:8
    |
424 |     fn shrink(&mut self, cap: usize) -> Result<(), TryReserveError> {
    |        ^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: associated function `forget_remaining_elements` is never used
   --> library/alloc/src/vec/into_iter.rs:126:19
    |
126 |     pub(crate) fn forget_remaining_elements(&mut self) {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^
```

</details>

This PR cleans them and ensures no new ones are introduced
so that projects compiling `alloc` without infallible allocations
do not see them (and may want to enable `-Dwarnings`).

The couple `dead_code` ones may be reverted when some fallible
allocation support starts using them.
2022-06-29 20:35:04 +02:00
Matthias Krüger
2c702c2f17
Rollup merge of #98647 - ehuss:update-cargo, r=ehuss
Update cargo

2 commits in a5e08c4703f202e30cdaf80ca3e7c00baa59c496..dbff32b27893b899ae2397f3d56d1be111041d56
2022-06-23 20:12:03 +0000 to 2022-06-24 19:25:13 +0000
- Fetch GitHub commits by long hash more efficiently (rust-lang/cargo#10079)
- refactor(test): Clarify asserts are for UI (rust-lang/cargo#10778)
2022-06-29 20:35:03 +02:00
Matthias Krüger
1fef19a216
Rollup merge of #98646 - notriddle:notriddle/main.js, r=GuillaumeGomez
rustdoc: fix bugs in main.js popover help and settings
2022-06-29 20:35:02 +02:00
Matthias Krüger
921e311da2
Rollup merge of #98643 - voidc:valtree-ref-pretty, r=lcnr
Improve pretty printing of valtrees for references

This implements the changes outlined in https://github.com/rust-lang/rust/issues/66451#issuecomment-1168859638.

r? `@lcnr`
Fixes #66451
2022-06-29 20:35:01 +02:00
Matthias Krüger
05c0b2e397
Rollup merge of #98642 - yanchen4791:issue-98260-fix, r=spastorino
Fix #98260

Fixes https://github.com/rust-lang/rust/issues/98260
2022-06-29 20:35:00 +02:00
Matthias Krüger
17d3868c85
Rollup merge of #98636 - ehuss:mentions-wrapping, r=Mark-Simulacrum
Triagebot: Fix mentions word wrapping.

I forgot that GitHub's markdown treats newlines as hard breaks. This was causing some ugly-looking word wrapping in the triagebot mention messages. This fixes it so that the lines are not hard-wrapped.
2022-06-29 20:34:59 +02:00
Matthias Krüger
96bb98c9c0
Rollup merge of #98434 - dpaoliello:staticcrt, r=jyn514
Ensure that `static_crt` is set in the bootstrapper whenever using `cc-rs` to get a compiler command line.

When attempting to build rustc with LLVM on Windows, I noticed that the CRT flag provided to the C and C++ Compilers was inconsistent:

```
"-DCMAKE_C_FLAGS=-nologo -MT -Brepro" "-DCMAKE_CXX_FLAGS=-nologo -MD -Brepro"
```

Since the bootstrapper also sets the various `LLVM_USE_CRT` variables, this resulted in cl.exe reporting a bunch of warnings:

```
cl : Command line warning D9025 : overriding '/MD' with '/MT'
```

The root cause for this is that `cc_detect::find` was creating a `cc::Build` twice, but didn't set `static_crt` the second time.

It's possible that this what is also causing #81381
2022-06-29 20:34:58 +02:00
Ralf Jung
549940c491 fix stderr by hand since that test is not run on my system 2022-06-29 11:26:24 -04:00
Ralf Jung
238501c137 interpret: adjust error from constructing an invalid value 2022-06-29 11:26:24 -04:00
bors
3fcf43bb0f Auto merge of #98669 - Dylan-DPC:rollup-8uzhcip, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #98415 (Migrate some `rustc_borrowck` diagnostics to `SessionDiagnostic`)
 - #98479 (Add `fetch_not` method on `AtomicBool`)
 - #98499 (Erase regions in New Abstract Consts)
 - #98516 (library: fix uefi va_list type definition)
 - #98554 (Fix box with custom allocator in miri)
 - #98607 (Clean up arg mismatch diagnostic, generalize tuple wrap suggestion)
 - #98625 (emit Retag for compound types with reference fields)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-29 15:05:29 +00:00
Dylan DPC
68228be560
Rollup merge of #98625 - RalfJung:retag, r=oli-obk
emit Retag for compound types with reference fields

I want to add an option to Miri to do retagging inside reference fields. But that means we first have to even emit `Retag` for types that *contain* references (rather than being of reference types). :)

Stacked Borrows originally did that, but we stopped doing it when hitting bunch of issues in the standard library. However I have since realized that we actually do emit `noalias` for newtypes references, which means for soundness we should recurse into fields. Also it'd probably be bad news if newtypes lose out on optimizations (and they don't, for anything else). I want to add an option for that to Miri so that we can start experimenting with those semantics.

r? ``@oli-obk``
2022-06-29 17:59:37 +05:30
Dylan DPC
fcbb2e8009
Rollup merge of #98607 - compiler-errors:tuple-wrap-suggestion, r=oli-obk
Clean up arg mismatch diagnostic, generalize tuple wrap suggestion

This is based on top of #97542, so just look at the last commit which contains the relevant changes.

1. Remove `final_arg_types` which was one of the last places we were using raw (`usize`) indices instead of typed indices in the arg mismatch suggestion code.
2. Improve the tuple wrap suggestion, now we suggest things like `call(a, b, c, d)` -> `call(a, (b, c), d)` 😺
3. Folded in fix #98645
2022-06-29 17:59:36 +05:30
Dylan DPC
b2836bd34c
Rollup merge of #98554 - DrMeepster:box_unsizing_is_not_special, r=RalfJung
Fix box with custom allocator in miri

This should fix the failures in https://github.com/rust-lang/miri/pull/2072 and https://github.com/rust-lang/rust/pull/98510.

cc ```@RalfJung```
2022-06-29 17:59:35 +05:30
Dylan DPC
375ab3e44f
Rollup merge of #98516 - dlrobertson:uefi_va_list, r=joshtriplett
library: fix uefi va_list type definition

For uefi the `va_list` should always be the void pointer variant.

Related to: https://github.com/rust-lang/rust/issues/44930
2022-06-29 17:59:34 +05:30
Dylan DPC
7b9a7ef218
Rollup merge of #98499 - JulianKnodt:erase_lifetime, r=lcnr
Erase regions in New Abstract Consts

When an abstract const is constructed, we previously included lifetimes in the set of substitutes, so it was not able to unify two abstract consts if their lifetimes did not match but the values did, despite the values not depending on the lifetimes. This caused code that should have compiled to not compile.

Fixes #98452

r? ```@lcnr```
2022-06-29 17:59:33 +05:30
Dylan DPC
3f2ba25159
Rollup merge of #98479 - leocth:atomic-bool-fetch-not, r=joshtriplett
Add `fetch_not` method on `AtomicBool`

This PR adds a `fetch_not` method on `AtomicBool` performs the NOT operation on the inner value.
Internally, this just calls the `fetch_xor` method with the value `true`.

[See this IRLO discussion](https://internals.rust-lang.org/t/could-we-have-fetch-not-for-atomicbool-s/16881)
2022-06-29 17:59:32 +05:30
Dylan DPC
d10497bba2
Rollup merge of #98415 - compiler-errors:rustc-borrowck-session-diagnostic-1, r=davidtwco
Migrate some `rustc_borrowck` diagnostics to `SessionDiagnostic`

Self-explanatory

r? ```@davidtwco```
2022-06-29 17:59:31 +05:30
Takayuki Maeda
6212e6b339 avoid many &str to String conversions with MultiSpan::push_span_label 2022-06-29 21:16:43 +09:00
bors
66c83ffca1 Auto merge of #98558 - nnethercote:smallvec-1.8.1, r=lqd
Update `smallvec` to 1.8.1.

This pulls in https://github.com/servo/rust-smallvec/pull/282, which
gives some small wins for rustc.

r? `@lqd`
2022-06-29 09:11:29 +00:00
Oli Scherer
c33b127d7c The only reason we had to replace opaque types in closures was due to async fn desugaring, make that explicit 2022-06-29 08:58:36 +00:00
Oli Scherer
77e88a7c7a Add more tests 2022-06-29 08:58:36 +00:00
Oli Scherer
524d2b3178 Make RPIT and TAIT work exactly the same 2022-06-29 08:58:36 +00:00
Chris Denton
3cbf864d43
Use verbose help for deprecation suggestion 2022-06-29 09:53:15 +01:00
Dominik Stolz
d048b15216 Improve doc comment of destructure_const 2022-06-29 10:30:47 +02:00
Eduard-Mihai Burtescu
a84e19d444 Unbreak stage1 tests via ignore-stage1 in proc-macro/invalid-punct-ident-1.rs. 2022-06-29 07:32:20 +00:00