summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-03-14also skip abi_required_features check in rustdocRalf Jung-5/+10
(cherry picked from commit 4c939db0e775df21a0b409b7603eaaf0056e8f86)
2025-03-14also fix potential issues with mixed stable/unstable target features in rustdocRalf Jung-8/+32
(cherry picked from commit 039af88e09f4f4beb47406f4771bffc2e61d800a)
2025-03-14rustdoc: disable forbidden #[target_feature] checkRalf Jung-2/+5
(cherry picked from commit b6f22400002f7921feed13e35852e3041cf2b145)
2025-02-13Revert "Stabilize `extended_varargs_abi_support`"Jubilee Young-7/+35
This reverts commit 685f189b4307435b83d625fea397ef36dff4e955.
2025-02-13fix ensure_monomorphic_enoughLukas Markeffsky-41/+3
(cherry picked from commit c1da4f1d3c4fc4beb5edcfa8a303a1dcbe27b65e)
2025-02-10peace of mind: be absolutely sure we don't try to emit a 0-part suggestiondianne-1/+4
(cherry picked from commit 8dcdb3eb3c28428267bd7bf4cb63e06f9e4330c1)
2025-02-10try to suggest eliding redundant binding modifiersdianne-39/+69
(cherry picked from commit b32a5331dcdcc1993fefeff412a20766557e558d)
2025-02-10peace of mind: remove a call to `Option::expect`dianne-2/+3
(cherry picked from commit 060cc37f3225dd69b5d0df089eec52ff92953b01)
2025-02-10reword default binding mode notesdianne-9/+3
(cherry picked from commit a5cc4cbe64876c339cc1fb47fb962792bc142146)
2025-02-10separate labels for default binding mode spans into their own notesdianne-19/+39
(cherry picked from commit 767f82039c221fa609f752d2a2ea4ffd664f8138)
2025-02-10don't include trailing open parens in labels for reference patternsdianne-1/+1
(cherry picked from commit a064e786633ac81c35abcf00abd9dc57a40ad9bf)
2025-02-10experimentally label the spans for default binding modesdianne-58/+100
(cherry picked from commit 203d3109d8e96a6a4075205e836216d7cd281d5b)
2025-02-10highlight the whole problem subpattern when pointing out the default binding ↵dianne-17/+28
mode (cherry picked from commit 4331f55b729d1a41004305f85dfe4dbbcec3ee3f)
2025-02-10use more specific wording for subpatterns from macro expansionsdianne-1/+4
(cherry picked from commit bbe40acb9a192ab2afec1f8adc45c3b72925caf2)
2025-02-10reword pattern migration diagnostic to make sense in all editionsdianne-37/+76
This aligns the main error message a bit more with the phrasing in the Edition Guide and provides a bit more information on the labels to (hopefully!) aid in understanding. (cherry picked from commit bdc6c4d07b5ccb91df396e152deafc3a66b539ab)
2025-02-10pattern migration: move labels out of the suggestion structdianne-19/+15
(cherry picked from commit 724b885b4e486a355d176dc78098e131f9c1b2ef)
2025-02-06Enable kernel sanitizers for aarch64-unknown-none-softfloatJubilee Young-1/+3
We want kernels to be able to use this bare metal target, so let's enable the sanitizers that kernels want to use. (cherry picked from commit 6b06aa619297c198e923e1d406a5bb0534260fef)
2025-02-06ensure sufficient stack in unsafety checkRémy Rakic-1/+4
(cherry picked from commit 94562ee1eae83d6cc80bda4d57b43bcdb7a842b5)
2025-02-06ensure sufficient stack in tail call checkRémy Rakic-5/+8
(cherry picked from commit 2c778c1e4ca8053e787998c9b18bb57222719a3d)
2025-02-06Revert "Auto merge of #133734 - scottmcm:lower-indexing-to-ptrmetadata, ↵Rémy Rakic-121/+37
r=davidtwco,RalfJung" This reverts commit b57d93d8b9525fa261404b4cd9c0670eeb1264b8, reversing changes made to 0aeaa5eb22180fdf12a8489e63c4daa18da6f236. (cherry picked from commit 122a55bb442bd1995df9cf9b36e6f65ed3ef4a1d)
2025-02-06Revert "Rollup merge of #134371 - scottmcm:fix-134352, r=oli-obk"Rémy Rakic-25/+7
This reverts commit 7c301ecdf5e806b7aa3c44e4a185049fabbc4381, reversing changes made to dffaad83327454430129802f240121f8c7866208. (cherry picked from commit 0bb4880581a6963e0b895f9550e9147c68b9537a)
2025-02-06Revert "Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthewjasper"Rémy Rakic-13/+188
This reverts commit e108481f74ff123ad98a63bd107a18d13035b275, reversing changes made to 303e8bd768526a5812bb1776e798e829ddb7d3ca. (cherry picked from commit ca1c17c88d1f625763859396ba7a50f36ac45cc0)
2025-02-06Add check for missing fields in enum variant patternEsteban Küber-1/+1
(cherry picked from commit d44f021904e3d5b2870e3c835cbad5e1421e83ec)
2025-02-06Ensure that we don't try to access fields on a non-struct pattern type in ↵Esteban Küber-1/+3
diagnostic Fix #135209. (cherry picked from commit 5f04f98c9aaf04e5f670e04dc12d4665489859fd)
2025-01-25Only assert the `Parser` size on specific archesJosh Stone-2/+3
The size of this struct depends on the alignment of `u128`, for example powerpc64le and s390x have align-8 and end up with only 280 bytes. Our 64-bit tier-1 arches are the same though, so let's just assert on those. (cherry picked from commit aef640a6130ccb3edf9bc720881c3a9dde3c0ecd)
2025-01-23When LLVM's location discriminator value limit is exceeded, emit locations ↵Kyle Huey-52/+35
with dummy spans instead of dropping them entirely Revert most of #133194 (except the test and the comment fixes). Then refix not emitting locations at all when the correct location discriminator value exceeds LLVM's capacity. (cherry picked from commit 45ef92731b637a60cbad7cecf5382361bbf40531)
2025-01-23add cache to `AmbiguityCausesVisitor`lcnr-2/+12
(cherry picked from commit 94bf8f04f402a2410ab85a6e6b9e542e3942b2a2)
2025-01-23avoid running the overlap check twicelcnr-22/+33
(cherry picked from commit ebbcfd4e7721aaf3211f0e8d3d6e304400c80f78)
2025-01-23Always force non-trimming of path in `unreachable_patterns` lintEsteban Küber-8/+1
Creating a "trimmed DefID path" when no error is being emitted is an ICE (on purpose). If we create a trimmed path for a lint that is then silenced before being emitted causes a known ICE. This side-steps the issue by always using `with_no_trimmed_path!`. This was verified to fix https://github.com/quinn-rs/quinn/, but couldn't write a repro case for the test suite. Fix #135289. (cherry picked from commit 93a19501c2bad56e73f0ac9f3ae062b614d30832)
2025-01-16Make sure to mark IMPL_TRAIT_REDUNDANT_CAPTURES as Allow in edition 2024Michael Goulet-1/+1
(cherry picked from commit 1b068a0dea794373301f4ddbfb35a378c6805276)
2025-01-10Try to explain borrow for tail expr temporary drop order change in 2024Michael Goulet-16/+35
(cherry picked from commit c55eefe8bc51f302cfc89d375198ca7211d4709b)
2025-01-10Don't do AccessDepth::Drop for types with no drop implMichael Goulet-4/+12
(cherry picked from commit 4a099b29cdb6a7841019406f0f2b5035a1fd9a08)
2025-01-10Don't create cycles by normalizing opaques defined in the body we're checkingMichael Goulet-1/+6
(cherry picked from commit 197f6d8081451c5ad394601dbdd8509bbb92f446)
2025-01-10remove an extraneous commentwieDasDing-1/+0
Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com> (cherry picked from commit 13c7122df869f6b29799ea96599cce1fc5880376)
2025-01-10apply suggestions on fn nameDing Xiang Fei-4/+4
(cherry picked from commit 34edb21f0bb34916410eb92b108d84075e4abd7e)
2025-01-10run borrowck tests on BIDs and emit tail-expr-drop-order lints forDing Xiang Fei-17/+78
potential violations (cherry picked from commit 045271ccccd6c485f65ed94aeef3357a512e22fb)
2025-01-07Pass objcopy args for stripping on OSXNoratrieb-18/+7
When `-Cstrip` was changed to use the bundled rust-objcopy instead of /usr/bin/strip on OSX, strip-like arguments were preserved. But strip and objcopy are, while being the same binary, different, they have different defaults depending on which binary they are. Notably, strip strips everything by default, and objcopy doesn't strip anything by default. Additionally, `-S` actually means `--strip-all`, so debuginfo stripped everything and symbols didn't strip anything. We now correctly pass `--strip-debug` and `--strip-all`.
2025-01-07update version placeholdersPietro Albini-15/+15
2025-01-03Rollup merge of #135049 - cramertj:rmunused, r=compiler-errorsMatthias Krüger-25/+7
Remove unused fields from RepeatElementCopy obligation
2025-01-03Rollup merge of #135042 - lukas-code:taint-dyn-incompat, r=compiler-errorsMatthias Krüger-1/+6
taint fcx on selection errors during unsizing With `feature(dyn_compatible_for_dispatch)` we only check for dyn-compatibility by checking the `T: Unsize<dyn Trait>` predicate during the unsizing coercions checks. If the predicate doesn't hold, we emit an error, but pretend the coercion succeeded to prevent further errors. To prevent const eval from attempting to actually perform this coercion, we need to taint the fcx after reporting the trait errors in the coercion check. fixes https://github.com/rust-lang/rust/issues/135021 fixes https://github.com/rust-lang/rust/issues/130521
2025-01-03Rollup merge of #131729 - Urgau:check-cfg-test-userspace, r=petrochenkovMatthias Krüger-2/+5
Make the `test` cfg a userspace check-cfg This PR implements MCP https://github.com/rust-lang/compiler-team/issues/785, which makes the `test` cfg a "userspace" check-cfg, i.e. no longer included in the well known cfg list. Things to do: - [x] Accept the MCP (https://github.com/rust-lang/compiler-team/issues/785#issuecomment-2424121886) - [x] Mark `test` in Cargo (https://github.com/rust-lang/cargo/pull/14963) `@rustbot` labels +S-waiting-on-MCP +F-check_cfg r? `@petrochenkov`
2025-01-02Remove unused fields from RepeatElementCopy obligationTaylor Cramer-25/+7
2025-01-02taint fcx on selection errors during unsizingLukas Markeffsky-1/+6
2025-01-02Make the `test` cfg a "userspace" check-cfgUrgau-2/+5
2025-01-02Remove range-metadata amdgpu workaroundFlakebi-8/+0
Range metadata was disabled for amdgpu due to a backend bug. I did not encounter any problems when removing the workaround to enable range metadata (tried compiling `core` and `alloc`), so I assume this has been fixed in LLVM in the last years. Remove the workaround to re-enable range metadata.
2025-01-02Auto merge of #130060 - EnzymeAD:enzyme-cg-llvm, r=oli-obkbors-28/+610
Autodiff Upstreaming - rustc_codegen_llvm changes Now that the autodiff/Enzyme backend is merged, this is an upstream PR for the `rustc_codegen_llvm` changes. It also includes small changes to three files under `compiler/rustc_ast`, which overlap with my frontend PR (https://github.com/rust-lang/rust/pull/129458). Here I only include minimal definitions of structs and enums to be able to build this backend code. The same goes for minimal changes to `compiler/rustc_codegen_ssa`, the majority of changes there will be in another PR, once either this or the frontend gets merged. We currently have 68 files left to merge, 19 in the frontend PR, 21 (+3 from the frontend) in this PR, and then ~30 in the middle-end. This PR is large because it includes two of my three large files (~800 loc each). I could also first only upstream enzyme_ffi.rs, but I think people might want to see some use of these bindings in the same PR? To already highlight the things which reviewers might want to discuss: 1) `enzyme_ffi.rs`: I do have a fallback module to make sure that we don't link rustc against Enzyme when we build rustc without autodiff support. 2) `add_panic_msg_to_global` was a pain to write and I currently can't even use it. Enzyme writes gradients into shadow memory. Pass in one float scalar? We'll allocate and return an extra float telling you how this float affected the output. Pass in a slice of floats? We'll let you allocate the vector and pass in a mutable reference to a float slice, we'll then write the gradient into that slice. It should be at least as large as your original slice, so we check that and panic if not. Currently we panic silently, but I already generate a nicer panic message with this function. I just don't know how to print it to the user. yet. I discussed this with a few rustc devs and the best we could come up with (for now), was to look for mangled panic calls in the IR and pick one, which works surprisingly reliably. If someone knows a good way to clean this up and print the panic message I'm all in, otherwise I can remove the code that writes the nicer panic message and keep the silent panic, since it's enough for soundness. Especially since this PR is already a bit larger. 3) `SanitizeHWAddress`: When differentiating C++, Enzyme can use TBAA to "understand" enums/unions, but for Rust we don't have this information. LLVM might to speculative loads which (without TBAA) confuse Enzyme, so we disable those with this attribute. This attribute is only set during the first opt run before Enzyme differentiates code. We then remove it again once we are done with autodiff and run the opt pipeline a second time. Since enums are everywhere in Rust, support for them is crucial, but if this looks too cursed I can remove these ~100 lines and keep them in my fork for now, we can then discuss them separately to make this PR simpler? 4) Duplicated llvm-opt runs: Differentiating already optimized code (and being able to do additional optimizations on the fly, e.g. for GPU code) is _the_ reason why Enzyme is so fast, so the compile time is acceptable for autodiff users: https://enzyme.mit.edu/talks/Publications/ (There are also algorithmic issues in Enzyme core which are more serious than running opt twice). 5) I assume that if we merge these minimal cg_ssa changes here already, I also need to fix the other backends (GCC and cliff) to have dummy implementations, correct? 6) *I'm happy to split this PR up further if reviewers have recommendations on how to.* For the full implementation, see: https://github.com/rust-lang/rust/pull/129175 Tracking: - https://github.com/rust-lang/rust/issues/124509
2025-01-01Rollup merge of #135000 - compiler-errors:opaque-captures-dupe, r=lqdMatthias Krüger-12/+17
Fix ICE when opaque captures a duplicated/invalid lifetime See description on test. Fixes #132766 Fixes #133693 Fixes #134780
2025-01-01Rollup merge of #134984 - compiler-errors:obligation-tweaks, r=lqdMatthias Krüger-42/+28
`ObligationCause` construction tweaks in typeck Mostly just consolidating the way we construct obligations in `FnCtxt`.
2025-01-01upstream rustc_codegen_llvm changes for enzyme/autodiffManuel Drehwald-28/+610
2025-01-01Fix ICE when opaque captures a duplicated/invalid lifetimeMichael Goulet-12/+17