Commit Graph

269884 Commits

Author SHA1 Message Date
bors
588a420350 Auto merge of #132497 - matthiaskrgr:rollup-gaskcn0, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #131037 (Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa`)
 - #132170 (Add a Few Codegen Tests)
 - #132333 (rust_analyzer_helix.toml: add library/ manifest)
 - #132398 (Add a couple of intra-doc links to str)
 - #132411 (CI: switch dist-x86_64-musl to free runner)
 - #132453 (Also treat `impl` definition parent as transparent regarding modules)
 - #132457 (Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test)
 - #132465 (refactor(config): remove FIXME statement in comment of `omit-git-hash`)
 - #132466 (Account for late-bound depth when capturing all opaque lifetimes.)
 - #132471 (Add a bunch of mailmap entries)
 - #132488 (Remove or fix some more `FIXME(async_closure)`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-02 08:25:59 +00:00
Matthias Krüger
30497b05cd
Rollup merge of #132488 - compiler-errors:more-fixmes-bye, r=jieyouxu
Remove or fix some more `FIXME(async_closure)`

Self-explanatory
2024-11-02 08:33:15 +01:00
Matthias Krüger
b9798d3f22
Rollup merge of #132471 - Noratrieb:lots-of-mailmapping, r=Mark-Simulacrum
Add a bunch of mailmap entries

