Commit Graph

254068 Commits

Author SHA1 Message Date
Mark Rousskov
377c518bce Bump stage0 to next beta 2024-05-01 21:01:51 -04:00
Mark Rousskov
43f9a5ec0c Mark more entries in rustc_data_structures as no_inline for docs
This is a workaround for #122758, but it's not clear why 1.79 requires a
more extensive amount of no_inline than the previous release. Seems like
there's something relatively subtle happening here.
2024-05-01 21:01:51 -04:00
Mark Rousskov
bd7d328807 Replace version placeholders for 1.79 2024-05-01 21:01:51 -04:00
bors
f92d49b7fe Auto merge of #124529 - compiler-errors:select, r=lcnr
Rewrite select (in the new solver) to use a `ProofTreeVisitor`

We can use a proof tree visitor rather than collecting and recomputing all the nested goals ourselves.

Based on #124415
2024-05-02 00:36:38 +00:00
Josh Stone
393d9334d9 Use an outlandish target feature for the negative case 2024-05-01 16:55:10 -07:00
Josh Stone
1b79bb937f Add inline comments why we're forcing the target cpu 2024-05-01 16:54:20 -07:00
Josh Stone
706f06c39a Use an explicit x86-64 cpu in tests that are sensitive to it
There are a few tests that depend on some target features **not** being
enabled by default, and usually they are correct with the default x86-64
target CPU. However, in downstream builds we have modified the default
to fit our distros -- `x86-64-v2` in RHEL 9 and `x86-64-v3` in RHEL 10
-- and the latter especially trips tests that expect not to have AVX.

These cases are few enough that we can just set them back explicitly.
2024-05-01 15:25:26 -07:00
bors
cfb2410752 Auto merge of #124404 - jonathanpallant:arm-target-changes-new, r=chrisnc
Arm bare-metal target doc changes

Updates the Arm bare-metal target docs:

* Detailed pages for all the Cortex-M targets, including details about setting target-cpu and target-features to suit specific Arm models
* More detail about the difference between `eabi` and `eabihf`
* Marks the Embedded Devices Working Group Cortex-M Team as the maintainer of the Cortex-M targets
2024-05-01 22:22:51 +00:00
bors
b0bdbcc5e5 Auto merge of #3531 - narpfel:quiet-sysroot, r=RalfJung
Don’t print `Preparing a sysroot` when `-q`/`--quiet` is passed

Resolves #3530.

This also fixes a typo in `cargo miri --help` that I found while trying to run the `--print-sysroot` example.
2024-05-01 20:44:13 +00:00
bors
c987ad5275 Auto merge of #121564 - ojeda:rustc-jobserver, r=ehuss
rustc: document the jobserver

Explicitly document that the jobserver may be used by `rustc`, as well as recommend the `+` indicator for integration of `rustc` into GNU Make.

In particular, show the warning to increase the chances that this document is found when searching for solutions online.

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).

From: https://github.com/rust-lang/rust/issues/120515
Cc: `@petrochenkov` `@belovdv` `@weihanglo` `@bjorn3`

---

v2: To be able to use tab characters for the Make examples, add `<!-- ignore-tidy-{check} -->` support to `tidy`.
v3: Added "Integration with build systems" section to hold the GNU Make one. Added "by clearing the `MAKEFLAGS` variable". Added "aforementioned" so that it is clear we are talking about the warning above.
v4: Added CMake subsection. Added a note that `rustc` may be affected by other flags, e.g. `CARGO_MAKEFLAGS`.
v5: Added that `rustc` will choose the number of jobs if a jobserver is not passed.
2024-05-01 20:20:43 +00:00
Paul Gey
a2b3211b19 no longer strip Preparing a sysroot message from test output 2024-05-01 21:53:09 +02:00
Paul Gey
4b4262691d fix usage example for --print-sysroot 2024-05-01 21:53:09 +02:00
Paul Gey
1cf951e5c6 Don’t print Preparing a sysroot when -q/--quiet is passed 2024-05-01 21:53:02 +02:00
Michael Goulet
9834c8307f Rewrite select to use a ProofTreeVisitor 2024-05-01 14:19:34 -04:00
bors
be9bca2daf Auto merge of #124590 - matthiaskrgr:rollup-091hpnp, r=matthiaskrgr
Rollup of 2 pull requests

Successful merges:

 - #124542 (Add diagnostic item for `std::iter::Iterator::enumerate`)
 - #124566 (fix `NormalizesTo` proof tree issue)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-01 18:06:53 +00:00
