Commit Graph

269751 Commits

Author SHA1 Message Date
Vadim Petrochenkov
b93a2dd0ef expand: Stop using artificial ast::Item for macros loaded from metadata 2024-10-26 22:08:55 +03:00
bors
9b18a122f7 Auto merge of #132190 - matthiaskrgr:rollup-rsocfiz, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #131875 (Add WASM | WASI | Emscripten groups to triagebot.toml)
 - #132019 (Document `PartialEq` impl for `OnceLock`)
 - #132182 (Downgrade `untranslatable_diagnostic` and `diagnostic_outside_of_impl` to `allow`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-26 19:00:57 +00:00
Guillaume Gomez
88f4425dd2 Update GUI test 2024-10-26 20:40:59 +02:00
Michael Goulet
6ab87f8238 Collect item bounds for RPITITs from trait where clauses just like associated types 2024-10-26 17:38:08 +00:00
Urgau
00444bab26 Round negative signed integer towards zero in iN::midpoint
Instead of towards negative infinity as is currently the case.

This done so that the obvious expectations of
`midpoint(a, b) == midpoint(b, a)` and
`midpoint(-a, -b) == -midpoint(a, b)` are true, which makes the even
more obvious implementation `(a + b) / 2` true.

https://github.com/rust-lang/rust/issues/110840#issuecomment-2336753931
2024-10-26 18:46:41 +02:00
Matthias Krüger
5dd60103fa
Rollup merge of #132182 - jieyouxu:downgrade-untranslatable, r=compiler-errors
Downgrade `untranslatable_diagnostic` and `diagnostic_outside_of_impl` to `allow`

Current implementation of translatable diagnostics infrastructure unfortunately causes some friction for compiler contributors. While we don't have a redesign that causes less friction in place, let's downgrade the internal `untranslatable_diagnostic` and `diagnostic_outside_of_impl` lints so we don't indicate to contributors that they *have* to use the current translation infra.

I purposefully left `#[allow(untranslatable_diagnostic)]` and `#[allow(diagnostic_outside_of_impl)]` instances untouched because that seems like unnecessary additional churn.

See <https://github.com/rust-lang/rust/issues/132181> for context.

r? `@davidtwco` (or wg-diagnostics/compiler)
2024-10-26 18:45:34 +02:00
Matthias Krüger
1f6cb859ee
Rollup merge of #132019 - daboross:document-partialeq-oncelock, r=Mark-Simulacrum
Document `PartialEq` impl for `OnceLock`

Adds documentation to `std::sync::OnceLock`'s `PartialEq` implementation: specifies publicly that `OnceLock`s are compared based on their contents, and nothing else.

Created in response to, but not directly related to, https://github.com/rust-lang/rust/issues/131959.

## ne