This adds a bunch of missing mailmap entries for many people. These are needed when using rust-lang/team information in rust-lang/thanks (https://github.com/rust-lang/thanks/pull/53), as the emails there may differ.

These are "easy" ones, where there was a mailmap entry already, making it clear which one is the preferred email address.
2024-11-02 08:33:15 +01:00
Matthias Krüger
020b63aebc
Rollup merge of #132466 - cjgillot:opaque-late, r=compiler-errors
Account for late-bound depth when capturing all opaque lifetimes.

Fixes https://github.com/rust-lang/rust/issues/132429

r? ````@compiler-errors````
2024-11-02 08:33:14 +01:00
Matthias Krüger
737cc83c3f
Rollup merge of #132465 - ismailarilik:refactor/config/remove-fixme-comment-for-omit-git-hash, r=jieyouxu
refactor(config): remove FIXME statement in comment of `omit-git-hash`

It is already fixed.
2024-11-02 08:33:14 +01:00
Matthias Krüger
b1d059fc2b
Rollup merge of #132457 - taiki-e:needless-feature, r=workingjubilee
Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test

inline assembly is already stable on this architecture.
2024-11-02 08:33:13 +01:00
Matthias Krüger
fa69b671a9
Rollup merge of #132453 - Urgau:non_local_defs-impl-mod-transparent, r=jieyouxu
Also treat `impl` definition parent as transparent regarding modules

This PR changes the `non_local_definitions` lint logic to also consider `impl` definition parent as transparent regarding modules.

See tests and explanation in the changes.

``````@rustbot`````` label +L-non_local_definitions
Fixes *(after beta-backport)* #132427
cc ``````@leighmcculloch``````
r? ``````@jieyouxu``````
2024-11-02 08:33:13 +01:00
Matthias Krüger
e5269bba2d
Rollup merge of #132411 - MarcoIeni:ci-switch-to-free-runners, r=Kobzol
CI: switch dist-x86_64-musl to free runner

try-job: dist-x86_64-musl
2024-11-02 08:33:12 +01:00
Matthias Krüger
ec1cebfcb6
Rollup merge of #132398 - krtab:add_doc_link, r=Noratrieb
Add a couple of intra-doc links to str
2024-11-02 08:33:11 +01:00
Matthias Krüger
4b7bfaaf69
Rollup merge of #132333 - tshepang:patch-4, r=workingjubilee
rust_analyzer_helix.toml: add library/ manifest
2024-11-02 08:33:11 +01:00
Matthias Krüger
a513e0e983
Rollup merge of #132170 - veera-sivarajan:codegen-tests, r=jieyouxu
Add a Few Codegen Tests

Closes #86109
Closes #64219

Those issues somehow got fixed over time.

So, this PR adds a couple of codegen tests to ensure we don't regress in the future.
2024-11-02 08:33:10 +01:00
Matthias Krüger
bb544f863f
Rollup merge of #131037 - madsmtm:move-llvm-target-versioning, r=petrochenkov
Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa`

Fully specified LLVM targets contain the OS version on macOS/iOS/tvOS/watchOS/visionOS, and this version depends on the deployment target environment variables like `MACOSX_DEPLOYMENT_TARGET`, `IPHONEOS_DEPLOYMENT_TARGET` etc.

We would like to move this to later in the compilation pipeline, both because it feels impure to access environment variables when fetching target information, but mostly because we need access to more information from https://github.com/rust-lang/rust/pull/130883 to do https://github.com/rust-lang/rust/issues/118204. See also https://github.com/rust-lang/rust/pull/129342#issuecomment-2335156119 for some discussion.

The first and second commit does the actual refactor, it should be a non-functional change, the third commit adds diagnostics for invalid deployment targets, which are now possible to do because we have access to the session.

Tested with the same commands as in https://github.com/rust-lang/rust/pull/130435.

r? ``````@petrochenkov``````
2024-11-02 08:33:10 +01:00
Veera
d2aa91054b Add a Few Codegen Tests 2024-11-02 05:33:56 +00:00
bors
b5f4883a06 Auto merge of #132352 - DianQK:llvm/19.1.3, r=nikic
Update LLVM to 19.1.3

Closes #131031.

r? nikic
2024-11-02 04:59:26 +00:00
Michael Goulet
9e5e47fc32 Remove or fix some FIXME(async_closure) 2024-11-02 03:33:31 +00:00
bors
ef972a3466 Auto merge of #132475 - weihanglo:update-cargo, r=weihanglo
Update cargo

18 commits in e75214ea4936d2f2c909a71a1237042cc0e14b07..0310497822a7a673a330a5dd068b7aaa579a265e
2024-10-25 16:34:32 +0000 to 2024-11-01 19:27:56 +0000
- Add more metadata to `rustc_fingerprint` (rust-lang/cargo#14761)
- test(rustfix): switch to a simpler case for dedup-suggestions (rust-lang/cargo#14765)
- chore(deps): update rust crate security-framework to v3 (rust-lang/cargo#14766)
- chore(deps): update rust crate gix to 0.67.0 (rust-lang/cargo#14762)
- fix(util): Respect all `..`s in `normalize_path` (rust-lang/cargo#14750)
- test(doc): Resolve flaky test (rust-lang/cargo#14760)
- refactor(test): Remove dead 'expect_stdout_contains_n' check (rust-lang/cargo#14759)
- add unstable -Zroot-dir flag to configure the path from which rustc should be invoked (rust-lang/cargo#14752)
- docs(resolver): Further v3 prep (rust-lang/cargo#14753)
- fix: track version in fingerprint dep-info files (rust-lang/cargo#14751)
- test: Remove unused msrv-policy (rust-lang/cargo#14748)
- download targeted transitive deps of with artifact deps'  target platform (rust-lang/cargo#14723)
- Remove requirement for --target when invoking Cargo with -Zbuild-std (rust-lang/cargo#14317)
- docs(fingerprint): document the encoding of Cargo's depinfo (rust-lang/cargo#14745)
- Allow build scripts to report error messages through `cargo::error` (rust-lang/cargo#14743)
- fix(publish): Downgrade version-exists error to warning on dry-run (rust-lang/cargo#14742)
- fix: clean up for deprecated and removed commands (rust-lang/cargo#14739)
- Deprecate `cargo verify-project` (rust-lang/cargo#14736)
2024-11-02 01:04:59 +00:00
Weihang Lo
65c74101b5
Update cargo 2024-11-01 18:00:37 -04:00
bors
7c7bb7dc01 Auto merge of #132470 - GuillaumeGomez:rollup-1a1mkmp, r=GuillaumeGomez
Rollup of 14 pull requests

Successful merges:

 - #131829 (Remove support for `-Zprofile` (gcov-style coverage instrumentation))
 - #132369 (style-guide: Only use the new binop heuristic for assignments)
 - #132383 (Implement suggestion for never type fallback lints)
 - #132413 (update offset_of! docs to reflect the stabilization of nesting)
 - #132438 (Remove unncessary option for default rust-analyzer setting)
 - #132439 (Add `f16` and `f128` to `invalid_nan_comparison`)
 - #132444 (rustdoc: Directly use rustc_abi instead of reexports)
 - #132445 (Cleanup attributes around unchecked shifts and unchecked negation in const)
 - #132448 (Add missing backtick)
 - #132450 (Show actual MIR when MIR building forgot to terminate block)
 - #132451 (remove some unnecessary rustc_allow_const_fn_unstable)
 - #132455 (make const_alloc_layout feature gate only about functions that are already stable)
 - #132456 (Move remaining inline assembly test files into asm directory)
 - #132459 (feat(byte_sub_ptr): unstably add ptr::byte_sub_ptr)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-01 21:49:15 +00:00
MarcoIeni
d39270f775
CI: switch dist-x86_64-musl to free runner 2024-11-01 21:11:28 +01:00
Noratrieb
e4305f1657 Add a bunch of mailmap entries
This adds a bunch of missing mailmap entries for many people. These are
needed when using rust-lang/team information in rust-lang/thanks, as the
emails there may differ.

These are all the "easy" ones, where there was a mailmap entry already,
making it clear which one is the preferred email address.
2024-11-01 20:10:36 +01:00
Guillaume Gomez
305ca05cbe
Rollup merge of #132459 - RalfJung:byte_sub_ptr, r=scottmcm
feat(byte_sub_ptr): unstably add ptr::byte_sub_ptr

This is an API that naturally should exist as a combination of byte_offset_from and sub_ptr
both existing (they showed up at similar times so this union was never made). Adding these
is a logical (and perhaps final) precondition of stabilizing ptr_sub_ptr (https://github.com/rust-lang/rust/issues/95892).

Original PR by ``@Gankra`` (https://github.com/rust-lang/rust/pull/121919), I am just reviving it. The 2nd commit (with a small docs tweak) is by me.
2024-11-02 03:08:56 +08:00
Guillaume Gomez
81c6943f1a
Rollup merge of #132456 - taiki-e:test-asm-dir, r=jieyouxu
Move remaining inline assembly test files into asm directory

Before:
```
tests/assembly/asm/*
tests/assembly/asm-comments.rs
tests/codegen/asm-target-clobbers.rs
tests/codegen/asm-goto.rs
tests/codegen/asm-maybe-uninit.rs
tests/codegen/asm-msp430-clobbers.rs
tests/codegen/asm-options.rs
tests/codegen/asm-clobbers.rs
tests/codegen/asm-may_unwind.rs
tests/codegen/asm-arm64ec-clobbers.rs
tests/codegen/asm-powerpc-clobbers.rs
tests/codegen/asm-sanitize-llvm.rs
tests/codegen/asm-s390x-clobbers.rs
tests/codegen/asm-clobber_abi.rs
tests/codegen/asm-multiple-options.rs
tests/codegen/global_asm.rs
tests/codegen/global_asm_include.rs
tests/codegen/global_asm_x2.rs
tests/ui/asm/*
```

After:
```
tests/assembly/asm/*
tests/codegen/asm/*
tests/ui/asm/*
```

I moved the remaining standalone test files into the asm directory, and then either removed the "asm-" suffix or for x86-specific registers tests replaced the "asm-" suffix with the "x86-" suffix.

(Then I noticed that there is no test for clobber_abi for already stabilized aarch64, arm, riscv, and loongarch64 asm... I don't believe there is a problem like https://github.com/rust-lang/rust/pull/131332, but I plan to add tests for them later.)

r? ``@Amanieu``

``@rustbot`` label +A-inline-assembly
2024-11-02 03:08:56 +08:00
Guillaume Gomez
d5366090f9
Rollup merge of #132455 - RalfJung:const_alloc_layout, r=dtolnay
make const_alloc_layout feature gate only about functions that are already stable

The const_alloc_layout feature gate has two kinds of functions: those that are stable, but not yet const-stable, and those that are fully unstable.

I think we should split that up. So this PR makes const_alloc_layout just about functions that are already stable but waiting for const-stability; all the other functions now have their constness guarded by the gate that also guards their regular stability.

Cc https://github.com/rust-lang/rust/issues/67521
2024-11-02 03:08:55 +08:00
Guillaume Gomez
5f8d7e84cc
Rollup merge of #132451 - RalfJung:less-rustc_allow_const_fn_unstable, r=tgross35
remove some unnecessary rustc_allow_const_fn_unstable

These are either unstable functions that don't need the attribute, or the attribute refers to a feature that is already stable.
2024-11-02 03:08:55 +08:00
Guillaume Gomez
7bfdc3d898
Rollup merge of #132450 - bjorn3:better_mir_errors, r=jieyouxu
Show actual MIR when MIR building forgot to terminate block

This makes it significantly easier to debug bugs of this kind.
2024-11-02 03:08:54 +08:00
Guillaume Gomez
e9e7aa8487
Rollup merge of #132448 - chengehe:master, r=Noratrieb
Add missing backtick
2024-11-02 03:08:54 +08:00
Guillaume Gomez
8366ecca2e
Rollup merge of #132445 - RalfJung:const-unchecked-shifts, r=tgross35
Cleanup attributes around unchecked shifts and unchecked negation in const

The underlying intrinsic is marked as "safe to expose on stable", so we shouldn't need any `rustc_allow_const_fn_unstable(unchecked_shifts)` anywhere. However, bootstrap rustc doesn't yet have the new const stability checks, so these changes only apply under `cfg(not(bootstrap))`.
2024-11-02 03:08:54 +08:00
Guillaume Gomez
93fb6ef84e
Rollup merge of #132444 - workingjubilee:rustdoc-my-abi, r=GuillaumeGomez
rustdoc: Directly use rustc_abi instead of reexports

rustc_target reexports a lot of things that are in rustc_abi, but that will be over soon and now is probably a good time to switch. Uses of rustc_target remain where they inquire about the target tuple.
2024-11-02 03:08:53 +08:00
Guillaume Gomez
2896483320
Rollup merge of #132439 - tgross35:f16-f128-nan-lint, r=jieyouxu
Add `f16` and `f128` to `invalid_nan_comparison`

Currently `f32_nan` and `f64_nan` are used to provide the `invalid_nan_comparison` lint. Since we have `f16_nan` and `f128_nan`, hook these up so the new float types get the same lints.
2024-11-02 03:08:52 +08:00
Guillaume Gomez
c794207eae
Rollup merge of #132438 - chenyukang:yukang-fix-analyzer_settings, r=jieyouxu
Remove unncessary option for default rust-analyzer setting

In favor of https://github.com/rust-lang/rust-analyzer/pull/17888
2024-11-02 03:08:52 +08:00
Guillaume Gomez
5f0568b7b7
Rollup merge of #132413 - lolbinarycat:offset_of_nested-docs, r=workingjubilee
update offset_of! docs to reflect the stabilization of nesting

this seems to have been missed.
2024-11-02 03:08:51 +08:00
Guillaume Gomez
e31a5ca1a3
Rollup merge of #132383 - compiler-errors:never-type-fallback-sugg, r=WaffleLapkin
Implement suggestion for never type fallback lints

r? ```@WaffleLapkin```

Just opening this up for vibes; it's not done yet. I'd still like to make this suggestable in a few more cases before merge:
- [x] Try to annotate `_` -> `()`
- [x] Try to annotate local variables if they're un-annotated: `let x = ...` -> `let x: () = ...`
- [x] Try to annotate the self type of a `Trait::method()` -> `<() as Trait>::method()`.

The only other case we may want to suggest is a missing turbofish, like `f()` -> `f::<()>()`. That may be possible, but seems overly annoying.

This partly addresses https://github.com/rust-lang/rust/issues/132358; the other half of fixing that would be to make the error message a bit better, perhaps just special casing the `?` operator 🤔 I don't think I'll do that part.
2024-11-02 03:08:51 +08:00
Guillaume Gomez
348d28052b
Rollup merge of #132369 - joshtriplett:style-guide-binop-heuristic-assignment-only, r=calebcartwright
style-guide: Only use the new binop heuristic for assignments

This avoids pathological cases where chains of binops get progressively
deeper.
2024-11-02 03:08:50 +08:00
Guillaume Gomez
526c67f37b
Rollup merge of #131829 - Zalathar:goodbye-zprofile, r=chenyukang
Remove support for `-Zprofile` (gcov-style coverage instrumentation)

Tracking issue: #42524

MCP: https://github.com/rust-lang/compiler-team/issues/798

---

This PR removes the unstable `-Zprofile` flag, which enables ”gcov-style” coverage instrumentation, along with its associated `-Zprofile-emit` configuration flag.

(The profile flag predates and is almost entirely separate from the stable `-Cinstrument-coverage` flag.)

Notably, the `-Zprofile` flag:
- Is largely untested in-tree, having only one run-make test that does not check whether its output is correct or useful.
- Has no known maintainer.
- Has seen no push towards stabilization.
- Has at least one severe regression reported in 2022 that apparently remains unaddressed.
  - #100125
- Is confusingly named, since it appears to be more about coverage than performance profiling, and has nothing to do with PGO.
- Is fundamentally limited by relying on counters auto-inserted by LLVM, with no knowledge of Rust beyond debuginfo.
2024-11-02 03:08:49 +08:00
bors
705cfe0e96 Auto merge of #132276 - compiler-errors:enforce-fx-in-mir, r=fee1-dead
Double-check conditional constness in MIR

To prevent any unchecked `~const` bounds from leaking through during MIR lowering.

If this check fails, it will eventually just delay a bug, but for now it reports errors. That error reporting may be redundant if we're calling it from code that already doesn't allow `~const` (i.e. when the `effects` and `const_trait_impl` gates are disabled), but I don't think it's that big of a deal.

edit: This also makes sure that we issue a const stability error if we encounter *any* function with const conditions when `const_trait_impl` is not enabled. This ensures that that feature remains airtight.
2024-11-01 19:07:57 +00:00
Camille GILLOT
e2a50de5f4 Use more minimized test. 2024-11-01 18:13:26 +00:00
Camille GILLOT
a7f609504c Skip late-bound lifetimes when crossing an AnonConst. 2024-11-01 17:42:14 +00:00
ismailarilik
e169483879 refactor(config): remove FIXME statement in comment of omit-git-hash
It is already fixed.
2024-11-01 20:19:01 +03:00
Camille GILLOT
45d4465028 Account for late-bound depth when capturing all opaque lifetimes. 2024-11-01 17:03:17 +00:00
Jubilee Young
a8d4d23107 rustdoc: Directly use rustc_abi instead of reexports
rustc_target reexports a lot of things that are in rustc_abi, but
that will be over soon and now is probably a good time to switch.
Uses of rustc_target remain where they inquire about the target tuple.
2024-11-01 09:24:09 -07:00
Michael Goulet
57f2e12f4a Completely deny calling functions with const conditions in MIR const check unless const_trait_impl is enabled
This will help us make sure that we never leak any conditionally const
functions into stable.
2024-11-01 16:13:30 +00:00
Mads Marquart
1ef1af1c60 Emit diagnostics for incorrect deployment targets 2024-11-01 17:07:19 +01:00
Mads Marquart
e75a7ddad3 Move Mach-O platform information to rustc_codegen_ssa:🔙:apple
To align with the general decision to have this sort of information
there instead.

Also use the visionOS values added in newer `object` release.
2024-11-01 17:07:19 +01:00
Mads Marquart
e1233153ac Move versioned LLVM target creation to rustc_codegen_ssa
The OS version depends on the deployment target environment variables,
the access of which we want to move to later in the compilation pipeline
that has access to more information, for example `env_depinfo`.
2024-11-01 17:07:18 +01:00
Michael Goulet
e319838e8d Double-check conditional constness in MIR
To prevent any conditional constness from leaking through during MIR lowering
2024-11-01 16:03:52 +00:00
bors
5ca0e9fa9b Auto merge of #132196 - compiler-errors:probe_ty_param_bounds, r=petrochenkov
Some where clause lowering simplifications

Rename `PredicateFilter::SelfThatDefines` to `PredicateFilter::SelfTraitThatDefines` to make it clear that it's only concerned with converting *traits*, and make it do a bit less work when converting bounds.

Also, make the predicate filter matching in `probe_ty_param_bounds_in_generics` explicit, and simply the args it receives a bit.
2024-11-01 15:40:13 +00:00
Urgau
37db365948 Also treat impl definition parent as transparent regarding modules 2024-11-01 16:07:02 +01:00
Ralf Jung
c38865502e offset_from / sub_ptr docs: emphasize that pointers must be in the same allocation 2024-11-01 15:30:08 +01:00
Aria Beingessner
aba2088735 feat(byte_sub_ptr): add ptr::byte_sub_ptr
This is an API that naturally should exist as a combination of byte_offset_from and sub_ptr
both existing (they showed up at similar times so this union was never made). Adding these
is a logical (and perhaps final) precondition of stabilizing ptr_sub_ptr (#95892).
2024-11-01 15:27:43 +01:00
Taiki Endo
57673dd646 Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test 2024-11-01 22:39:08 +09:00