Commit Graph

228999 Commits

Author SHA1 Message Date
Michael Goulet
52f7384995 Separate select calls that don't need a binder 2023-07-06 16:50:12 +00:00
Michael Goulet
36453456cb TraitObligation -> PolyTraitObligation 2023-07-06 16:30:11 +00:00
bors
87c8c83ec7 Auto merge of #112779 - Kobzol:ci-merge-llvm-14, r=pietroalbini
CI: merge x86_64-gnu-llvm-14 and x86_64-gnu-llvm-14-stage1 CI jobs

Another attempt to shorten CI job times. Suggested by `@the8472` [here](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/CI.20usage/near/367172221).
2023-07-06 16:14:50 +00:00
Nilstrieb
a118ce2176
Add needs-triage to all new issues
Closes #113261
2023-07-06 17:57:03 +02:00
Lukas Markeffsky
7aa5f39d3b add helper methods for accessing struct tail 2023-07-06 13:15:05 +00:00
Lukas Markeffsky
e3de14e463 sanity check field offsets in unsizeable structs 2023-07-06 13:15:05 +00:00
Lukas Markeffsky
478071ba9d clean up struct layout code 2023-07-06 13:04:13 +00:00
bors
c4c84df3b3 Auto merge of #113323 - Kobzol:pgo-script-llvm-ci, r=jyn514
Use `llvm-config` instead of `download-ci-llvm` in PGO script

This should avoid CI breakage when the LLVM stamp is updated, and also it will avoid an unnecessary LLVM download from CI.

r? `@jyn514`
2023-07-06 13:01:13 +00:00
bors
4b6749b21e Auto merge of #113406 - matthiaskrgr:rollup-0rprs5k, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #112295 (Fix the tests-listing-format-json test on Windows)
 - #113246 (fix compiletest crash)
 - #113395 (Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver)
 - #113402 (Diagnose unsorted CGUs.)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-06 10:29:49 +00:00
Matthias Krüger
a7532d9278
Rollup merge of #113402 - nnethercote:diagnose-unsorted-CGUs, r=lqd
Diagnose unsorted CGUs.

An assertion failure was reported in #112946. This extra information will help diagnose the problem.

r? `@lqd`
2023-07-06 12:12:12 +02:00
Matthias Krüger
72e0e177d5
Rollup merge of #113395 - compiler-errors:new-solver-dyn-star-selection, r=oli-obk
Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver

We were ICEing too eagerly during selection for `dyn*` goals -- both for dyn unsizing candidates and for built-in object candidates. The former should only be performed on `dyn` objects, but the latter are totally fine.
2023-07-06 12:12:12 +02:00
Matthias Krüger
1bb5dd6575
Rollup merge of #113246 - mirkootter:fix-compiletest-crash, r=pietroalbini
fix compiletest crash

### Motivation
When running compiler-tests locally for the `wasm32` platform, one test repeatedly crashed. It does not crash on the CI, only locally. Investigation shows that the `compiletest` itself crashes

> panicked-at-attempt-to-subtract-with-overflow

```rust
let mut head = replace(bytes, Vec::new());
let mut middle = head.split_off(HEAD_LEN);

// The following line will panic
let tail = middle.split_off(middle.len() - TAIL_LEN).into_boxed_slice();
let skipped = new_len - HEAD_LEN - TAIL_LEN;
```

### Background
The code in question collects the output of a process. Small output is kept completely, but larger output is kept only partially: the first 160 kB and the last 256 kB.

The code that performs this split crashes if the data size is less than 416 kB. There is an early out based on the "filtered" length, but it is possible that the filtered length is greater than the real length. It seems that this code was written with the assumption that the filtered length is larger than the real length, which is not true in general.

When running CI tests locally using `src/ci/docker/run.sh`, the filtered folder is `/checkout`, which is shorter than the placeholder length of 32 bytes.

### Note
This PR should not change any behaviour. It only adds an early our for a case which will definitely crash (at least if compiletest is build with integer checks).

Note that an early out makes sense here: If the real data is too small, it does not sense to split it.
2023-07-06 12:12:11 +02:00
Matthias Krüger
f94a0c91cd
Rollup merge of #112295 - ForrestOfBarnes:tests-listing-format-json-windows-fix, r=pietroalbini
Fix the tests-listing-format-json test on Windows

tests/ui/test-attrs/tests-listing-json-format.rs was failing on Windows because each path in the json-formatted output contained "\\\\" instead of "\\". `runtest::TestCx::normalize_output` already checks the compile flags for json-related arguments to handle this case, so I added an equivalent check for the new run flag.
2023-07-06 12:12:10 +02:00
Nicholas Nethercote
fc8536669c Diagnose unsorted CGUs.
An assertion failure was reported in #112946. This extra information
will help diagnose the problem.
2023-07-06 18:27:25 +10:00
bors
4dd1719b34 Auto merge of #113377 - BoxyUwU:move_ty_ctors_to_ty, r=compiler-errors
Move `TyCtxt::mk_x` to `Ty::new_x` where applicable

