Commit Graph

254086 Commits

Author SHA1 Message Date
许杰友 Jieyou Xu (Joe)
7350a7fa4f
Rollup merge of #124561 - GuillaumeGomez:run-make-normalize, r=jieyouxu
Add `normalize()` in run-make `Diff` type

I need it to do the same as:

```
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
```

in doctests.

I need it in particular for the https://github.com/rust-lang/rust/pull/123974 PR (which contains this commit until this PR current PR is merged).

cc `@Urgau`
r? `@jieyouxu`
2024-04-30 19:29:52 +01:00
许杰友 Jieyou Xu (Joe)
9ef81e0146
Rollup merge of #124553 - ferrocene:pa-cargo-git-info, r=onur-ozkan
Write `git-commit-{sha,info}` for Cargo in source tarballs

Right now Cargo doesn't populate the commit hash or date in its version output when it's built from the plain source tarball. That's because we don't include the git information for it, and Cargo's build script doesn't pick it up.

This PR *partially* solves the problem by storing the git information for Cargo in `src/tools/cargo` in the plain source tarball. We store separate information because even when built in CI Cargo uses its own git information rather than Rust's.

This PR will also require a change in the Cargo repository to consume this information (https://github.com/rust-lang/cargo/pull/13832), but it doesn't have to be blocked on the Cargo PR being merged.
2024-04-30 19:29:52 +01:00
许杰友 Jieyou Xu (Joe)
4b6c1918ee
Rollup merge of #124299 - clubby789:106269-test, r=nikic
Add test for issue 106269

Closes #106269

Made this an assembly test as the LLVM codegen is still quite verbose and doesn't really indicate the behaviour we want
2024-04-30 19:29:51 +01:00
许杰友 Jieyou Xu (Joe)
ce18639b92
Rollup merge of #124280 - beetrees:repr128-test-rmake, r=jieyouxu
Port repr128-dwarf run-make test to rmake

This PR ports the repr128-dwarf run-make test to rmake, using the `gimli` crate instead of the `llvm-dwarfdump` command.

Note that this PR changes `rmake.rs` files to be compiled with the 2021 edition (previously no edition was passed to `rustc`, meaning they were compiled with the 2015 edition). This means that `panic!("{variable}")` will now work as expected in `rmake.rs` files (there's already a usage in the [wasm-symbols-not-exported test](aca749eefc/tests/run-make/wasm-symbols-not-exported/rmake.rs (L34)) that this will fix).

Tracking issue: #121876
2024-04-30 19:29:51 +01:00
Daniel Paoliello
bc294b857e Use Server 2022 in CI for mingw jobs 2024-04-30 09:50:55 -07:00
beetrees
c2fd6ed235
Port repr128-dwarf run-make test to rmake 2024-04-30 17:50:49 +01:00
Guillaume Gomez
e0ec71f154 Add normalize() in run-make Diff type 2024-04-30 18:06:48 +02:00
clubby789
7032c92b33 Add test for efficient codegen of manual eq implementations of a small struct 2024-04-30 13:21:08 +00:00
bors
20aa2d81e3 Auto merge of #124558 - matthiaskrgr:rollup-axi1bxu, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #123247 (Mention Both HRTB and Generic Lifetime Param in `E0637` documentation)
 - #124511 (Remove many `#[macro_use] extern crate foo` items)
 - #124550 (Remove redundant union check in `KnownPanicsLint` const prop)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-30 13:13:54 +00:00
Matthias Krüger
5a4e83c2e0
Rollup merge of #124550 - gurry:remove-redundant-code, r=oli-obk
Remove redundant union check in `KnownPanicsLint` const prop

Removes the below check which prevents unions from being const propagated:f9dca46218/compiler/rustc_mir_transform/src/known_panics_lint.rs (L587-L594)

It is not needed because after PR #124504 we mark unions as `NoPropagation` over here: f9dca46218/compiler/rustc_mir_transform/src/known_panics_lint.rs (L899-L902) which is enough to prevent them from being const propagated.
2024-04-30 15:04:09 +02:00
Matthias Krüger
784316eadc
Rollup merge of #124511 - nnethercote:rm-extern-crates, r=fee1-dead
Remove many `#[macro_use] extern crate foo` items

This requires the addition of more `use` items, which often make the code more verbose. But they also make the code easier to read, because `#[macro_use]` obscures where macros are defined.

r? `@fee1-dead`
2024-04-30 15:04:08 +02:00
Matthias Krüger
7427812261
Rollup merge of #123247 - veera-sivarajan:fix-error-code-E0637-example-code, r=fmease
Mention Both HRTB and Generic Lifetime Param in `E0637` documentation

The compiler (rustc 1.77.0) error for `and_without_explicit_lifetime()` in the erroneous code example suggests using a HRTB. But, the corrected example uses an explicit lifetime parameter.

This PR fixes it so that the documentation and the compiler suggestion for error code `E0637` are consistent with each other.
2024-04-30 15:04:08 +02:00
bors
d8e76ecaf1 Auto merge of #12596 - ARandomDev99:issue-12595, r=Alexendoo
Modify lint pass note for consistency with the book

This PR:
- removes the note which appears when an early lint pass is created using `cargo dev new_lint`.
- adds a note that encourages contributors to use an early pass unless type information is needed if a late lint pass is created using `cargo dev new_lint`.

Late pass remains the default value if no pass is specified as most lints use late pass.

Closes #12595

changelog: none
2024-04-30 12:51:27 +00:00
bors
a7431167e0 Auto merge of #124545 - Zalathar:mappings, r=oli-obk
coverage: Split off `mappings.rs` from `spans.rs` and `from_mir.rs`

Originally, `spans.rs` was mainly concerned with extracting and post-processing spans from MIR, so that they could be used for block coverage instrumentation.

Over time it has organically expanded to include more responsibilities, especially relating to branch coverage and MC/DC coverage, that don't really fit its current name.

This PR therefore takes all the extra code that is *not* part of the old span-refinement engine, and moves it out into a new `mappings.rs` file.

---

No functional changes. I have deliberately avoided doing any follow-up (such as renaming types or functions), because this particular change is very rot-prone, and I want it to be as simple and self-contained as possible.

`@rustbot` label +A-code-coverage
2024-04-30 11:08:12 +00:00
Gurinder Singh
741d40f327 Remove redundant union check in `KnownPanicsLint const prop
because we are already marking unions `NoPropagation` in
`CanConstProp::check()`. That is enough to prevent any attempts
at const propagating unions and this second check is not needed.

Also improve a comment in `CanConstProp::check()`
2024-04-30 15:17:47 +05:30
Pietro Albini
7a5038fb49
write git-commit-{sha,info} for Cargo in source tarballs
This will allow Cargo's build script to pick it up, and populate the
correct git information in its version output.
2024-04-30 11:31:27 +02:00
bors
47314eb427 Auto merge of #124399 - ZhuUx:split-mcdc, r=Zalathar
Split mcdc code to a sub module of coverageinfo

A further work from #124217 . I have made relatively large changes when working on #124278 so that it would better split them from `coverageinfo.rs` to avoid potential troubling merge work with improved branch coverage by `@Zalathar` .

Besides `BlockMarkerGenerator` is added to avoid ownership problems (mostly needed for following change of #124278 )

All code changes are done in [a37d737a](a3d737a086) while the second commit just renames the file.

cc `@RenjiSann` `@Zalathar`
This will impact your current work.
2024-04-30 09:03:56 +00:00
Jonathan Pallant
fcaba9ce5c
arm target docs: clarify A32/T32/Arm ISA/Thumb ISA/Thumb-2 ISA 2024-04-30 10:01:09 +01:00
Jonathan Pallant
de0c02c9ab
Recapitalise ARMvX{-Y} to ArmvX{-Y}
Yes it looks weird, but this is how Arm write it now.

I left ARM64 alone, because it's a Microsoft/Apple term but not an Arm term (they have Armv8-A and Armv9-A architectures, which say that A64 instructions are executed when in the Aarch64 state), and I don't want to get into that, especially for a Tier 1 target.
2024-04-30 10:01:08 +01:00
Miguel Ojeda
7e4955e502 rustc: document the jobserver
Explicitly document that the jobserver may be used by `rustc` and show
the warning to increase the chances that this document is found when
searching for solutions online.

In particular, add a section about the interaction with build systems,
which is intended to contain recommendations on how to integrate `rustc`
with different built systems.

For GNU Make, recommend using the `+` indicator. In addition, add a
note about the issue with GNU Make 4.3 since it is important that users
realize they should do this even if they do not expect parallelism from
`rustc`.  Finally, show how to workaround the issue of `$(shell ...)`
calls in recursive Make (which e.g. was needed for the Linux kernel).

The GNU Make 4.4 case under `--jobserver-style=pipe` is not added since
it got fixed after Rust 1.76.0 already (i.e. `rustc` will not warn if
it finds the negative file descriptors).

For CMake, recommend using `JOB_SERVER_AWARE` and show a workaround using
`$(MAKE)` for earlier versions (when using the Makefile generator).

From: https://github.com/rust-lang/rust/issues/120515
Cc: @petrochenkov @belovdv @weihanglo @bjorn3
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-04-30 09:43:42 +02:00
bors
72f616273c Auto merge of #124366 - Kobzol:remove-yaml-expansion, r=pietroalbini
CI: remove `expand-yaml-anchors`

This PR unifies all CI outcome jobs in a single job, and then removes the `expand-yaml-anchors` tool, since it is no longer needed after this change.

I have tested try builds for both situations with the new `outcome` job (note that these two workflow runs use a different step structure in the outcome job, I have simplified it since):
- [Success](https://github.com/rust-lang-ci/rust/actions/runs/8831529677/job/24251135366)
- [Failure](https://github.com/rust-lang-ci/rust/actions/runs/8833052319/job/24251628792)

r? `@ghost`
2024-04-30 06:59:00 +00:00
Nicholas Nethercote
2088de2889 Remove extern crate scoped_tls from stable_mir. 2024-04-30 16:47:49 +10:00
Nicholas Nethercote
6341935a13 Remove extern crate tracing from numerous crates. 2024-04-30 16:47:49 +10:00
bors
f973a15a10 Auto merge of #124547 - matthiaskrgr:rollup-9tv8upg, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #124519 (adapt a codegen test for llvm 19)
 - #124524 (Add StaticForeignItem and use it on ForeignItemKind)
 - #124540 (Give proof tree visitors the ability to instantiate nested goals directly)
 - #124543 (codegen tests: Tolerate `range()` qualifications in enum tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-30 04:52:01 +00:00
Matthias Krüger
d81e444c8e
Rollup merge of #124543 - maurer:llvm-range, r=nikic
codegen tests: Tolerate `range()` qualifications in enum tests

Current LLVM can infer range bounds on the i8s involved with these tests, and annotates it. Accept these bounds if present.

`@rustbot` label: +llvm-main

cc `@durin42`
2024-04-30 06:43:43 +02:00
Matthias Krüger
ed00f668ac
Rollup merge of #124540 - compiler-errors:nested-goals, r=lcnr
Give proof tree visitors the ability to instantiate nested goals directly

Useful when we want to look at the nested goals but not necessarily visit them (e.g. in select).

r? lcnr
2024-04-30 06:43:43 +02:00
Matthias Krüger
fc15bc169e Rollup merge of #124524 - spastorino:make-foreign-static-use-struct, r=oli-obk
Add StaticForeignItem and use it on ForeignItemKind

This is in preparation for unsafe extern blocks that adds a safe variant for functions inside extern blocks.

r? `@oli-obk`
cc `@compiler-errors`
2024-04-30 06:43:42 +02:00
Matthias Krüger
ea3d99eaa8
Rollup merge of #124524 - spastorino:make-foreign-static-use-struct, r=oli-obk
Add StaticForeignItem and use it on ForeignItemKind

This is in preparation for unsafe extern blocks that adds a safe variant for functions inside extern blocks.

r? `@oli-obk`
cc `@compiler-errors`
2024-04-30 06:43:42 +02:00
Matthias Krüger
f4c9f29f27
Rollup merge of #124519 - krasimirgg:test-ranges, r=nikic
adapt a codegen test for llvm 19

No functional changes intended.

Found by our experimental rust + LLVM @ HEAD bot:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/27747#018f2570-018c-4b12-9c5a-38cf81453683/957-965

`@rustbot` label: +llvm-main
r? `@durin42`
2024-04-30 06:43:42 +02:00
zhuyunxing
6c8b492f02 coverage. Split mcdc builder to a sub module of coverageinfo 2024-04-30 12:17:35 +08:00
zhuyunxing
e198c51f16 coverage. Add MCDCInfoBuilder to isolate all mcdc stuff from BranchInfoBuilder 2024-04-30 12:17:25 +08:00
zhuyunxing
a76e250abd coverage. Add BlockMarkerGen to avoid ownership gymnastics 2024-04-30 11:19:23 +08:00
Zalathar
ba87e5bb3e coverage: Split off mappings.rs from spans.rs and from_mir.rs 2024-04-30 13:17:21 +10:00
Zalathar
7d1c6af3dc coverage: Prepare to split spans.rs into two files 2024-04-30 13:16:58 +10:00
bors
f9dca46218 Auto merge of #124507 - Zalathar:coverage-level, r=compiler-errors
coverage: Replace boolean options with a `CoverageLevel` enum

After #123409, and some discussion at https://github.com/rust-lang/rust/issues/79649#issuecomment-2042093553 and #124120, it became clear to me that we should have a unified concept of “coverage level”, instead of having several separate boolean flags that aren't actually independent.

This PR therefore introduces a `CoverageLevel` enum, to replace the existing boolean flags for `branch` and `mcdc`.

The `no-branch` value (for `-Zcoverage-options`) has been renamed to `block`, instructing the compiler to only instrument for block coverage, with no branch coverage or MD/DC instrumentation.

`@rustbot` label +A-code-coverage
cc `@ZhuUx` `@Lambdaris` `@RenjiSann`
2024-04-30 02:47:25 +00:00
bors
4bee9788a8 Auto merge of #124398 - klensy:trailing-ws, r=compiler-errors
tests: remove some trailing ws

Cleans one more case of trailing whitespace in tests.
2024-04-30 00:42:32 +00:00
bors
74a8df6c65 Auto merge of #124398 - klensy:trailing-ws, r=compiler-errors
tests: remove some trailing ws

Cleans one more case of trailing whitespace in tests.
2024-04-30 00:42:32 +00:00
Matthew Maurer
8101884b37 codegen tests: Tolerate range() qualifications in enum tests
Current LLVM can infer range bounds on the i8s involved with these
tests, and annotates it. Accept these bounds if present.
2024-04-30 00:02:49 +00:00
bors
4261e0b28d Auto merge of #12734 - y21:issue12733, r=Manishearth
suppress `readonly_write_lock` for underscore-prefixed bindings

Fixes #12733

Unsure if there's a better way to prevent this kind of false positive but this is the one that made most sense to me.
In my experience, prefixing bindings with an underscore is the usual way to name variables that aren't used and that exist purely for executing drop code at the end of the scope.

-------

changelog: suppress [`readonly_write_lock`] for underscore-prefixed bindings
2024-04-29 22:40:30 +00:00
Christopher B. Speir
c8079e9390 Add diagnostic item for std::iter::Iterator::enumerate 2024-04-29 17:36:31 -05:00
bors
7823bf0412 Auto merge of #124537 - matthiaskrgr:rollup-zjv9gu8, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #124185 (Remove optionality from MoveData::base_local)
 - #124488 (Add a note to the ArbitraryExpressionInPattern error)
 - #124530 (Fix Fuchsia build broken by #124210)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-29 22:35:56 +00:00
bors
70e74b11da Auto merge of #12736 - UlazkaMateusz:fix-type_complexity_duplicate_errors, r=xFrednet
[`type_complexity`]: Fix duplicate errors

Relates to #12379

Following message was duplicated:
```
LL |     fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) {}
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: very complex type used. Consider factoring parts into `type` definitions
  --> tests/ui/type_complexity.rs:55:15
```

Methods `check_trait_item` and `check_fn` were both checking method named def_method.
Now `check_trait_item` only checks methods without body.

---
changelog: [`type_complexity`]: Fix duplicate diagnostics
2024-04-29 21:30:38 +00:00
Michael Goulet
7597d1504e Split out instantiate_nested_goals 2024-04-29 17:06:34 -04:00
Michael Goulet
13825dcc15 Take proof trees by value in inspect goal 2024-04-29 17:06:34 -04:00
Urgau
21c688af86 Consider inner modules to be local in the non_local_definitions lint 2024-04-29 22:54:04 +02:00
Matthias Krüger
d94eabaf9b
Rollup merge of #124530 - djkoloski:fuchsia_dirfd, r=tmandry
Fix Fuchsia build broken by #124210

Fuchsia doesn't support dirfd although we have a symbol stubbed for it.
2024-04-29 22:37:51 +02:00
Matthias Krüger
42ab090be9
Rollup merge of #124488 - est31:arbitrary_expressions_error, r=pnkfelix
Add a note to the ArbitraryExpressionInPattern error

The current "arbitrary expressions aren't allowed in patterns" error is confusing, as it fires for code where it *looks* like a pattern but the compiler still treats it as an expression. That this is due to the `:expr` fragment specifier forcing the expression-ness property on the code.

In the test suite, the "arbitrary expressions aren't allowed in patterns" error can only be found in combination with macro_rules macros that force expression-ness of their content, namely via `:expr` metavariables. I also can't come up with cases where there would be an expression instead of a pattern, so I think it's always coming from an `:expr`.

In order to make the error less confusing, this adds a note explaining the weird `:expr` fragment behaviour.

Fixes #99380
2024-04-29 22:37:51 +02:00
Matthias Krüger
6ce9708ce5
Rollup merge of #124185 - beepster4096:move_data_base_local_infallible, r=pnkfelix
Remove optionality from MoveData::base_local

This is an artifact from when Places could be based on statics and not just locals. Now, all move paths either are locals or have parents, so this doesn't need to return Option anymore.
2024-04-29 22:37:50 +02:00
Ulążka Mateusz
71db2d1451 [type_complexity]: Fix duplicate errors 2024-04-29 22:32:36 +02:00
bors
9e02abec3e Auto merge of #12726 - kornelski:else_applicable, r=blyxyas
clippy::single_match(_else) may be machine applicable

```
changelog: [`single_match`]: make the lint machine-applicable
changelog: [`single_match_else`]: make the lint machine-applicable
```

---

The lint doesn't use placeholders. I've tried it on my codebases, and all instances of it applied without problems.
2024-04-29 20:20:25 +00:00