This doesn't create and document `PartialEq::ne`. There's precedent for this in [`RefCell`](https://doc.rust-lang.org/std/cell/struct.RefCell.html#impl-PartialEq-for-RefCell%3CT%3E).
2024-10-26 18:45:33 +02:00
Matthias Krüger
13ec1b0c97
Rollup merge of #131875 - juntyr:wasm-notification-groups-triage, r=Mark-Simulacrum
Add WASM | WASI | Emscripten groups to triagebot.toml

Tracking issue: https://github.com/rust-lang/compiler-team/issues/799

~~This is blocked on amending the notification group section so that the instructions links point somewhere: https://github.com/rust-lang/rustc-dev-guide/pull/2100~~
2024-10-26 18:45:33 +02:00
bors
4d88de2acd Auto merge of #125116 - blyxyas:ignore-allowed-lints-final, r=cjgillot
(Big performance change) Do not run lints that cannot emit

Before this change, adding a lint was a difficult matter because it always had some overhead involved. This was because all lints would run, no matter their default level, or if the user had `#![allow]`ed them. This PR changes that. This change would improve both the Rust lint infrastructure and Clippy, but Clippy will see the most benefit, as it has about 900 registered lints (and growing!)

So yeah, with this little patch we filter all lints pre-linting, and remove any lint that is either:
- Manually `#![allow]`ed in the whole crate,
- Allowed in the command line, or
- Not manually enabled with `#[warn]` or similar, and its default level is `Allow`

As some lints **need** to run, this PR also adds **loadbearing lints**. On a lint declaration, you can use the ``@eval_always` = true` marker to label it as loadbearing. A loadbearing lint will never be filtered (it will always run)

Fixes #106983
2024-10-26 16:37:43 +00:00
Oli Scherer
ca0e5df0a6
Merge pull request #3995 from RalfJung/readdir_r
fix error returned from readdir_r when isolation is enabled, and uses of raw_os_error
2024-10-26 16:01:50 +00:00
Jieyou Xu
5f4739157a Downgrade untranslatable_diagnostic and diagnostic_outside_of_impl to allow
See <https://github.com/rust-lang/rust/issues/132181> for more context.
2024-10-26 14:11:59 +00:00
bors
9260be36b2 Auto merge of #132184 - jieyouxu:rollup-81ht12w, r=jieyouxu
Rollup of 5 pull requests

Successful merges:

 - #132124 (coverage: Consolidate creation of covmap/covfun records)
 - #132140 (Enable LSX feature for LoongArch Linux targets)
 - #132169 (Deny calls to non-`#[const_trait]` methods in MIR constck)
 - #132174 (x86 target features: make pclmulqdq imply sse2)
 - #132180 (Print unsafety of attribute in AST pretty print)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-26 14:08:18 +00:00
许杰友 Jieyou Xu (Joe)
50e78b8b3c
Rollup merge of #132180 - Urgau:ast_pretty-unsafe-attr, r=compiler-errors
Print unsafety of attribute in AST pretty print

This PR fixes the AST pretty print, which was missing the unsafety for unsafe attributes.

Related to https://github.com/rust-lang/rust/pull/131558#discussion_r1807736204
2024-10-26 22:01:14 +08:00
许杰友 Jieyou Xu (Joe)
656a2ec0bd
Rollup merge of #132174 - RalfJung:pclmulqdq, r=calebzulawski
x86 target features: make pclmulqdq imply sse2

Based on comments in https://github.com/rust-lang/stdarch/issues/1661

Fixes https://github.com/rust-lang/stdarch/issues/1661
2024-10-26 22:01:13 +08:00
许杰友 Jieyou Xu (Joe)
bafe790a2d
Rollup merge of #132169 - fee1-dead-contrib:consttraitsck, r=compiler-errors
Deny calls to non-`#[const_trait]` methods in MIR constck

This is a (potentially temporary) fix that closes off the mismatch in assumptions between MIR constck and typeck which does the const traits checking. Before this PR, MIR constck assumed that typeck correctly handled all calls to trait methods in const contexts if effects is enabled. That is not true because typeck only correctly handles callees that are const. For non-const callees (such as methods in a non-const_trait), typeck had never created an error.

45089ec19e/compiler/rustc_hir_typeck/src/callee.rs (L876-L877)

I called this potentially temporary because the const checks could be moved to HIR entirely. Alongside the recent refactor in const stability checks where that component could be placed would need more discussion. (cc ```@compiler-errors``` ```@RalfJung)```

Tests are updated, mainly due to traits not being const in core, so tests that call them correctly error.

This fixes https://github.com/rust-lang/project-const-traits/issues/12.
2024-10-26 22:01:13 +08:00
许杰友 Jieyou Xu (Joe)
7981acaf7e
Rollup merge of #132140 - heiher:loong-lsx, r=Urgau
Enable LSX feature for LoongArch Linux targets

Enable 128-bit vector (LSX) feature for `loongarch64-unknown-linux-{gnu, musl}` targets.

try-job: dist-loongarch64-linux
try-job: dist-loongarch64-musl
2024-10-26 22:01:12 +08:00
许杰友 Jieyou Xu (Joe)
c26280a8ba
Rollup merge of #132124 - Zalathar:consolidate-covstar, r=jieyouxu
coverage: Consolidate creation of covmap/covfun records

This code for creating covmap/covfun records during codegen was split across multiple functions and files for dubious historical reasons. Having it all in one place makes it easier to follow.

This PR also includes two semi-related cleanups:
- Getting the codegen context's `coverage_cx` state is made infallible, since it should always exist when running the code paths that need it.
- The value of `covfun_section_name` is saved in the codegen context, since it never changes at runtime, and the code that needs it has access to the context anyway.

---

Background: Coverage instrumentation generates two kinds of metadata that are embedded in the final binary. There is per-CGU information that goes in the `__llvm_covmap` linker section, and per-function information that goes in the `__llvm_covfun` section (except on Windows, where slightly different section names are used).
2024-10-26 22:01:12 +08:00
Guillaume Gomez
ae66380da0 Add GUI regression test for code in doc blocks 2024-10-26 15:45:17 +02:00
Guillaume Gomez
dd3dc103fc Fix code HTML items making big blocks if too long 2024-10-26 15:45:05 +02:00
bors
17f8215394 Auto merge of #131527 - ZuseZ4:enable-llvm-offload-runtime, r=Kobzol
Enable the llvm offload build configuration

Tracking:

- https://github.com/rust-lang/rust/issues/131513
2024-10-26 11:44:57 +00:00
Urgau
f5b6f938ce Print unsafety of attribute in AST unpretty 2024-10-26 13:33:36 +02:00
Urgau
f249fdd962 Add AST unpretty test for unsafe attribute 2024-10-26 13:31:24 +02:00
Zalathar
96993a9b5e Use LLVM-C APIs for getting/setting linkage 2024-10-26 20:20:20 +11:00
Zalathar
ec41e6d1b0 Add a wrapper type for raw enum values returned by LLVM 2024-10-26 20:20:20 +11:00
Zalathar
b114040afb Use safe wrappers get_visibility and set_visibility 2024-10-26 20:20:20 +11:00
Zalathar
983d258be3 Use safe wrappers get_linkage and set_linkage 2024-10-26 20:20:18 +11:00
Zalathar
144a12acdd Add a macro that derives TryFrom<u32> for fieldless enums 2024-10-26 20:19:53 +11:00
Ralf Jung
867640e24d x86 target features: make pclmulqdq imply sse2 2024-10-26 09:48:39 +02:00
Ralf Jung
4a34e2784b do not set the file type to an error code 2024-10-26 09:10:11 +02:00
Ralf Jung
3f763c776e do not use host 'raw_os_error' to compute target error code 2024-10-26 09:10:11 +02:00
Ralf Jung
72664f7760 fix error returned from readdir_r when isolation is enabled 2024-10-26 08:58:48 +02:00
Ralf Jung
d1530f0ed9
Merge pull request #3993 from RalfJung/dir-entry-drop-explicit
indicate more explicitly where we close host file/dir handles
2024-10-26 06:55:21 +00:00
bors
80d0d927d5 Auto merge of #132171 - matthiaskrgr:rollup-tp75ge7, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #132114 (Use `Enabled{Lang,Lib}Feature`  instead of n-tuples)
 - #132163 (Update Fuchsia CI script for package serving)
 - #132168 (Effects cleanup)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-26 06:53:53 +00:00
Laurențiu Nicola
56b0299039 Bump MSRV to 1.82 2024-10-26 09:39:23 +03:00
MoskalykA
f719ee7fc2 Use method syntax 2024-10-26 09:39:04 +03:00
MoskalykA
510090f774 Start using Option::is_none_or 2024-10-26 09:39:04 +03:00
Zalathar
0d653a5866 coverage: Add links to LLVM docs for the coverage mapping format 2024-10-26 17:37:04 +11:00
Laurențiu Nicola
ed670e093a
Merge pull request #18415 from lnicola/nicer-remove-dbg
fix: Turn "Remove `dbg!`" into a quick fix for better prioritization
2024-10-26 06:21:26 +00:00
Laurențiu Nicola
fe425cd549 Turn Remove dbg into a quick fix for better prioritization 2024-10-26 09:06:10 +03:00
Ben Kimock
d09fbe3e4e
Merge pull request #3994 from RalfJung/auto-pr
automatic PR: explain how to trigger CI
2024-10-26 05:49:24 +00:00
Ralf Jung
3ff01dd908 automatic PR: explain how to trigger CI 2024-10-26 07:23:51 +02:00
Ralf Jung
df9829c64d indicate more explicitly where we close host file/dir handles 2024-10-26 07:21:40 +02:00
Matthias Krüger
56463df1be
Rollup merge of #132168 - fee1-dead-contrib:fxclean, r=compiler-errors
Effects cleanup

- removed extra bits from predicates queries that are no longer needed in the new system
- removed the need for `non_erasable_generics` to take in tcx and DefId, removed unused arguments in callers

r? compiler-errors
2024-10-26 06:29:48 +02:00
Matthias Krüger
42a0e40e46
Rollup merge of #132163 - claywilkinson:master, r=tmandry
Update Fuchsia CI script for package serving

This updates the "start" and "stop" methods
of the test runner to use the standalone package
server.

r? `@tmandry`
2024-10-26 06:29:47 +02:00
Matthias Krüger
8207d89b5e
Rollup merge of #132114 - jieyouxu:features-bundle, r=fee1-dead
Use `Enabled{Lang,Lib}Feature`  instead of n-tuples

Instead of passing around e.g. `(gate_name, attr_span, stable_since)` 3-tuples for enabled lang features or `(gate_name, attr_span)` 2-tuples for enabled lib features, use `Enabled{Lang,Lib}Feature` structs with named fields.

Also did some minor code-golfing of involved iterator chains to hopefully make them easier to follow.

Follow-up to https://github.com/rust-lang/rust/pull/132098#issuecomment-2434523431 cc `@RalfJung.`
2024-10-26 06:29:47 +02:00
bors
ae4c6b6640 Auto merge of #132152 - lqd:revert-127731, r=compiler-errors
Revert #127731 "Emit error when calling/declaring functions with unavailable …"

This reverts #127731 due to the unexpected [perf regressions](https://github.com/rust-lang/rust/pull/127731#issuecomment-2438687094) and to give time to mitigate the regressions before re-landing it.

r? `@RalfJung` cc `@veluca93`
2024-10-26 04:24:31 +00:00
Deadbeef
f2f67232a5 Deny calls to non-#[const_trait] methods in MIR constck 2024-10-26 11:35:56 +08:00
Deadbeef
f6fea83342 Effects cleanup
- removed extra bits from predicates queries that are no longer needed in the new system
- removed the need for `non_erasable_generics` to take in tcx and DefId, removed unused arguments in callers
2024-10-26 10:19:07 +08:00
bors
a06b7cbe21 Auto merge of #132149 - weihanglo:update-cargo, r=weihanglo
Update cargo

14 commits in cf53cc54bb593b5ec3dc2be4b1702f50c36d24d5..e75214ea4936d2f2c909a71a1237042cc0e14b07
2024-10-18 13:56:15 +0000 to 2024-10-25 16:34:32 +0000
- refactor(env): remove unnecessary clones (rust-lang/cargo#14730)
- test(install): Verify 2024 edition / resolver=3 doesn't affect resolution (rust-lang/cargo#14724)
- Fix: trace `config` `[env]` table in dep-info. (rust-lang/cargo#14701)
- Added unstable-schema generation for Cargo.toml (rust-lang/cargo#14683)
- fix: add source replacement info when no matching package found (rust-lang/cargo#14715)
- feat(complete): Include descriptions in zsh (rust-lang/cargo#14726)
- refactor(fingerprint): avoid unnecessary fopen calls (rust-lang/cargo#14728)
- docs(resolver): Make room for v3 resolver (rust-lang/cargo#14725)
- test: add fixes in the sat resolver (rust-lang/cargo#14707)
- docs(ci): Don't constrainty latest_deps job by MSRV (rust-lang/cargo#14711)
- refactor: use `Iterator::is_sorted` (rust-lang/cargo#14702)
- refactor(rustfix): minor refactors (rust-lang/cargo#14710)
- chore(deps): update msrv (rust-lang/cargo#14705)
- fix(renovate): Switch matchPackageNames to matchDepNames (rust-lang/cargo#14704)
2024-10-26 02:00:17 +00:00
Tyler Mandry
ce4fc999a7
Fix indentation 2024-10-25 19:38:16 -04:00