Part of rust-lang/compiler-team#616

turns out there's a lot of places we construct `Ty` this is a ridiculously huge PR :S

r? `@oli-obk`
2023-07-06 08:10:42 +00:00
Oli Scherer
deda49e7b7 Fix up doc links 2023-07-06 07:32:08 +00:00
Michael Goulet
906d2b172c Structurally normalize again for byte string lit pat checking 2023-07-06 07:11:25 +00:00
bors
b112bc5529 Auto merge of #113348 - saethlin:metadata-module-not-compiled, r=Nilstrieb
Remove some unnecessary(?) normalization

https://github.com/rust-lang/rust/issues/59774#issuecomment-1550966711
2023-07-06 05:33:54 +00:00
Michael Goulet
3acaa568c2 Prefer object candidates over impl candidates in new selection 2023-07-06 04:57:17 +00:00
Michael Goulet
cd26d10edf Dont ICE for dyn* Trait: Trait goals during selection in new trait solver 2023-07-06 03:10:11 +00:00
bors
0d50ab7739 Auto merge of #113391 - fee1-dead-contrib:rollup-9bqlw9z, r=fee1-dead
Rollup of 9 pull requests

Successful merges:

 - #111119 (style-guide: Add chapter about formatting for nightly-only syntax)
 - #112791 (llvm ffi: Expose `CallInst->setTailCallKind`)
 - #113145 (style-guide: Document newline rules for assignment operators)
 - #113163 (Add a regression test for #112895)
 - #113332 (resolve: Use `Interned` for some interned structures)
 - #113334 (Revert the lexing of `c"…"` string literals)
 - #113350 (Fix the issue of wrong diagnosis for extern pub fn)
 - #113371 (Fix submodule handling when the current branch is named after a tag)
 - #113384 (style-guide: Clarify grammar for small patterns (not a semantic change))

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-06 02:34:11 +00:00
fee1-dead
c668eb086e
Rollup merge of #113384 - joshtriplett:style-guide-grammar, r=compiler-errors
style-guide: Clarify grammar for small patterns (not a semantic change)

The grammar as written feels ambiguous and confusing, in large part
because it uses square brackets and commas in the names of
non-terminals. Rewrite it to avoid symbols in the names of
non-terminals, and to instead wrap terminals in backquotes.

Also rename "smallntp" to "small_no_tuple" to make it self-describing.
2023-07-06 09:20:35 +08:00
fee1-dead
70e8f9d4c0
Rollup merge of #113371 - jyn514:submodule-with-tags, r=albertlarsan68
Fix submodule handling when the current branch is named after a tag

If:
1. The current branch has the same name as git tag, and
2. The current branch is set to track a remote other than `origin`, and
3. We try to update a submodule

then we'll get the following error:
```
; x c
Updating submodule src/doc/reference
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
fatal: 'personal' does not appear to be a git repository
fatal: Could not read from remote repository.
```

The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote.

Adapt the workaround to strip `heads/` from the output.
2023-07-06 09:20:34 +08:00
fee1-dead
2bc0ae3f33
Rollup merge of #113350 - chenyukang:yukang-fix-113342-parser, r=compiler-errors
Fix the issue of wrong diagnosis for extern pub fn

Fixes #113342
2023-07-06 09:20:34 +08:00
fee1-dead
1830b80c2d
Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errors
Revert the lexing of `c"…"` string literals

Fixes \[after beta-backport\] #113235.
Further progress is tracked in #113333.

This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy)
and git-reverts #111647.

