Commit Graph

254076 Commits

Author SHA1 Message Date
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
xFrednet
7ac1529ff6
Changelog for Clippy 1.78 🪄 2024-04-29 22:01:33 +02:00
Jakub Beránek
b194d5ce44
Output run_type from the matrix calculation job 2024-04-29 21:33:17 +02:00
Jakub Beránek
adbc84cfac
Remove redundant success expressions from steps 2024-04-29 21:33:17 +02:00
Jakub Beránek
24bf3594a5
Rename JobType to WorkflowRunType 2024-04-29 21:33:17 +02:00
Jakub Beránek
686baf5589
Remove redundant success() condition 2024-04-29 21:33:17 +02:00
Jakub Beránek
0b1ecf1d8d
Remove the expand-yaml-anchors tool 2024-04-29 21:33:17 +02:00
Jakub Beránek
1ca92c0857
Replace dynamically generated ci.yml file with the original template 2024-04-29 21:32:35 +02:00
Jakub Beránek
23341500a6
Unify outcome jobs 2024-04-29 21:28:52 +02:00
xFrednet
b1fa2842b1
Update version attribute for 1.78 lints 2024-04-29 21:26:14 +02:00
bors
a8a1d3a771 Auto merge of #124527 - jieyouxu:rollup-eslzncy, r=jieyouxu
Rollup of 7 pull requests

Successful merges:

 - #124269 (Pretty-print parenthesis around binary in postfix match)
 - #124415 (Use probes more aggressively in new solver)
 - #124475 (Remove direct dependencies on lazy_static, once_cell and byteorder)
 - #124484 (Fix #124478 - offset_of! returns a temporary)
 - #124504 (Mark unions non-const-propagatable in `KnownPanicsLint` without calling layout)
 - #124508 (coverage: Avoid hard-coded values when visiting logical ops)
 - #124522 ([Refactor] Rename `Lint` and `LintGroup`'s `is_loaded` to `is_externally_loaded` )

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-29 18:28:23 +00:00