Commit Graph

262708 Commits

Author SHA1 Message Date
bors
e552c168c7 Auto merge of #128420 - weihanglo:update-cargo, r=weihanglo
Update cargo

5 commits in b5d44db1daf0469b227a6211b987162a39a54730..257b72b8adfb1f2aa9916cefca67285c21666276
2024-07-26 21:27:12 +0000 to 2024-07-30 15:08:27 +0000
- chore: Update toml (rust-lang/cargo#14324)
- dont call wrap in a no-op source_id::with* (rust-lang/cargo#14318)
- Partial revert of 3085b548ecbd7d29d40c6180609ea3c224bad857 (rust-lang/cargo#14319)
- chore(deps): update msrv (rust-lang/cargo#14303)
- Fix warnings building tests on Windows (rust-lang/cargo#14315)

r? ghost
2024-07-31 10:14:22 +00:00
bors
50d51fb1bf Auto merge of #3778 - RalfJung:fd, r=oli-obk
FD: refactor API names a little

I feel like these two functions are different enough that their names should not indicate complete symmetry. I am not sure what the best names would be, though... `@oli-obk` any opinions?
2024-07-31 09:15:24 +00:00
bors
9fb03f0f21 Auto merge of #17747 - ShoyuVanilla:issue-17734, r=Veykril
fix: Errors on method call inferences with elided lifetimes

Fixes #17734

Currently, we are matching non-lifetime(type or const) generic arg to liftime argument position while building substs for method calling when there are elided lifetimes.
This mismatch just make a subst for error lifetime and while this alone is not much a trouble, it also makes the mismatched type or const generic arg cannot be used in its proper place and this makes type inference failure
2024-07-31 07:09:57 +00:00
Zalathar
dd5a8d7714 Use a separate pattern type for rustc_pattern_analysis diagnostics
The pattern-analysis code needs to print patterns, as part of its user-visible
diagnostics. But it never actually tries to print "real" patterns! Instead, it
only ever prints synthetic patterns that it has reconstructed from its own
internal represenations.

We can therefore simultaneously remove two obstacles to changing `thir::Pat`,
by having the pattern-analysis code use its own dedicated type for building
printable patterns, and then making `thir::Pat` not printable at all.
2024-07-31 16:03:27 +10:00
Zalathar
a9ea85e044 Revert "Make thir::Pat not implement fmt::Display directly"
This reverts commit ae0ec731a8.

The original change in #128304 was intended to be a step towards being able to
print `thir::Pat` even after switching to `PatId`.

But because the only patterns that need to be printed are the synthetic ones
created by pattern analysis (for diagnostic purposes only), it makes more sense
to completely separate the printable patterns from the real THIR patterns.
2024-07-31 16:00:52 +10:00
Zalathar
a2b3256374 Print thir::PatRange, not its surrounding thir::Pat
This further reduces the amount of code that relies on `thir::Pat` being
printable.
2024-07-31 16:00:52 +10:00
Ralf Jung
6f48edfd09 FD table: rename dup to get_ref 2024-07-31 07:53:11 +02:00
Michael Goulet
f6f587e7ea Introduce REDUNDANT_IMPORTS lint 2024-07-31 00:07:42 -04:00
Nicholas Nethercote
fe647f0538 Remove LhsExpr.
`parse_expr_assoc_with` has an awkward structure -- sometimes the lhs is
already parsed. This commit splits the post-lhs part into a new method
`parse_expr_assoc_rest_with`, which makes everything shorter and
simpler.
2024-07-31 12:56:25 +10:00
Nicholas Nethercote
281c2fd5bf Inline and remove parse_local_mk.
It has a single use. This makes the `let` handling case in
`parse_stmt_without_recovery` more similar to the statement path and
statement expression cases.
2024-07-31 12:08:55 +10:00
Shoyu Vanilla
1b058b796d
Add a test case 2024-07-31 10:47:13 +09:00
Weihang Lo
d629d5f7b8
Update cargo 2024-07-30 21:26:49 -04:00
Josh Stone
33a36ea438 Bless coverage/mcdc for line number changes 2024-07-30 18:25:05 -07:00
Matthew Maurer
7d7ad7b874 android: Remove libstd hacks for unsupported Android APIs
Our minimum supported API version is 21, remove hacks to support older
Android APIs.
2024-07-31 01:03:36 +00:00
Camille GILLOT
4067795d8c Do not intern if we have provenance. 2024-07-31 00:59:13 +00:00
Camille GILLOT
98c1ea8e82 Simplify constant creation. 2024-07-31 00:59:13 +00:00
Camille GILLOT
61ef0441b8 Encode constant determinism in disambiguator. 2024-07-31 00:59:12 +00:00
Camille GILLOT
9d23c86176 Reduce allocations in GVN. 2024-07-31 00:59:12 +00:00
Camille GILLOT
70ee6e4b23 Amortize growing rev_locals. 2024-07-31 00:59:12 +00:00
Camille GILLOT
95986dd279 Indirect places can only appear as first projection in runtime MIR. 2024-07-31 00:59:12 +00:00
Camille GILLOT
a0b4d6dfb8 Do not normalize constants eagerly. 2024-07-31 00:59:12 +00:00
bors
83dcdb3a5d Auto merge of #128075 - Oneirical:try-your-damnetest, r=jieyouxu
Migrate `rlib-format-packed-bundled-libs-2`, `native-link-modifier-whole-archive` and `no-builtins-attribute` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Please try:

try-job: x86_64-msvc
try-job: test-various
try-job: armhf-gnu
try-job: aarch64-apple
try-job: x86_64-gnu-llvm-18
2024-07-31 00:36:46 +00:00
EtomicBomb
bd23e0eb26 canonicalize path in another place to fix #128411 2024-07-31 00:20:56 +00:00
carbotaniuman
49db8a5a99 Add toggle for parse_meta_item unsafe parsing
This makes it possible for the `unsafe(...)` syntax to only be
valid at the top level, and the `NestedMetaItem`s will automatically
reject `unsafe(...)`.
2024-07-30 18:28:43 -05:00
Josh Stone
2e9298b2fc Bump src/stage0 with determinism 2024-07-30 15:16:35 -07:00
Josh Stone
3659d9d2e4 bump-stage0: use IndexMap for determinism
When it used `HashMap`, `bump-stage0` would change `src/stage0` every
time it ran, whereas `IndexMap` will keep insertion order -- matching
the manifest file.
2024-07-30 15:13:58 -07:00
bors
249cf71f11 Auto merge of #128413 - matthiaskrgr:rollup-nrfcvdq, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #128357 (Detect non-lifetime binder params shadowing item params)
 - #128367 (CI: rfl: build the generated doctests and documentation)
 - #128376 (Mark `Parser::eat`/`check` methods as `#[must_use]`)
 - #128379 (the output in stderr expects panic-unwind)
 - #128380 (make `///` doc comments compatible with naked functions)
 - #128382 (cargo-miri: better error when we seem to run inside bootstrap but something is wrong)
 - #128398 (tidy: Fix quote in error message)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-30 21:50:34 +00:00
Matthias Krüger
42a0cc8e71
Rollup merge of #128398 - awilfox:awilfox/fix-tidy-quote, r=jieyouxu
tidy: Fix quote in error message

I noticed that the backticks around the error code wasn't done properly in this string when I was building Rust 1.80.0 and found it is still this way in nightly.  Example:

```
warning: Error code `E0595` needs to have at least one UI test in the `tests/error-codes/` directory`!
warning: Error code E0602`` has a UI test file, but doesn't contain its own error code!
warning: Error code `E0619` needs to have at least one UI test in the `tests/error-codes/` directory`!
```

This commit fixes it to match the other warning strings.
2024-07-30 22:51:40 +02:00
Matthias Krüger
49327a04a2
Rollup merge of #128382 - RalfJung:cargo-miri-assert, r=oli-obk
cargo-miri: better error when we seem to run inside bootstrap but something is wrong

Cc https://github.com/rust-lang/miri/issues/3775
2024-07-30 22:51:40 +02:00
Matthias Krüger
e6a82d2878
Rollup merge of #128380 - folkertdev:naked-compatible-doc-comment, r=bjorn3
make `///` doc comments compatible with naked functions

tracking issue: https://github.com/rust-lang/rust/issues/90957

reported in https://github.com/rust-lang/rust/pull/127853#issuecomment-2257323333

it turns out `/// doc comment` and `#[doc = "doc comment"]` are represented differently, at least at the point where we perform the check for what should be allowed. The `///` style doc comment is now also allowed.

r? ``@bjorn3``

cc ``@hsanzg``
2024-07-30 22:51:39 +02:00
Matthias Krüger
7ea1f7265f
Rollup merge of #128379 - Dajamante:aïssata_needs_unwind, r=pietroalbini
the output in stderr expects panic-unwind

r​? ``@pietroalbini``
2024-07-30 22:51:39 +02:00
Matthias Krüger
6f0b237c72
Rollup merge of #128376 - compiler-errors:finish-ur-vegetables, r=jieyouxu
Mark `Parser::eat`/`check` methods as `#[must_use]`

These methods return a `bool`, but we probably should either use these values or explicitly throw them away (e.g. when we just want to unconditionally eat a token if it exists).

I changed a few places from `eat` to `expect`, but otherwise I tried to leave a comment explaining why the `eat` was okay.

This also adds a test for the `pattern_type!` macro, which used to silently accept a missing `is` token.
2024-07-30 22:51:38 +02:00
Matthias Krüger
894db1f22f
Rollup merge of #128367 - ojeda:rfl-ci-build-doctests-and-docs, r=Kobzol
CI: rfl: build the generated doctests and documentation

Cc ``@tgross35``
r? ``@Kobzol``
try-job: x86_64-rust-for-linux
2024-07-30 22:51:37 +02:00
Matthias Krüger
40edd4f1c6
Rollup merge of #128357 - compiler-errors:shadowed-non-lifetime-binder, r=petrochenkov
Detect non-lifetime binder params shadowing item params

We should check that `for<T>` shadows `T` from an item in the same way that `for<'a>` shadows `'a` from an item.

r? ``@petrochenkov`` since you're familiar w the nuances of rib kinds
2024-07-30 22:51:37 +02:00
Michael Goulet
e65777301b Remove crate_level_only from ELIDED_LIFETIMES_IN_PATHS 2024-07-30 16:42:53 -04:00
Ralf Jung
6283c4dae6 FD: refactor API names a little 2024-07-30 22:32:33 +02:00
Chris Denton
9169622027
Move Windows implementation of anon pipe 2024-07-30 19:23:52 +00:00
beetrees
fe6478cc53
Match LLVM ABI in extern "C" functions for f128 on Windows 2024-07-30 20:23:33 +01:00
Chris Denton
a75d2f9d38
Cleanup sys module to match house style 2024-07-30 19:22:54 +00:00
Ding Xiang Fei
e7f89a7eea
derive(SmartPointer): rewrite bounds in where and generic bounds 2024-07-30 21:14:10 +02:00
Oneirical
01a266206b rewrite and rename issue-69368 to rmake 2024-07-30 14:44:14 -04:00
bors
f8060d282d Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68
Bump bootstrap compiler to new beta

https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-07-30 17:49:08 +00:00
Shoyu Vanilla
a2555b976a fix: Errors on method call inferences with elided lifetimes 2024-07-31 02:36:44 +09:00
binarycat
ebd6718218 tidy
this commit cannot easily be squashed, since there is already a
PR based on the previous commit.
2024-07-30 13:33:36 -04:00
Oneirical
dcaa17a661 invalid stdout_utf8 handling in run_make_support 2024-07-30 13:07:54 -04:00
Oneirical
689bb118ce rewrite symbol-visibility to rmake 2024-07-30 13:07:54 -04:00
binarycat
4feb949617 migrate fmt-write-bloat to rmake 2024-07-30 12:19:57 -04:00
Amanieu d'Antras
bb58488207 Rewrite binary search implementation
This restores the original binary search implementation from #45333
which has the nice property of having a loop count that only depends on
the size of the slice. This, along with explicit conditional moves
from #128250, means that the entire binary search loop can be perfectly
predicted by the branch predictor.

Additionally, LLVM is able to unroll the loop when the slice length is
known at compile-time. This results in a very compact code sequence of
3-4 instructions per binary search step and zero branches.

Fixes #53823
2024-07-30 17:07:56 +01:00
bors
006c8df322 Auto merge of #124339 - oli-obk:supports_feature, r=wesleywiser
allow overwriting the output of `rustc --version`

Our wonderful bisection folk [have to work around](https://github.com/rust-lang/rust/issues/123276#issuecomment-2075001510) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for.

This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by

* choosing when to update rustc
* choosing when to update dependencies
* choosing which nightly features they are willing to take the breakage for

The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency.

This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too.

This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_OVERRIDE_VERSION_STRING` env var. The bisection issue is then fixed by https://github.com/rust-lang/cargo-bisect-rustc/pull/335.

I mainly want to establish a compiler team policy:

> We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to.

Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection.

I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
2024-07-30 15:25:31 +00:00
Mark Rousskov
abb1ebaae1 Revert "opt-dist: dont overrwite config.toml when verifying"
This reverts commit c81a40bbc0.
2024-07-30 11:03:03 -04:00