Commit Graph

253375 Commits

Author SHA1 Message Date
Guillaume Gomez
a60ccc1876
Rollup merge of #124252 - michaelwoerister:better-forbidden-read-ice, r=oli-obk
Improve ICE message for forbidden dep-graph reads.

The new message mentions the main context that the ICE might occur in and it mentions the query/dep-node that is being read.

cc https://github.com/rust-lang/rust/pull/123781, where this would have been helpful.
2024-04-22 20:26:00 +02:00
Guillaume Gomez
6a326d889a
Rollup merge of #124230 - reitermarkus:generic-nonzero-stable, r=dtolnay
Stabilize generic `NonZero`.

Tracking issue: https://github.com/rust-lang/rust/issues/120257

r? `@dtolnay`
2024-04-22 20:26:00 +02:00
Guillaume Gomez
17c28799f3
Rollup merge of #124217 - Zalathar:pre-branch, r=oli-obk
coverage: Prepare for improved branch coverage

When trying to rebase my new branch coverage work (including #124154) on top of the introduction of MC/DC coverage (#123409), I found it a lot harder than anticipated. With the benefit of hindsight, the branch coverage code and MC/DC code have become more interdependent than I'm happy with.

This PR therefore disentangles them a bit, so that it will be easier for both areas of code to evolve independently without interference.

---

This PR also includes a few extra branch coverage tests that I had sitting around from my current branch coverage work. They mostly just demonstrate that certain language constructs listed in #124118 currently don't have branch coverage support.

``@rustbot`` label +A-code-coverage
2024-04-22 20:25:59 +02:00
Guillaume Gomez
e984447405
Rollup merge of #124183 - compiler-errors:unnecessary-by-ref, r=oli-obk
Stop taking `ParamTy`/`ParamConst`/`EarlyParamRegion`/`AliasTy` by ref

It's unnecessary and is annoying when we have it by value.
2024-04-22 20:25:59 +02:00
Guillaume Gomez
1a12ec41e9
Rollup merge of #124178 - GuillaumeGomez:llvm-backend, r=oli-obk
[cleanup] [llvm backend] Prevent creating the same `Instance::mono` multiple times

Just a little thing I came across while going through the code.

r? ```@oli-obk```
2024-04-22 20:25:58 +02:00
Guillaume Gomez
206e0df78d
Rollup merge of #115913 - FedericoStra:checked_ilog, r=the8472
checked_ilog: improve performance

Addresses #115874.

(This PR replicates the original #115875, which I accidentally closed by deleting my forked repository...)
2024-04-22 20:25:58 +02:00
Ralf Jung
8d5c47f17f miri libstd tests: test windows-msvc instead of windows-gnu 2024-04-22 19:50:09 +02:00
Ralf Jung
df437a2af4 remove an unused type from the reentrant lock tests 2024-04-22 19:36:21 +02:00
bjorn3
498dbbd018 Fix warning in alloc_system.rs 2024-04-22 17:10:30 +00:00
bjorn3
569df1dad3 Inline CValue::pointer_from_data_and_meta
It only has a single use and doesn't need access to CValue internals.
2024-04-22 17:03:48 +00:00
rustbot
9ed562f9e7 Update books 2024-04-22 13:00:54 -04:00
bjorn3
8bf1687879 Fix neon test on non arm64 targets 2024-04-22 16:57:07 +00:00
bjorn3
d0c5141257 Rustup to rustc 1.79.0-nightly (fb898629a 2024-04-21) 2024-04-22 16:56:37 +00:00
Markus Reiter
33e68aadc9
Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
bjorn3
8bc15fb2da Sync from rust fb898629a2 2024-04-22 16:37:40 +00:00
bjorn3
a74d6c2125 Only apply --cap-lints to the extended_sysroot test suite 2024-04-22 16:32:30 +00:00
Michael Goulet
7789874e6e Deny gen keyword in edition_2024_compat lints 2024-04-22 11:51:50 -04:00
Sasha Pourcelot
98332c108b Improve handling of expr->field errors
The current message for "`->` used for field access" is the following:

```rust
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `->`
 --> src/main.rs:2:6
  |
2 |     a->b;
  |      ^^ expected one of 8 possible tokens
```

(playground link[1])

This PR tries to address this by adding a dedicated error message and recovery. The proposed error message is:

```
error: `->` used for field access or method call
 --> ./tiny_test.rs:2:6
  |
2 |     a->b;
  |      ^^ help: try using `.` instead
  |
  = help: the `.` operator will dereference the value if needed
```

(feel free to bikeshed it as much as necessary)

[1]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7f8b6f4433aa7866124123575456f54e

Signed-off-by: Sasha Pourcelot <sasha.pourcelot@protonmail.com>
2024-04-22 17:47:35 +02:00
long-long-float
31e581ec12 Wrap dyn type with parentheses in suggestion 2024-04-23 00:15:10 +09:00
Oli Scherer
6bff7f45f1 Use DefiningOpaqueTypes::Yes, as the InferCtxt we use has no opaque types it may define 2024-04-22 13:11:29 +00:00
Michael Woerister
6146a51f17 Add more context to the forbidden dep-graph read ICE error message. 2024-04-22 14:54:28 +02:00
Daria Sukhonina
67980dd6fb
Fix typo in the has_surface_drop's doc comment
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2024-04-22 15:44:01 +03:00
Daria Sukhonina
a9c7465997 Fix copy-paste typo in the comment within consider_builtin_async_destruct_candidate 2024-04-22 15:42:07 +03:00
Daria Sukhonina
0881e3e531 Exhaustivelly match TyKind in consider_builtin_async_destruct_candidate 2024-04-22 15:41:08 +03:00
bors
7f2fc33da6 Auto merge of #115120 - icedrocket:ignore-strip-on-msvc, r=michaelwoerister
Ignore `-C strip` on MSVC

tl;dr - Define `-Cstrip` to only ever affect the binary; no other build artifacts.

This is necessary to improve cross-platform behavior consistency: if someone wanted debug information to be contained only in separate files on all platforms, they would set `-Cstrip=symbols` and `-Csplit-debuginfo=packed`, but this would result in no PDB files on MSVC.

Resolves #114215
2024-04-22 12:05:39 +00:00
Zalathar
2b6adb06fb coverage: Separate branch pairs from other mapping kinds
This clears the way for larger changes to how branches are handled by the
coverage instrumentor, in order to support branch coverage for more language
constructs.
2024-04-22 21:55:34 +10:00
Zalathar
b5a22be6a3 coverage: Move some helper code into BranchInfoBuilder 2024-04-22 21:55:33 +10:00
Zalathar
97bf553682 coverage: Detach MC/DC branch spans from regular branch spans
MC/DC's reliance on the existing branch coverage types is making it much harder
to improve branch coverage.
2024-04-22 21:55:33 +10:00
Zalathar
a892c2387e coverage: Add a mir-opt test for branch coverage of match arms 2024-04-22 21:55:33 +10:00
Zalathar
da37b14121 coverage: Move mir-opt coverage tests into a subdirectory 2024-04-22 21:55:33 +10:00
Zalathar
3de87feba2 coverage: Branch coverage tests for match arms 2024-04-22 21:55:33 +10:00
Zalathar
7f432dfb23 coverage: Branch coverage test for if-let and let-chains 2024-04-22 21:55:33 +10:00
Zalathar
4f7a47798e coverage: Branch coverage test for let-else 2024-04-22 21:55:33 +10:00
Michael Woerister
c373ec07c4 Improve ICE message for forbidden dep-graph reads. 2024-04-22 12:11:07 +02:00
bors
290d792411 Auto merge of #124250 - matthiaskrgr:rollup-b8tqsup, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #124240 (add a couple tests for fixed ICEs.)
 - #124245 (bootstrap: Promote some build_steps comments to docs)
 - #124246 (Add comma at one place in `abs()` documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-22 10:01:27 +00:00
Matthias Krüger
c597ccf3f1
Rollup merge of #124246 - gurry:add-comma-in-abs-doc, r=jhpratt
Add comma at one place in `abs()` documentation

As suggested  by ``@RalfJung`` here: https://github.com/rust-lang/rust/pull/124184#discussion_r1573670533
2024-04-22 10:02:56 +02:00
Matthias Krüger
e4e660ef5d
Rollup merge of #124245 - workingjubilee:bootstrap-some-doc-comments, r=onur-ozkan
bootstrap: Promote some build_steps comments to docs

No new content, just makes some comments readable when viewing the docs with `--document-private-items`.
2024-04-22 10:02:55 +02:00
Matthias Krüger
3cd56f3bda
Rollup merge of #124240 - matthiaskrgr:tests_sunday, r=compiler-errors
add a couple tests for fixed ICEs.

Fixes https://github.com/rust-lang/rust/issues/121413
Fixes https://github.com/rust-lang/rust/issues/121463
Fixes https://github.com/rust-lang/rust/issues/114463
2024-04-22 10:02:55 +02:00
bors
b3e117044c Auto merge of #124236 - matthiaskrgr:n-ice, r=jieyouxu
crashes: add a couple more ICE tests
2024-04-22 07:57:04 +00:00
bors
32885838c0 Auto merge of #124112 - beetrees:incremental-os-str, r=Nadrieril
Fix ICE when there is a non-Unicode entry in the incremental crate directory

Fix the ICE that occurs when there is a non-Unicode entry in the incremental crate directory by replacing uses of `to_string_lossy` + `assert_no_characters_lost` with `to_str`. The added test would cause the compiler to ICE before this PR.
2024-04-22 04:00:58 +00:00
Gurinder Singh
06cd79bb5b Fix ICE when ADT tail has type error 2024-04-22 09:12:36 +05:30
Gurinder Singh
f31e4aef0b Add comma at one place in abs() documentation 2024-04-22 08:16:47 +05:30
bors
eb70af2e03 Auto merge of #124244 - saethlin:stdarch, r=workingjubilee
Update stdarch submodule

Most importantly, this pulls in https://github.com/rust-lang/stdarch/pull/1567 which is part of https://github.com/rust-lang/rust/pull/124050
2024-04-22 01:56:40 +00:00
Jubilee Young
9470e05550 bootstrap: Promote some build_steps comments to docs 2024-04-21 18:55:53 -07:00
Ben Kimock
9989d009c4 Update stdarch submodule 2024-04-21 21:35:17 -04:00
Michael Goulet
8995c2c4a2 Use sup instead of eq when unifying self type 2024-04-21 20:10:12 -04:00
Michael Goulet
93c6c0445d Restore error messaging 2024-04-21 20:10:12 -04:00
Michael Goulet
9d4f1d8b7e Check that predicate may hold BEFORE registering it in ocx 2024-04-21 20:10:12 -04:00
Michael Goulet
d9fec1321a Normalize xform_ret_ty after constrained 2024-04-21 20:10:12 -04:00
Michael Goulet
ff4653a08f Use fulfillment, not evaluate, during method probe 2024-04-21 20:10:12 -04:00