about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-02-09Rollup merge of #136722 - kornelski:visit-spans, r=chenyukangMatthias Krüger-3/+8
Visit all debug info in MIR Visitor I've been experimenting with simplifying debug info in MIR inliner, and discovered that MIR Visitor doesn't reliably visit all spans. This PR adds the missing visitor calls.
2025-02-09Emit an error if `-Zdwarf-version=1` is requestedWesley Wiser-2/+5
DWARF 1 is very different than DWARF 2+ (see the commentary in https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#index-gdwarf) and LLVM does not really seem to support DWARF 1 as Clang does not offer a `-gdwarf-1` flag and `llc` will just generate DWARF 2 with the version set to 1: https://godbolt.org/z/s85d87n3a. Since this isn't actually supported (and it's not clear it would be useful anyway), report that DWARF 1 is not supported if it is requested. Also add a help message to the error saying which versions are supported.
2025-02-09Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrumbors-3769/+4793
Update bootstrap compiler and rustfmt The rustfmt version we previously used formats things differently from what the latest nightly rustfmt does. This causes issues for subtrees that get formatted both in-tree and in their own repo. Updating the rustfmt used in-tree solves those issues. Also bumped the bootstrap compiler as the stage0 update command always updates both at the same time.
2025-02-09Auto merge of #136754 - Urgau:rollup-qlkhjqr, r=Urgaubors-33/+64
Rollup of 5 pull requests Successful merges: - #134679 (Windows: remove readonly files) - #136213 (Allow Rust to use a number of libc filesystem calls) - #136530 (Implement `x perf` directly in bootstrap) - #136601 (Detect (non-raw) borrows of null ZST pointers in CheckNull) - #136659 (Pick the max DWARF version when LTO'ing modules with different versions ) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-09move repr(transparent) checks to coherenceDing Xiang Fei-10/+12
2025-02-09rename the trait to validity and place a feature gate afrontDing Xiang Fei-13/+24
2025-02-09introduce CoercePointeeWellformed for coherence checks at typeck stageDing Xiang Fei-10/+238
2025-02-09Fix unwrap error in overflowing int literalyukang-4/+7
2025-02-08Rollup merge of #136736 - llogiq:small-resolve-refactor, r=jieyouxuJubilee-16/+17
Small resolve refactor I was looking into how resolve works in order to find a good way for clippy to shorten paths in messages and suggestions, and found a needless `.collect()` and a recursive function that could be written as a loop, also removed a panicky code path.
2025-02-08Rollup merge of #136730 - lukas-code:trans-ice, r=jswrennJubilee-18/+14
transmutability: fix ICE when passing wrong ADT to ASSUME - Remove an incorrect assert that the `ASSUME` parameter has the type `Assume` and delay a bug instead. - Since we checked the type of `ASSUME` is `Assume` (an ADT), its valtree must be a branch, so we can just unwrap it. r? ```@jswrenn```
2025-02-08Rollup merge of #136706 - workingjubilee:finish-up-rustc-abi-updates, ↵Jubilee-118/+159
r=compiler-errors compiler: mostly-finish `rustc_abi` updates This almost-finishes all the updates in the compiler to use `rustc_abi` and removes some of the reexports of `rustc_abi` items in `rustc_target` that were previously available. r? ```@compiler-errors```
2025-02-09Rollup merge of #136659 - wesleywiser:dwarf_version_lto_merge_behavior, ↵Urgau-1/+5
r=jieyouxu Pick the max DWARF version when LTO'ing modules with different versions Currently, when rustc compiles code with `-Clto` enabled that was built with different choices for `-Zdwarf-version`, a warning will be reported. It's very easy to observe this by compiling most anything (eg, "hello world") and specifying `-Clto -Zdwarf-version=5` since the standard library is distributed with `-Zdwarf-version=4`. This behavior isn't actually useful for a few reasons: - From observation, LLVM chooses to pick the highest DWARF version anyway after issuing the warning. - Clang specifies that in this case, the max version should be picked without a warning and as a general principle, we want to support x-lang LTO with Clang which implies using the same module flag merge behaviors. - Debuggers need to be able to handle a variety of versions within the same debugging session as you can easily have some parts of a binary (or some dynamic libraries within an application) all compiled with different DWARF versions. This commit changes the module flag merge behavior to match Clang and use the highest version of DWARF. It also adds a test to ensure this behavior is respected in the case of two crates being LTO'd together and adds a test to ensure no warning is printed. Fixes #130041 which fails due to these warnings being printed cc #103057
2025-02-08occured -> occurredMichael Goulet-3/+3
2025-02-08Rustfmtbjorn3-3769/+4793
2025-02-08Detect (non-raw) borrows of null ZST pointers in CheckNullMichael Goulet-29/+56
2025-02-08Auto merge of #136747 - matthiaskrgr:rollup-qfiiv4n, r=matthiaskrgrbors-6/+33
Rollup of 6 pull requests Successful merges: - #135696 (std: move `io` module out of `pal`, get rid of `sys_common::io`) - #136099 (Optimize `Rc::<str>::default()` implementation) - #136200 (Generate correct terminate block under Wasm EH) - #136626 (create `initial_rustdoc` field in `Build`) - #136657 (Make empty-line-after an early clippy lint) - #136679 (ci: Use largedisk for loongarch) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-08Rollup merge of #136657 - jdonszelmann:empty-line-after, ↵Matthias Krüger-0/+10
r=y21,flip1995,WaffleLapkin Make empty-line-after an early clippy lint r? ```@y21``` 95% a refiling of https://github.com/rust-lang/rust-clippy/pull/13658 but for correctness it needed 2 extra methods in `rust_lint` which made it much easier to apply on `rust-lang/rust` than `rust-lang/rust-clippy`. Commits have been thoroughly reviewed on `rust-lang/clippy already`. The last two review comments there (about using `Option` and popping for assoc items have been applied here.
2025-02-08Rollup merge of #136200 - purplesyringa:wasm-eh-fixes, r=bjorn3Matthias Krüger-6/+23
Generate correct terminate block under Wasm EH This fixes failing LLVM assertions during insnsel. Improves #135665. r? bjorn3 ^ you reviewed the PR bringing Wasm EH in, I assume this is within your area of expertise?
2025-02-08Auto merge of #136715 - bjorn3:sync_cg_clif-2025-02-07, r=bjorn3bors-71/+97
Subtree sync for rustc_codegen_cranelift The main highlights this time are a Cranelift update and a fix for a warning that the x87 feature is not enabled. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler<!-- homu-ignore:start -->
2025-02-08Pick the max DWARF version when LTO'ing modules with different versionsWesley Wiser-1/+5
Currently, when rustc compiles code with `-Clto` enabled that was built with different choices for `-Zdwarf-version`, a warning will be reported. It's very easy to observe this by compiling most anything (eg, "hello world") and specifying `-Clto -Zdwarf-version=5` since the standard library is distributed with `-Zdwarf-version=4`. This behavior isn't actually useful for a few reasons: - from observation, LLVM chooses to pick the highest DWARF version anyway after issuing the warning - Clang specifies that in this case, the max version should be picked without a warning and as a general principle, we want to support x-lang LTO with Clang which implies using the same module flag merge behaviors - Debuggers need to be able to handle a variety of versions withing the same debugging session as you can easily have some parts of a binary (or some dynamic libraries within an application) all compiled with different DWARF versions This commit changes the module flag merge behavior to match Clang and use the highest version of DWARF. It also adds a test to ensure this behavior is respected in the case of two crates being LTO'd together and updates the test added in the previous commit to ensure no warning is printed.
2025-02-08Auto merge of #136728 - matthiaskrgr:rollup-x2qh9yt, r=matthiaskrgrbors-35/+19
Rollup of 6 pull requests Successful merges: - #136640 (Debuginfo for function ZSTs should have alignment of 8 bits, not 1 bit) - #136648 (Add a missing `//@ needs-symlink` to `tests/run-make/libs-through-symlinks`) - #136651 (Label mismatched parameters at the def site for foreign functions) - #136691 (Remove Linkage::Private and Linkage::Appending) - #136692 (add module level doc for bootstrap:utils:exec) - #136700 (i686-unknown-hurd-gnu: bump baseline CPU to Pentium 4) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-08Small resolve refactorAndre Bogus-16/+17
2025-02-07compiler: use rustc_abi in rustc_ast_*Jubilee Young-16/+17
2025-02-08transmutability: fix ICE when passing wrong ADT to ASSUMELukas Markeffsky-18/+14
2025-02-08rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync"Askar Safin-3/+0
We don't need to "short circuit trait resolution", because DynSend and DynSync are auto traits and thus coinductive
2025-02-07fix non-enzyme buildsManuel Drehwald-8/+14
2025-02-08Rollup merge of #136700 - RalfJung:hurd, r=NoratriebMatthias Krüger-1/+1
i686-unknown-hurd-gnu: bump baseline CPU to Pentium 4 See https://github.com/rust-lang/rust/issues/136495 for context. ``@sthibaul`` (the only listed target maintainer) said they would be [fine](https://github.com/rust-lang/rust/issues/136495#issuecomment-2638355845) with this change.
2025-02-08Rollup merge of #136691 - bjorn3:linkage_cleanup, r=jieyouxuMatthias Krüger-23/+4
Remove Linkage::Private and Linkage::Appending Neither of them has any use case. Neither known nor theoretical.
2025-02-08Rollup merge of #136651 - Jarcho:fn_ctxt3, r=compiler-errorsMatthias Krüger-3/+9
Label mismatched parameters at the def site for foreign functions Nice and simple. Adds parameter marking for the only missing definition type. r? ``@compiler-errors``
2025-02-08Rollup merge of #136640 - Zalathar:debuginfo-align-bits, r=compiler-errorsMatthias Krüger-8/+5
Debuginfo for function ZSTs should have alignment of 8 bits, not 1 bit In #116096, function ZSTs were made to have debuginfo that gives them an alignment of “1”. But because alignment in LLVM debuginfo is denoted in *bits*, not bytes, this resulted in an alignment specification of 1 bit instead of 1 byte. I don't know whether this has any practical consequences, but I noticed that a test started failing when I accidentally fixed the mistake while working on #136632, so I extracted the fix (and the test adjustment) to this PR.
2025-02-08Auto merge of #136713 - matthiaskrgr:rollup-sy6py39, r=matthiaskrgrbors-54/+94
Rollup of 7 pull requests Successful merges: - #135179 (Make sure to use `Receiver` trait when extracting object method candidate) - #136554 (Add `opt_alias_variances` and use it in outlives code) - #136556 ([AIX] Update tests/ui/wait-forked-but-failed-child.rs to accomodate exiting and idle processes.) - #136589 (Enable "jump to def" feature on rustc docs) - #136615 (sys: net: Add UEFI stubs) - #136635 (Remove outdated `base_port` calculation in std net test) - #136682 (Move two windows process tests to tests/ui) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-08Visit fn_span of calls in MIR VisitorKornel-2/+4
2025-02-08Visit SourceInfo of all TerminatorsKornel-0/+2
2025-02-08super_local_decl should visit source_info before copying itKornel-1/+2
Visiting source_info first makes it consistent with other visitors
2025-02-07Update `compiler-builtins` to 0.1.146Trevor Gross-2/+2
Exposes the error function so we can expose this in the standard library [1]. [1]: https://github.com/rust-lang/compiler-builtins/pull/753
2025-02-07Merge commit '8332329f83d4ef34479fec67cc21b21246dca6b5' into ↵bjorn3-71/+97
sync_cg_clif-2025-02-07
2025-02-07Rollup merge of #136589 - GuillaumeGomez:enable-jump-to-def-compiler, r=oli-obkMatthias Krüger-1/+3
Enable "jump to def" feature on rustc docs This PR enables the rustdoc "jump to def" feature which is visible on the source code pages. r? ``@oli-obk``
2025-02-07Rollup merge of #136554 - compiler-errors:opt-alias-variances, r=lcnrMatthias Krüger-50/+80
Add `opt_alias_variances` and use it in outlives code ...so to fix some subtle outlives bugs with precise capturing in traits, and eventually make it easier to compute variances for "forced unconstrained" trait lifetimes. r? lcnr
2025-02-07Rollup merge of #135179 - compiler-errors:arbitrary-self-types-object, r=BoxyUwUMatthias Krüger-3/+11
Make sure to use `Receiver` trait when extracting object method candidate In method confirmation, the `extract_existential_trait_ref` function re-extracts the object type by derefing until it reaches an object. If we're assembling methods via the `Receiver` trait, make sure we re-do our work also using the receiver trait. Fixes #135155 cc ``@adetaylor``
2025-02-07compiler: remove reexports from rustc_target::callconvJubilee Young-15/+14
2025-02-07compiler: remove rustc_target::abi entirelyJubilee Young-87/+128
2025-02-07rustc_target: Add the fp16 target feature for AArch32Kajetan Puchalski-0/+2
2025-02-07i686-unknown-hurd-gnu: bump baseline CPU to Pentium 4Ralf Jung-1/+1
2025-02-07Replace i686-unknown-redox target with i586-unknown-redoxJeremy Soller-3/+3
2025-02-07Rollup merge of #136664 - WaffleLapkin:un-map_or-true, r=compiler-errorsMatthias Krüger-1/+1
replace one `.map_or(true, ...)` with `.is_none_or(...)` Randomly found while going through some of my old branches.
2025-02-07Rollup merge of #136653 - dpaoliello:cleanllvm1, r=ZalatharMatthias Krüger-60/+0
Remove dead code from rustc_codegen_llvm and the LLVM wrapper First step to clean up the LLVM wrapper: remove existing dead code. Split out of #135502 r? ``@Zalathar``
2025-02-07Rollup merge of #136598 - compiler-errors:unit-fallback, r=WaffleLapkinMatthias Krüger-2/+16
Fix suggestion for `dependency_on_unit_never_type_fallback` involving closures + format args expansions fixes #136562 r? wafflelapkin or reassign
2025-02-07Rollup merge of #136577 - dianne:simple-pat-migration-simplification, ↵Matthias Krüger-91/+230
r=Nadrieril Pattern Migration 2024: try to suggest eliding redundant binding modifiers This is based on #136475. Only the last commit is new. This is a simpler, more restrictive alternative to #136496, meant to partially address #136047. If a pattern can be migrated to Rust 2024 solely by removing redundant binding modifiers, this will make that suggestion; otherwise, it uses the old suggestion of making the pattern fully explicit. Relevant tracking issue: #131414 ``@rustbot`` label A-diagnostics A-patterns A-edition-2024 r? ``@Nadrieril``
2025-02-07Rollup merge of #134367 - WaffleLapkin:trait_upcasting_as_a_treat, ↵Matthias Krüger-106/+19
r=compiler-errors Stabilize `feature(trait_upcasting)` This feature was "done" for a while now, I think it's finally time to stabilize it! Stabilization report: https://github.com/rust-lang/rust/pull/134367#issuecomment-2545839841. cc reference PR: https://github.com/rust-lang/reference/pull/1622. Closes #65991 (tracking issue), closes #89460 (the lint is no longer future incompat). r? compiler-errors
2025-02-07Remove Linkage::Appendingbjorn3-7/+0
It can only be used for certain LLVM internal variables like llvm.global_ctors which users are not allowed to define.