about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-05-02Split `hir_typeck_never_type_fallback_flowing_into_unsafe` into 5 slugsWaffle Lapkin-30/+44
2024-05-02Add proper support for all kinds of unsafe ops to the lintWaffle Lapkin-49/+321
(never_type_fallback_flowing_into_unsafe)
2024-05-02Add `UnordMap::try_insert`Waffle Lapkin-0/+7
2024-05-02Reorganize `use`sWaffle Lapkin-13/+11
2024-05-02Add an explanation about never type fallbackMaybe Waffle-2/+38
2024-05-02Add a lint against never type fallback affecting unsafe codeMaybe Waffle-10/+241
2024-05-02Convert `if` to `match`Maybe Waffle-11/+6
2024-05-01Auto merge of #124404 - jonathanpallant:arm-target-changes-new, r=chrisncbors-99/+577
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-01Auto merge of #121564 - ojeda:rustc-jobserver, r=ehussbors-1/+90
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-01Auto merge of #124590 - matthiaskrgr:rollup-091hpnp, r=matthiaskrgrbors-52/+181
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-01Rollup merge of #124566 - lcnr:normalizes-to-proof-tree, r=compiler-errorsMatthias Krüger-52/+179
fix `NormalizesTo` proof tree issue fixes #124422 cc #121848 r? ``@compiler-errors``
2024-05-01Rollup merge of #124542 - CBSpeir:diagnostic-item-enumerate-method, r=scottmcmMatthias Krüger-0/+2
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-01Auto merge of #122427 - psumbera:bootstrap_out_path, r=clubby789bors-1/+6
Normalize bootstrap_out path Fixes #112785
2024-05-01reviewlcnr-13/+15
2024-05-01Auto merge of #124539 - Urgau:non-local-defs_modulo_modules, r=lcnrbors-5/+49
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-01Auto merge of #124572 - weihanglo:update-cargo, r=weihanglobors-0/+0
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-04-30Update cargoWeihang Lo-0/+0
2024-05-01Auto merge of #124491 - madsmtm:target_vendor-apple, r=workingjubileebors-372/+90
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-01Auto merge of #124356 - fmease:fewer-magic-numbers-in-names, r=lcnrbors-105/+111
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-04-30Auto merge of #117164 - fmease:orphan-norm, r=lcnrbors-144/+1054
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-30Replace item names containing an error code with something more meaningfulLeón Orell Valerian Liehr-50/+55
or inline such functions if useless.
2024-04-30Give an item related to issue 27438 a more meaningful nameLeón Orell Valerian Liehr-10/+8
2024-04-30Give items related to issue 33140 a more meaningful nameLeón Orell Valerian Liehr-45/+48
2024-04-30fix `NormalizesTo` proof tree issuelcnr-52/+177
2024-04-30Normalize trait ref before orphan check & consider ty params in alias types ↵León Orell Valerian Liehr-144/+1054
to be uncovered
2024-04-30Auto merge of #124564 - jieyouxu:rollup-kuf5wlq, r=jieyouxubors-26/+164
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-30Rollup merge of #124561 - GuillaumeGomez:run-make-normalize, r=jieyouxu许杰友 Jieyou Xu (Joe)-3/+47
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-30Rollup merge of #124553 - ferrocene:pa-cargo-git-info, r=onur-ozkan许杰友 Jieyou Xu (Joe)-5/+12
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-30Rollup merge of #124299 - clubby789:106269-test, r=nikic许杰友 Jieyou Xu (Joe)-0/+22
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-30Rollup merge of #124280 - beetrees:repr128-test-rmake, r=jieyouxu许杰友 Jieyou Xu (Joe)-18/+83
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](https://github.com/rust-lang/rust/blob/aca749eefceaed0cda19a7ec5e472fce9387bc00/tests/run-make/wasm-symbols-not-exported/rmake.rs#L34) that this will fix). Tracking issue: #121876
2024-04-30Port repr128-dwarf run-make test to rmakebeetrees-18/+83
2024-04-30Add `normalize()` in run-make `Diff` typeGuillaume Gomez-3/+47
2024-04-30Add test for efficient codegen of manual `eq` implementations of a small structclubby789-0/+22
2024-04-30Auto merge of #124558 - matthiaskrgr:rollup-axi1bxu, r=matthiaskrgrbors-320/+410
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-30Rollup merge of #124550 - gurry:remove-redundant-code, r=oli-obkMatthias Krüger-29/+18
Remove redundant union check in `KnownPanicsLint` const prop Removes the below check which prevents unions from being const propagated:https://github.com/rust-lang/rust/blob/f9dca46218d4b8efa062aec4fd0820cbb4942aa2/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: https://github.com/rust-lang/rust/blob/f9dca46218d4b8efa062aec4fd0820cbb4942aa2/compiler/rustc_mir_transform/src/known_panics_lint.rs#L899-L902 which is enough to prevent them from being const propagated.
2024-04-30Rollup merge of #124511 - nnethercote:rm-extern-crates, r=fee1-deadMatthias Krüger-287/+375
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-30Rollup merge of #123247 - veera-sivarajan:fix-error-code-E0637-example-code, ↵Matthias Krüger-4/+17
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-30Auto merge of #124545 - Zalathar:mappings, r=oli-obkbors-285/+297
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-30Remove redundant union check in `KnownPanicsLint const propGurinder Singh-29/+18
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-30write git-commit-{sha,info} for Cargo in source tarballsPietro Albini-5/+12
This will allow Cargo's build script to pick it up, and populate the correct git information in its version output.
2024-04-30Auto merge of #124399 - ZhuUx:split-mcdc, r=Zalatharbors-290/+330
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](https://github.com/rust-lang/rust/commit/a3d737a08641b20408fd70d580b2dec93448b469) while the second commit just renames the file. cc `@RenjiSann` `@Zalathar` This will impact your current work.
2024-04-30arm target docs: clarify A32/T32/Arm ISA/Thumb ISA/Thumb-2 ISAJonathan Pallant-15/+36
2024-04-30Recapitalise ARMvX{-Y} to ArmvX{-Y}Jonathan Pallant-81/+81
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-30rustc: document the jobserverMiguel Ojeda-0/+87
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-30Auto merge of #124366 - Kobzol:remove-yaml-expansion, r=pietroalbinibors-705/+157
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-30Remove `extern crate scoped_tls` from `stable_mir`.Nicholas Nethercote-3/+1
2024-04-30Remove `extern crate tracing` from numerous crates.Nicholas Nethercote-70/+47
2024-04-30Auto merge of #124547 - matthiaskrgr:rollup-9tv8upg, r=matthiaskrgrbors-99/+149
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-30Rollup merge of #124543 - maurer:llvm-range, r=nikicMatthias Krüger-3/+3
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-30Rollup merge of #124540 - compiler-errors:nested-goals, r=lcnrMatthias Krüger-53/+57
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