about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-01Rollup merge of #136374 - saethlin:enzyme-linkage, r=oli-obkMatthias Krüger-2/+7
Add link attribute for Enzyme's LLVMRust FFI Since https://github.com/rust-lang/rust/pull/133429 landed, the compiler doesn't build with `-Zcross-crate-inline-threshold=always`. I don't expect anyone else to test or fix issues with that goofy configuration, so I'm fixing it. This PR adds a link attribute just like https://github.com/rust-lang/rust/pull/118142 for all the new LLVMRust functions. They were actually added in https://github.com/rust-lang/rust/pull/130060 but weren't used until just now.
2025-02-01Rollup merge of #136364 - hkBst:ptr_cmp_docs, r=tgross35Matthias Krüger-3/+8
document that ptr cmp is unsigned Fixes #77497
2025-02-01Rollup merge of #136360 - slanterns:once_wait, r=tgross35Matthias Krüger-7/+3
Stabilize `once_wait` Closes: https://github.com/rust-lang/rust/issues/127527. `@rustbot` label: +T-libs-api r? libs-api
2025-02-01Rollup merge of #136307 - WaffleLapkin:minminmin, r=scottmcmMatthias Krüger-33/+137
Implement all mix/max functions in a (hopefully) more optimization amendable way Previously the graph was like this: ``` min -> Ord::min -> min_by -> match on compare() (in these cases compare = Ord::cmp) ^ | min_by_key ``` now it looks like this: ``` min -> Ord::min -> `<=` <- min_by_key min_by -> `Ordering::is_le` of `compare()` ``` (`max*` and `minmax*` are the exact same, i.e. they also use `<=` and `is_le`) I'm not sure how to test this, but it should probably be easier for the backend to optimize. r? `@scottmcm` cc https://github.com/rust-lang/rust/issues/115939#issuecomment-2622161134
2025-02-01Rollup merge of #135684 - ranger-ross:mutex-docs, r=joboetMatthias Krüger-2/+30
docs: Documented Send and Sync requirements for Mutex + MutexGuard This an attempt to continue where #123225 left off. I did some light clean up from the work done in that PR. I also documented the `!Send` + `Sync` implementations for `MutexGuard` to the best of my knowledge. Let me know if I got anything wrong :smile: fixes #122856 cc: ``@IoaNNUwU`` r? ``@joboet``
2025-02-01Rollup merge of #130514 - compiler-errors:unsafe-binders, r=oli-obkMatthias Krüger-102/+589
Implement MIR lowering for unsafe binders This is the final bit of the unsafe binders puzzle. It implements MIR, CTFE, and codegen for unsafe binders, and enforces that (for now) they are `Copy`. Later on, I'll introduce a new trait that relaxes this requirement to being "is `Copy` or `ManuallyDrop<T>`" which more closely models how we treat union fields. Namely, wrapping unsafe binders is now `Rvalue::WrapUnsafeBinder`, which acts much like an `Rvalue::Aggregate`. Unwrapping unsafe binders are implemented as a MIR projection `ProjectionElem::UnwrapUnsafeBinder`, which acts much like `ProjectionElem::Field`. Tracking: - https://github.com/rust-lang/rust/issues/130516
2025-02-01document ptr comparison being by addressMarijn Schouten-3/+8
2025-02-01Auto merge of #136136 - marcoieni:ubuntu-24, r=Kobzolbors-2/+2
ci: use ubuntu 24 on free runners try-job: aarch64-gnu try-job: aarch64-gnu-debug
2025-02-01docs: Documented Send and Sync requirements for Mutex + MutexGuardRoss Sullivan-2/+30
2025-02-01Auto merge of #136371 - matthiaskrgr:rollup-0b880v3, r=matthiaskrgrbors-620/+997
Rollup of 7 pull requests Successful merges: - #135840 (omit unused args warnings for intrinsics without body) - #135900 (Manually walk into WF obligations in `BestObligation` proof tree visitor) - #136163 (Fix off-by-one error causing slice::sort to abort the program) - #136266 (fix broken release notes id) - #136314 (Use proper type when applying deref adjustment in const) - #136348 (miri: make float min/max non-deterministic) - #136351 (Add documentation for derive(CoercePointee)) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Add link attribute for Enzyme's FFIBen Kimock-2/+7
2025-02-01Auto merge of #135768 - jieyouxu:migrate-symbol-mangling-hashed, r=Noratriebbors-81/+178
tests: Port `symbol-mangling-hashed` to rmake.rs Part of #121876. This PR supersedes #128567 and is co-authored with `@lolbinarycat.` ### Summary This PR ports `tests/run-make/symbol-mangling-hashed` to rmake.rs. Notable differences when compared to the Makefile version includes: - It's no longer limited to linux + x86_64 only. In particular, this now is exercised on darwin and windows (esp. msvc) too. - The test uses `object` crate to be more precise in the filtering, and avoids relying on parsing the human-readable `nm` output for *some* `nm` in the given environment (which isn't really a thing on msvc anyway, and `llvm-nm` doesn't handle msvc dylibs AFAICT). - Dump the symbols satisfying various criteria on test failure to make it hopefully less of a pain to debug if it ever fails in CI. ### Review advice - Best reviewed commit-by-commit. - I'm not *super* sure about the msvc logic, would benefit from a MSVC (PE/COFF) expert taking a look. --- try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: test-various
2025-02-01Rollup merge of #136351 - Darksonn:coerce-pointee-docs, r=compiler-errorsMatthias Krüger-1/+189
Add documentation for derive(CoercePointee) Part of [RFC 3621][rfc] tracked by #123430. This text is heavily based on the guide-level explanation from the RFC. ``@rustbot`` label F-derive_coerce_pointee [rfc]: https://rust-lang.github.io/rfcs/3621-derive-smart-pointer.html
2025-02-01Rollup merge of #136348 - RalfJung:miri-float-min-max, r=oli-obkMatthias Krüger-6/+64
miri: make float min/max non-deterministic This makes Miri match the documentation that landed in https://github.com/rust-lang/rust/pull/136296. r? ``@oli-obk``
2025-02-01Rollup merge of #136314 - compiler-errors:const-deref-adj, r=fee1-deadMatthias Krüger-9/+33
Use proper type when applying deref adjustment in const When applying a deref adjustment to some type `Wrap<T>` which derefs to `T`, we were checking that `T: ~const Deref`, not `Wrap<T>: ~const Deref` like we should have been. r? project-const-traits Fixes #136273 Fixes #135210 -- I just deleted the test since the regression test is uninteresting
2025-02-01Rollup merge of #136266 - cyrgani:patch-1, r=Mark-SimulacrumMatthias Krüger-2/+1
fix broken release notes id
2025-02-01Rollup merge of #136163 - uellenberg:driftsort-off-by-one, r=Mark-SimulacrumMatthias Krüger-8/+32
Fix off-by-one error causing slice::sort to abort the program Fixes #136103. Based on the analysis by ``@jonathan-gruber-jg`` and ``@orlp.``
2025-02-01Rollup merge of #135900 - compiler-errors:derive-wf, r=lcnrMatthias Krüger-580/+650
Manually walk into WF obligations in `BestObligation` proof tree visitor When we encounter a `WellFormed` obligation in the `BestObligation` proof tree visitor, ignore the proof tree and call `wf::unnormalized_obligations` to derive well-formed obligations with the correct cause codes. This is to avoid having to replicate the somewhat delicate logic that `wf.rs` does to set up its obligation causes... Don't see a better way to do this. vibes?? r? lcnr
2025-02-01Rollup merge of #135840 - vayunbiyani:omit_intrinsic_unused_param_warning, ↵Matthias Krüger-14/+28
r=oli-obk omit unused args warnings for intrinsics without body potential fix for https://github.com/rust-lang/rust/issues/135598
2025-01-31Auto merge of #136350 - matthiaskrgr:rollup-6eqfyvh, r=matthiaskrgrbors-512/+838
Rollup of 9 pull requests Successful merges: - #134531 ([rustdoc] Add `--extract-doctests` command-line flag) - #135860 (Compiler: Finalize dyn compatibility renaming) - #135992 (Improve documentation when adding a new target) - #136194 (Support clobber_abi in BPF inline assembly) - #136325 (Delay a bug when indexing unsized slices) - #136326 (Replace our `LLVMRustDIBuilderRef` with LLVM-C's `LLVMDIBuilderRef`) - #136330 (Remove unnecessary hooks) - #136336 (Overhaul `rustc_middle::util`) - #136341 (Remove myself from vacation) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Manually walk into WF obligations in BestObligation proof tree visitorMichael Goulet-100/+160
2025-01-31Move fulfillment error derivation into new moduleMichael Goulet-496/+506
2025-02-01stabilize `once_wait`Slanterns-7/+3
2025-01-31ValidationMichael Goulet-2/+40
2025-01-31Enforce unsafe binders must be Copy (for now)Michael Goulet-41/+98
2025-01-31Implement MIR, CTFE, and codegen for unsafe bindersMichael Goulet-101/+493
2025-01-31Auto merge of #134424 - 1c3t3a:null-checks, r=saethlinbors-165/+552
Insert null checks for pointer dereferences when debug assertions are enabled Similar to how the alignment is already checked, this adds a check for null pointer dereferences in debug mode. It is implemented similarly to the alignment check as a `MirPass`. This inserts checks in the same places as the `CheckAlignment` pass and additionally also inserts checks for `Borrows`, so code like ```rust let ptr: *const u32 = std::ptr::null(); let val: &u32 = unsafe { &*ptr }; ``` will have a check inserted on dereference. This is done because null references are UB. The alignment check doesn't cover these places, because in `&(*ptr).field`, the exact requirement is that the final reference must be aligned. This is something to consider further enhancements of the alignment check. For now this is implemented as a separate `MirPass`, to make it easy to disable this check if necessary. This is related to a 2025H1 project goal for better UB checks in debug mode: https://github.com/rust-lang/rust-project-goals/pull/177. r? `@saethlin`
2025-01-31Add documentation for derive(CoercePointee)Alice Ryhl-1/+189
2025-01-31Rollup merge of #136341 - jieyouxu:unvac, r=jieyouxuMatthias Krüger-1/+0
Remove myself from vacation r? `@ghost`
2025-01-31Rollup merge of #136336 - nnethercote:overhaul-rustc_middle-util, r=jieyouxuMatthias Krüger-135/+102
Overhaul `rustc_middle::util` It's an odd module with some odd stuff in it. r? `@Noratrieb`
2025-01-31Rollup merge of #136330 - nnethercote:rm-unnecessary-hooks, r=oli-obkMatthias Krüger-35/+26
Remove unnecessary hooks Some hooks can be downgraded to vanilla functions. r? `@oli-obk`
2025-01-31Rollup merge of #136326 - Zalathar:llvm-di-builder-ref, r=nikicMatthias Krüger-106/+101
Replace our `LLVMRustDIBuilderRef` with LLVM-C's `LLVMDIBuilderRef` Inspired by trying to split #134009 into smaller steps that are easier to review individually. This makes it possible to start incrementally replacing our debuginfo bindings with the ones in the LLVM-C API, all of which operate on `LLVMDIBuilderRef`. There should be no change to compiler behaviour.
2025-01-31Rollup merge of #136325 - compiler-errors:indirectly, r=RalfJungMatthias Krüger-1/+48
Delay a bug when indexing unsized slices Fixes #136298 r? RalfJung or reassign
2025-01-31Rollup merge of #136194 - taiki-e:bpf-clobber-abi, r=amanieuMatthias Krüger-0/+44
Support clobber_abi in BPF inline assembly This supports [`clobber_abi`](https://doc.rust-lang.org/nightly/reference/inline-assembly.html#abi-clobbers) which is one of the requirements of stabilization mentioned in the tracking Issue for `asm_experimental_arch` (#93335). Refs: [Section 1.1 "Registers and calling convention" in BPF ABI Recommended Conventions and Guidelines v1.0](https://github.com/torvalds/linux/blob/v6.13/Documentation/bpf/standardization/abi.rst#11registers-and-calling-convention) > R0 - R5 are scratch registers and BPF programs needs to spill/fill them if necessary across calls. cc `@alessandrod` `@dave-tucker` `@tamird` `@vadorovsky` (target maintainers mentioned in platform support document which will be added by https://github.com/rust-lang/rust/pull/135107) r? `@Amanieu` `@rustbot` label +O-eBPF +A-inline-assembly
2025-01-31Rollup merge of #135992 - madsmtm:new-target-docs, r=jieyouxuMatthias Krüger-0/+16
Improve documentation when adding a new target https://github.com/rust-lang/rust/pull/133631#issuecomment-2607877936 shows that it can be a bit difficult process-wise to add a new target. I've added a bit of text to the docs, suggesting that users add the target defintion/spec first, and later work on `std` support. I also found that we have two places where we document how to add a new target. I've linked these for now, but they should probably be merged somehow in the future. `@rustbot` label A-docs r? compiler CC `@workingjubilee` who's worked a lot on target specs IIRC.
2025-01-31Rollup merge of #135860 - fmease:compiler-mv-obj-save-dyn-compat-ii, r=jieyouxuMatthias Krüger-195/+193
Compiler: Finalize dyn compatibility renaming Update the Reference link to use the new URL fragment from https://github.com/rust-lang/reference/pull/1666 (this change has finally hit stable). Fixes a FIXME. Follow-up to #130826. Part of #130852. ~~Blocking it on #133372.~~ (merged) r? ghost
2025-01-31Rollup merge of #134531 - GuillaumeGomez:extract-doctests, ↵Matthias Krüger-39/+308
r=notriddle,aDotInTheVoid [rustdoc] Add `--extract-doctests` command-line flag Part of https://github.com/rust-lang/rust/issues/134529. It was discussed with the Rust-for-Linux project recently that they needed a way to extract doctests so they can modify them and then run them more easily (look for "a way to extract doctests" [here](https://github.com/Rust-for-Linux/linux/issues/2)). For now, I output most of `ScrapedDoctest` fields in JSON format with `serde_json`. So it outputs the following information: * filename * line * langstr * text cc `@ojeda` r? `@notriddle`
2025-01-31Insert null checks for pointer dereferences when debug assertions are enabledBastian Kersting-6/+281
Similar to how the alignment is already checked, this adds a check for null pointer dereferences in debug mode. It is implemented similarly to the alignment check as a MirPass. This is related to a 2025H1 project goal for better UB checks in debug mode: https://github.com/rust-lang/rust-project-goals/pull/177.
2025-01-31miri: make float min/max non-deterministicRalf Jung-6/+64
2025-01-31Auto merge of #136332 - jhpratt:rollup-aa69d0e, r=jhprattbors-564/+1078
Rollup of 9 pull requests Successful merges: - #132156 (When encountering unexpected closure return type, point at return type/expression) - #133429 (Autodiff Upstreaming - rustc_codegen_ssa, rustc_middle) - #136281 (`rustc_hir_analysis` cleanups) - #136297 (Fix a typo in profile-guided-optimization.md) - #136300 (atomic: extend compare_and_swap migration docs) - #136310 (normalize `*.long-type.txt` paths for compare-mode tests) - #136312 (Disable `overflow_delimited_expr` in edition 2024) - #136313 (Filter out RPITITs when suggesting unconstrained assoc type on too many generics) - #136323 (Fix a typo in conventions.md) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Recommend adding target spec first, then std support laterMads Marquart-0/+7
Co-Authored-By: Jieyou Xu <jieyouxu@outlook.com>
2025-01-31Auto merge of #136331 - jhpratt:rollup-curo1f4, r=jhprattbors-188/+287
Rollup of 8 pull requests Successful merges: - #135414 (Stabilize `const_black_box`) - #136150 (ci: use windows 2025 for i686-mingw) - #136258 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 11)) - #136270 (Remove `NamedVarMap`.) - #136278 (add constraint graph to polonius MIR dump) - #136287 (LLVM changed the nocapture attribute to captures(none)) - #136291 (some test suite cleanups) - #136296 (float::min/max: mention the non-determinism around signed 0) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31triagebot: remove myself from vacation许杰友 Jieyou Xu (Joe)-1/+0
2025-01-31Rollup merge of #136323 - etaoins:fix-typo-in-conventions-md, r=tgross35Jacob Pratt-1/+1
Fix a typo in conventions.md Introduced in #135950
2025-01-31Rollup merge of #136313 - compiler-errors:too-many-args, r=lqdJacob Pratt-0/+32
Filter out RPITITs when suggesting unconstrained assoc type on too many generics Fixes #136233
2025-01-31Rollup merge of #136312 - compiler-errors:overflow_delimited_expr-2024, r=ytmimiJacob Pratt-89/+58
Disable `overflow_delimited_expr` in edition 2024 This reverts the style guide changes and sets the default to "false" in rustfmt for style edition 2024. r? `@ytmimi` cc `@rust-lang/style` `@rust-lang/rustfmt`
2025-01-31Rollup merge of #136310 - lqd:long-types, r=compiler-errorsJacob Pratt-55/+73
normalize `*.long-type.txt` paths for compare-mode tests When using a compare mode, the name of the test + compare-mode is embedded in some of rustc's output, like the location where a long type `bla.long-type(-some-hash)?.txt` is written to. That generally makes these tests fail under all compare-modes. This PR fixes this by normalizing the compare-mode suffix away in the stderr output. We can also see some remnants of the long-removed `nll` compare mode being normalized away ^^. I did this to fix some failures with `--compare-mode next-solver` (but it also fixes them with e.g. `--compare-mode polonius` of course): - it makes 9 new tests pass with the new solver - however, 3 tests I changed here still don't pass with the new solver (IIRC there were 2 ICEs, and some duplicate errors for the 3rd one) (There was also one that triggered slowness in the new solver while triggering the long type failure, I'll mention this on zulip. )
2025-01-31Rollup merge of #136300 - RalfJung:compare-and-swap, r=joboetJacob Pratt-0/+18
atomic: extend compare_and_swap migration docs Fixes https://github.com/rust-lang/rust/issues/80486
2025-01-31Rollup merge of #136297 - zeenix:patch-1, r=lqdJacob Pratt-1/+1
Fix a typo in profile-guided-optimization.md It's either "profile-guided" or "profiled-guided" and I think it'sw the former. :)
2025-01-31Rollup merge of #136281 - nnethercote:rustc_hir_analysis, r=lcnrJacob Pratt-315/+224
`rustc_hir_analysis` cleanups Just some improvements I found while looking through this code. r? `@lcnr`