CC `@fee1-dead` (#108801) `@klensy` (#111647)
r? `@compiler-errors`

`@rustbot` label F-c_str_literals beta-nominated
2023-07-06 09:20:33 +08:00
fee1-dead
01627265e3
Rollup merge of #113332 - petrochenkov:bindintern, r=cjgillot
resolve: Use `Interned` for some interned structures

Enough to get rid of all existing `ptr::eq`s and "partial" uses of `Interned`.
2023-07-06 09:20:32 +08:00
fee1-dead
a105aa227f
Rollup merge of #113163 - JohnTitor:issue-112895, r=compiler-errors
Add a regression test for #112895

Closes #112895 if the second option is enough to close the issue
r? `@compiler-errors`
2023-07-06 09:20:32 +08:00
fee1-dead
baba9047eb
Rollup merge of #113145 - joshtriplett:style-guide-document-assignment-newlines, r=joshtriplett
style-guide: Document newline rules for assignment operators

The style guide gives general rules for binary operators including
assignment, and one of those rules says to put the operator on the
subsequent line; the style guide needs to explicitly state the exception
of breaking *after* assignment operators rather than before.

This is already what rustfmt does and what users do; this fixes the
style guide to match the expected default style.
2023-07-06 09:20:32 +08:00
fee1-dead
e461502e06
Rollup merge of #112791 - WaffleLapkin:wag_the_llvm, r=cuviper
llvm ffi: Expose `CallInst->setTailCallKind`

This is needed for the explicit tail calls experiment.
2023-07-06 09:20:31 +08:00
fee1-dead
6e9bdacaf9
Rollup merge of #111119 - compiler-errors:style-nightly, r=joshtriplett
style-guide: Add chapter about formatting for nightly-only syntax

cc `@rust-lang/style`

nightly policy mentioned below is being proposed in https://github.com/rust-lang/style-team/pull/180
2023-07-06 09:20:30 +08:00
Nicholas Nethercote
3078e4d804 Minor comment fix. 2023-07-06 11:07:22 +10:00
Nicholas Nethercote
b51169c178 Remove the field name from MonoItemPlacement::SingleCgu.
It's needless verbosity.
2023-07-06 10:35:57 +10:00
Nicholas Nethercote
22d4c798ec Use iter() instead of iter_mut() in one place. 2023-07-06 10:35:57 +10:00
Nicholas Nethercote
142075a9fb Make UsageMap::get_user_items infallible.
It's nicer this way.
2023-07-06 10:35:57 +10:00
bors
bd8aabef31 Auto merge of #113291 - oli-obk:pretty_print_mir_const, r=RalfJung
Specialize `try_destructure_mir_constant` for its sole user (pretty printing)

We can't remove the query, as we need to invoke it from rustc_middle, but can only implement it in mir interpretation/const eval.

r? `@RalfJung` for a first round.

While we could move all the logic into pretty printing, that would end up duplicating a bit of code with const eval, which doesn't seem great either.
2023-07-06 00:00:38 +00:00
Ben Kimock
4e21e9e039 Remove some unnecessary normalization 2023-07-05 19:52:28 -04:00
Jakub Beránek
12b75fe18b
Fix LLVM config path on Windows 2023-07-06 00:06:24 +02:00
Josh Triplett
79df44ba78 style-guide: Rename "smallntp" non-terminal to "small_no_tuple" for clarity
The meaning of "smallntp" was not immediately obvious at a glance.
Rename it to the self-describing "small_no_tuple"
2023-07-05 14:49:59 -07:00
Josh Triplett
cde67f6557 style-guide: Clarify grammar for small patterns (not a semantic change)
The grammar as written feels ambiguous and confusing, in large part
because it uses square brackets and commas in the names of
non-terminals. Rewrite it to avoid symbols in the names of
non-terminals, and to instead wrap terminals in backquotes.
2023-07-05 14:46:56 -07:00
Josh Triplett
5957f028a1 style-guide: Add chapter for nightly formatting
Co-authored-by: Michael Goulet <michael@errs.io>
2023-07-05 21:40:19 +00:00
Michael Goulet
5a6c618d1a Clarify that style guide does not cover nightly-only features 2023-07-05 21:40:17 +00:00
Michael Goulet
6ce1c89d64
Change comment on TyCtxt::mk_ty_from_kind 2023-07-05 13:58:04 -07:00
bors
d9c13cd453 Auto merge of #113287 - RalfJung:miri-test-libstd, r=JohnTitor
enable test_join test in Miri

Miri for quite a while now has a hack to support self-referential generators: non-`Unique` mutable references are exempt from aliasing conditions. So we can run this test now. (It passes.)

Also extend a comment in a Vec test, while I am at it.
2023-07-05 20:53:38 +00:00
Boxy
12138b8e5e Move TyCtxt::mk_x to Ty::new_x where applicable 2023-07-05 20:27:07 +01:00
Yuki Okushi
40f2fbf61e
Add a regression test for #112895
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-07-06 02:50:22 +09:00
Yuki Okushi
86728e74e0
Add a regression test for #109054
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-07-06 02:45:54 +09:00
Oli Scherer
3dfc7ec05d Patch clippy 2023-07-05 16:16:03 +00:00
bors
5dac6b320b Auto merge of #113370 - compiler-errors:rollup-8gvyy8e, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #113010 (rust-installer & rls: remove exclusion from rustfmt & tidy )
 - #113317 ( -Ztrait-solver=next: stop depending on old solver)
 - #113319 (`TypeParameterDefinition` always require a `DefId`)
 - #113320 (Add some extra information to opaque type cycle errors)
 - #113321 (Move `ty::ConstKind` to `rustc_type_ir`)
 - #113337 (Winnow specialized impls during selection in new solver)
 - #113355 (Move most coverage code out of `rustc_codegen_ssa`)
 - #113356 (Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-05 16:08:43 +00:00
Oli Scherer
e1e04a8bee Document magic boolean 2023-07-05 15:58:19 +00:00
jyn
6c7017fa0a Fix submodule handling when the current branch is named after a tag
If:
1. The current branch has the same name as git tag, and
2. The current branch is set to track a remote other than `origin`, and
3. We try to update a submodule

then we'll get the following error:
```
; x c
Updating submodule src/doc/reference
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
fatal: 'personal' does not appear to be a git repository
fatal: Could not read from remote repository.
```

The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch
from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git
submodule update` that uses the wrong remote.

Adapt the workaround to strip `heads/` from the output.
2023-07-05 10:56:41 -05:00