Matthias Krüger
0dbe07f201
Rollup merge of #124566 - lcnr:normalizes-to-proof-tree, r=compiler-errors
fix `NormalizesTo` proof tree issue

fixes #124422
cc #121848

r? ``@compiler-errors``
2024-05-01 20:05:26 +02:00
Matthias Krüger
38cbad9d26
Rollup merge of #124542 - CBSpeir:diagnostic-item-enumerate-method, r=scottmcm
Add diagnostic item for `std::iter::Iterator::enumerate`

Adds a diagnostic item for the `std::iter:Iterator::enumerate` trait method. This change, along with PR https://github.com/rust-lang/rust/pull/124308, will be used by the clippy `unused_enumerate_index` lint to move away from paths to using diagnostic items.

see: https://github.com/rust-lang/rust-clippy/issues/5393
2024-05-01 20:05:26 +02:00
bors
9ba3d315b4 Auto merge of #122427 - psumbera:bootstrap_out_path, r=clubby789
Normalize bootstrap_out path

Fixes #112785
2024-05-01 15:57:35 +00:00
Ralf Jung
6115cf6f41 always print nice 'std not found error' when std is not found 2024-05-01 17:11:49 +02:00
lcnr
f323f9dedb review 2024-05-01 15:03:15 +00:00
Urgau
712560cd03 Adjust #[macro_export]/doctest help suggestion for non_local_defs lint 2024-05-01 16:57:20 +02:00
Ralf Jung
65d74785d7 Align: add bytes_usize and bits_usize 2024-05-01 15:57:33 +02:00
bors
852a64f875 Auto merge of #11988 - J-ZhengLi:issue11324, r=Alexendoo
fix suggestion error for [`manual_is_ascii_check`] with missing type

fixes: #11324
fixes: #11776

changelog: improve [`manual_is_ascii_check`] to suggest labeling type in closure, fix FP with type generics, and improve linting on ref expressions.
2024-05-01 13:54:24 +00:00
Christopher B. Speir
fed9940e57 Remove clippy_utils::paths::VEC_RESIZE
This path is no longer used and can be removed.
2024-05-01 08:45:45 -05:00
bors
a7f66baaf1 Auto merge of #12687 - Alexendoo:box-default-generic-fn, r=xFrednet
Don't suggest `Box::default()` in functions with differing generics

Fixes #12684

changelog: none
2024-05-01 12:02:17 +00:00
bors
378a43a065 Auto merge of #124539 - Urgau:non-local-defs_modulo_modules, r=lcnr
Consider inner modules to be local in the `non_local_definitions` lint

This PR implements the [proposed fix](https://github.com/rust-lang/rust/issues/124396#issuecomment-2079553642) for #124396, that is to consider inner modules to be local in the `non_local_definitions` lint.

This PR is voluntarily kept as minimal as possible so it can be backported easily.

T-lang [nomination](https://github.com/rust-lang/rust/issues/124396#issuecomment-2079692820) will need to be removed before this can be merged.

Fixes *(nearly, needs backport)* https://github.com/rust-lang/rust/issues/124396
2024-05-01 06:21:31 +00:00
bors
5e469ebe67 Auto merge of #124572 - weihanglo:update-cargo, r=weihanglo
Update cargo

15 commits in b60a1555155111e962018007a6d0ef85207db463..6087566b3fa73bfda29702632493e938b12d19e5
2024-04-26 16:37:29 +0000 to 2024-04-30 20:45:20 +0000
- fix(cargo-fix): dont fix into standard library (rust-lang/cargo#13792)
- refactor: Move diagnostic printing to Shell (rust-lang/cargo#13813)
- Populate git information when building Cargo from Rust's source tarball (rust-lang/cargo#13832)
- docs: fix several typos found by `typos-cli` (rust-lang/cargo#13831)
- fix(alias): Aliases without subcommands should not panic (rust-lang/cargo#13819)
- fix(toml): Improve granularity of traces (rust-lang/cargo#13830)
- fix(toml): Warn, rather than fail publish, if a target is excluded (rust-lang/cargo#13713)
- test(cargo-lints): Add a test to ensure cap-lints works (rust-lang/cargo#13829)
- fix(toml)!: Remove support for inheriting badges (rust-lang/cargo#13788)
- chore(ci): Don't check `cargo` against beta channel (rust-lang/cargo#13827)
- Fix target entry in .gitignore (rust-lang/cargo#13817)
- Bump to 0.81.0; update changelog (rust-lang/cargo#13823)
- Add failing test: artifact_dep_target_specified (rust-lang/cargo#13816)
- fix(cargo-lints): Don't always inherit workspace lints (rust-lang/cargo#13812)
- Update SleepTraker returns_in_order unit test (rust-lang/cargo#13811)

r? ghost
2024-05-01 04:16:55 +00:00
Weihang Lo
9cb8fa8104
Update cargo 2024-04-30 22:14:12 -04:00
bors
2e88e9e7d0 Auto merge of #124491 - madsmtm:target_vendor-apple, r=workingjubilee
Use `target_vendor = "apple"` instead of `target_os = "..."`

Use `target_vendor = "apple"` instead of `all(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos")`.

The apple targets are quite close to being identical, with iOS, tvOS, watchOS and visionOS being even closer, so using `target_vendor` when possible makes it clearer when something is actually OS-specific, or just Apple-specific.
Note that `target_vendor` will [be deprecated in the future](https://github.com/rust-lang/rust/issues/100343), but not before an alternative (like `target_family = "apple"`) is available.

While doing this, I found various inconsistencies and small mistakes in the standard library, see the commits for details. Will follow-up with an extra PR for a similar issue that need a bit more discussion. EDIT: https://github.com/rust-lang/rust/pull/124494

Since you've talked about using `target_vendor = "apple"` in the past:
r? workingjubilee

CC `@simlay,` `@thomcc`
`@rustbot` label O-macos O-ios O-tvos O-watchos O-visionos
2024-05-01 02:11:29 +00:00
bendn
a3ef100fa6 warning 2024-05-01 07:51:23 +07:00
bors
f5355b93ba Auto merge of #124356 - fmease:fewer-magic-numbers-in-names, r=lcnr
Cleanup: Replace item names referencing GitHub issues or error codes with something more meaningful

**lcnr** in https://github.com/rust-lang/rust/pull/117164#pullrequestreview-1969935387:

> […] while I know that there's precendent to name things `Issue69420`, I really dislike this as it requires looking up the issue to figure out the purpose of such a variant. Actually referring to the underlying issue, e.g. `AliasMayNormToUncovered` or whatever and then linking to the issue in a doc comment feels a lot more desirable to me. We should ideally rename all the functions and enums which currently use issue numbers.

I've grepped through `compiler/` like crazy and think that I've found all instances of this pattern.
However, I haven't renamed `compute_2229_migrations_*`. Should I?

The first commit introduces an abhorrent and super long name for an item because naming is hard but also scary looking / unwelcoming names are good for things related to temporary-ish backcompat hacks. I'll let you discover it by yourself.

Contains a bit of drive-by cleanup and a diag migration bc that was the simplest option.

r? lcnr or compiler
2024-05-01 00:04:36 +00:00
bors
f705de5962 Auto merge of #117164 - fmease:orphan-norm, r=lcnr
Lazily normalize inside trait ref during orphan check & consider ty params in rigid alias types to be uncovered

Fixes #99554, fixes rust-lang/types-team#104.
Fixes #114061.

Supersedes #100555.

Tracking issue for the future compatibility lint: #124559.

r? lcnr
2024-04-30 20:51:46 +00:00
León Orell Valerian Liehr
2a1d748254
Replace item names containing an error code with something more meaningful
or inline such functions if useless.
2024-04-30 22:27:19 +02:00
León Orell Valerian Liehr
dec1d16a9b
Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
León Orell Valerian Liehr
9e739b723b
Give items related to issue 33140 a more meaningful name 2024-04-30 22:27:19 +02:00
lcnr
da969d41a3 fix NormalizesTo proof tree issue 2024-04-30 20:03:33 +00:00
León Orell Valerian Liehr
951e902562
Normalize trait ref before orphan check & consider ty params in alias types to be uncovered 2024-04-30 21:54:54 +02:00
bors
4f81879620 Auto merge of #124564 - jieyouxu:rollup-kuf5wlq, r=jieyouxu
Rollup of 4 pull requests

Successful merges:

 - #124280 (Port repr128-dwarf run-make test to rmake)
 - #124299 (Add test for issue 106269)
 - #124553 (Write `git-commit-{sha,info}` for Cargo in source tarballs)
 - #124561 (Add `normalize()` in run-make `Diff` type)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-30 18:45:56 +00:00
许杰友 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
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