about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-01-28Suggest considering casting fn item as fn pointer in more casesmu001999-6/+44
2025-01-28miri: optimize zeroed allocSpecificProtagonist-30/+59
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-01-28Auto merge of #133929 - saethlin:remove-inline-in-all-cgus, r=nnethercotebors-12/+4
Remove -Zinline-in-all-cgus and clean up tests/codegen-units/ Implementation of https://github.com/rust-lang/compiler-team/issues/814 I've taken some liberties with cleaning up the CGU partitioning tests, because that's the only place this flag was used and also mattered. I've often fought a lot with the contents of `tests/codegen-units` and it has never been clear to me when a test failure indicates a problem with my changes as opposed to a test just needing to be manually blessed. Hopefully the combination of the new README, new comments, and using `-Zprint-mono-items=lazy` in the partitioning tests improves that. I've also deleted some of the `tests/run-make/sepcomp` tests. I think all the "sepcomp" tests have been obviated for years by better-designed (less flaky, clearer failures) test suites, but here I'm just deleting the ones I'm confident in.
2025-01-28Edit the inputs to const == val check instead of duplicating logicOli Scherer-32/+34
2025-01-28Make mir dumps more readableOli Scherer-0/+4
2025-01-28Auto merge of #134290 - tgross35:windows-i128-callconv, r=bjorn3,wesleywiserbors-57/+37
Windows x86: Change i128 to return via the vector ABI Clang and GCC both return `i128` in xmm0 on windows-msvc and windows-gnu. Currently, Rust returns the type on the stack. Add a calling convention adjustment so we also return scalar `i128`s using the vector ABI, which makes our `i128` compatible with C. In the future, Clang may change to return `i128` on the stack for its `-msvc` targets (more at [1]). If this happens, the change here will need to be adjusted to only affect MinGW. Link: https://github.com/rust-lang/rust/issues/134288 (does not fix) [1] try-job: x86_64-msvc try-job: x86_64-msvc-ext1 try-job: x86_64-mingw-1 try-job: x86_64-mingw-2
2025-01-28Reject unsound toggling of Arm atomics-32 target featureTaiki Endo-0/+5
2025-01-28Implement MIR const trait stability checksDeadbeef-110/+120
2025-01-27Remove -Zinline-in-all-cgus and clean up CGU partitioning testsBen Kimock-12/+4
2025-01-28update commentsRalf Jung-13/+11
2025-01-28ABI-required target features: warn when they are missing in base CPU (rather ↵Ralf Jung-104/+61
than silently enabling them)
2025-01-28GCI: Don't try to collect mono items inside overly generic free const itemsLeón Orell Valerian Liehr-4/+7
2025-01-28interpret: is_alloc_live: check global allocs lastRalf Jung-2/+4
2025-01-28Represent the raw pointer for a array length check as a new kind of fake borrowMichael Goulet-85/+160
2025-01-27Reapply "Auto merge of #133734 - scottmcm:lower-indexing-to-ptrmetadata, ↵Michael Goulet-37/+118
r=davidtwco,RalfJung" This reverts commit 122a55bb442bd1995df9cf9b36e6f65ed3ef4a1d.
2025-01-27Type level consts can show up in MIR type checkerMichael Goulet-2/+2
2025-01-27Stabilize target_feature_11Caleb Zulawski-21/+10
2025-01-27Adjust compiler for `HashMap::get_many_mut` stabilizationUrgau-2/+1
2025-01-27Flip the `rustc-rayon`/`indexmap` dependency orderJosh Stone-2/+2
[`rustc-rayon v0.5.1`](https://github.com/rust-lang/rustc-rayon/pull/14) added `indexmap` implementations that will allow `indexmap` to drop its own "internal-only" implementations. (This is separate from `indexmap`'s implementation for normal `rayon`.)
2025-01-27Auto merge of #136135 - GuillaumeGomez:rollup-1ik636d, r=GuillaumeGomezbors-186/+215
Rollup of 10 pull requests Successful merges: - #135773 (Clarify WindowsMut (Lending)Iterator) - #135807 (Implement phantom variance markers) - #135876 (fix doc for std::sync::mpmc) - #135988 (Add a workaround for parallel rustc crashing when there are delayed bugs) - #136037 (Mark all NuttX targets as tier 3 target and support the standard library) - #136064 (Add a suggestion to cast target_feature fn items to fn pointers.) - #136082 (Incorporate `iter_nodes` into `graph::DirectedGraph`) - #136112 (Clean up all dead files inside `tests/ui/`) - #136114 (Use identifiers more in diagnostics code) - #136118 (Change `collect_and_partition_mono_items` tuple return type to a struct) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-27Trim extra whitespace in fn ptr suggestion spanTyrone Wu-6/+50
Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type. Fixes: #133083 Signed-off-by: Tyrone Wu <wudevelops@gmail.com>
2025-01-28Use +secure-plt for powerpc-unknown-linux-gnu{,spe}Taiki Endo-1/+7
2025-01-27Rollup merge of #136118 - oli-obk:push-qsslxsopnrmr, r=ZalatharGuillaume Gomez-21/+33
Change `collect_and_partition_mono_items` tuple return type to a struct https://github.com/rust-lang/rust/pull/133429 will add a new field to this tuple, so it seems prudent to turn it into a struct first to avoid confusion about what the tuple elements mean.
2025-01-27Rollup merge of #136114 - compiler-errors:more-idents, r=jieyouxuGuillaume Gomez-90/+97
Use identifiers more in diagnostics code This should make the diagnostics code slightly more correct when rendering idents in mixed crate edition situations. Kinda a no-op, but a cleanup regardless. r? oli-obk or reassign
2025-01-27Rollup merge of #136082 - Zalathar:iter-nodes, r=oli-obkGuillaume Gomez-23/+18
Incorporate `iter_nodes` into `graph::DirectedGraph` This helper method iterates over all node IDs in the dense range `0..num_nodes`. In practice, we have a lot of graph-algorithm code that already assumes that nodes are densely numbered, by using `num_nodes` to allocate per-node indexed data structures. So I don't think this is actually a substantial change to the de-facto semantics of `graph::DirectedGraph`. --- Resolves a FIXME from #135481.
2025-01-27Rollup merge of #136064 - veluca93:tf11-fntrait-note, r=oli-obkGuillaume Gomez-0/+3
Add a suggestion to cast target_feature fn items to fn pointers. See https://github.com/rust-lang/rust/pull/134090#issuecomment-2612197095 for the motivation behind this suggestion. r? oli-obk
2025-01-27Rollup merge of #136037 - no1wudi:doc, r=jieyouxuGuillaume Gomez-37/+34
Mark all NuttX targets as tier 3 target and support the standard library The support for standard library added by https://github.com/rust-lang/rust/pull/130595.
2025-01-27Rollup merge of #135988 - bjorn3:workaround_parallel_rustc_crash, r=lqdGuillaume Gomez-15/+30
Add a workaround for parallel rustc crashing when there are delayed bugs This doesn't fix the root cause of this crash, but at least stops it from happening for the time being. Workaround for https://github.com/rust-lang/rust/issues/135870
2025-01-27Auto merge of #136098 - jyn514:linker-output, r=saethlinbors-5/+13
Downgrade `linker-warnings` to allow-by-default This needs more time to bake before we turn it on. Turning it on early risks people silencing the warning indefinitely, before we have the chance to make it less noisy. cc https://github.com/rust-lang/rust/issues/136096 fixes https://github.com/rust-lang/rust/issues/136086#issuecomment-2614476308 r? `@saethlin` cc `@Noratrieb` `@bjorn3` `@rustbot` label A-linkage L-linker_messages
2025-01-27Windows x86: Change `i128` to return via the vector ABITrevor Gross-57/+37
Clang and GCC both return `i128` in xmm0 on windows-msvc and windows-gnu. Currently, Rust returns the type on the stack. Add a calling convention adjustment so we also return scalar `i128`s using the vector ABI, which makes our `i128` compatible with C. In the future, Clang may change to return `i128` on the stack for its `-msvc` targets (more at [1]). If this happens, the change here will need to be adjusted to only affect MinGW. Link: https://github.com/rust-lang/rust/issues/134288
2025-01-27Auto merge of #136024 - GuillaumeGomez:cg_gcc-subtree, r=GuillaumeGomezbors-41/+85
Update rustc_codegen_gcc subtree cc `@antoyo`
2025-01-27Use an operand instead of a place that is always turned into an operandOli Scherer-12/+8
2025-01-27Deduplicate operand creation between scalars, non-scalars and string patternsOli Scherer-8/+11
2025-01-27Change `collect_and_partition_mono_items` tuple return type to a structOli Scherer-21/+33
2025-01-27Stabilize `const_black_box`Trevor Gross-2/+0
This has been unstably const since [1], but a tracking issue was never created. Per discussion on Zulip [2], there should not be any blockers to making this const-stable. The function does not provide any functionality at compile time but does allow code reuse between const- and non-const functions, so stabilize it here. [1]: https://github.com/rust-lang/rust/pull/92226 [2]: https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/const_black_box
2025-01-27Auto merge of #136116 - fmease:rollup-c8pk3mj, r=fmeasebors-58/+175
Rollup of 8 pull requests Successful merges: - #126604 (Uplift `clippy::double_neg` lint as `double_negations`) - #135158 (Add `TooGeneric` variant to `LayoutError` and emit `Unknown`) - #135635 (Move `std::io::pipe` code into its own file) - #136072 (add two old crash tests) - #136079 (compiler_fence: fix example) - #136091 (Add some tracing to core bootstrap logic) - #136097 (rustc_ast: replace some len-checks + indexing with slice patterns etc.) - #136101 (triagebot: set myself on vacation) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-27Auto merge of #135937 - bjorn3:separate_coretests_crate, r=jieyouxu,tgross35bors-56/+11
Put the core unit tests in a separate coretests package Having standard library tests in the same package as a standard library crate has bad side effects. It causes the test to have a dependency on a locally built standard library crate, while also indirectly depending on it through libtest. Currently this works out fine in the context of rust's build system as both copies are identical, but for example in cg_clif's tests I've found it basically impossible to compile both copies with the exact same compiler flags and thus the two copies would cause lang item conflicts. This PR moves the tests of libcore to a separate package which doesn't depend on libcore, thus preventing the duplicate crates even when compiler flags don't exactly match between building the sysroot (for libtest) and building the test itself. The rest of the standard library crates do still have this issue however.
2025-01-26Downgrade `linker-warnings` to allow-by-defaultjyn-5/+13
This needs more time to bake before we turn it on. Turning it on early risks people silencing the warning indefinitely, before we have the chance to make it less noisy.
2025-01-27Rollup merge of #136097 - yotamofek:check-len-and-index, r=petrochenkovLeón Orell Valerian Liehr-10/+10
rustc_ast: replace some len-checks + indexing with slice patterns etc.
2025-01-27Rollup merge of #135158 - FedericoBruzzone:master, r=lukas-codeLeón Orell Valerian Liehr-27/+75
Add `TooGeneric` variant to `LayoutError` and emit `Unknown` What's in this PR? - Add `TooGeneric` variant to `LayoutError` and emit `Unknown` one With this PR these issues and their respective ICEs are resolved: - fixes https://github.com/rust-lang/rust/issues/135020 - fixes https://github.com/rust-lang/rust/issues/135138
2025-01-27Rollup merge of #126604 - kadiwa4:uplift_double_negation, r=nnethercoteLeón Orell Valerian Liehr-21/+90
Uplift `clippy::double_neg` lint as `double_negations` Warns about cases like this: ```rust fn main() { let x = 1; let _b = --x; //~ WARN use of a double negation } ``` The intent is to keep people from thinking that `--x` is a prefix decrement operator. `++x`, `x++` and `x--` are invalid expressions and already have a helpful diagnostic. I didn't add a machine-applicable suggestion to the lint because it's not entirely clear what the programmer was trying to achieve with the `--x` operation. The code that triggers the lint should always be reviewed manually. Closes #82987
2025-01-27Remove redundant to_ident_string callsMichael Goulet-18/+14
2025-01-27Use identifiers in diagnostics more oftenMichael Goulet-72/+83
2025-01-27Mark all NuttX targets as tier 3 target and support the standard libraryHuang Qi-37/+34
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-27Add `TooGeneric` variant to `LayoutError` and emit `Unknown` oneFedericoBruzzone-27/+75
- `check-pass` test for a MRE of #135020 - fail test for #135138 - switch to `TooGeneric` for checking CMSE fn signatures - switch to `TooGeneric` for compute `SizeSkeleton` (for transmute) - fix broken tests
2025-01-26Auto merge of #104693 - jhorstmann:use-high-bit-of-mask-for-select, ↵bors-93/+104
r=workingjubilee Consistently use the highest bit of vector masks when converting to i1 vectors This improves the codegen for vector `select`, `gather`, `scatter` and boolean reduction intrinsics and fixes rust-lang/portable-simd#316. The current behavior of most mask operations during llvm codegen is to truncate the mask vector to <N x i1>, telling llvm to use the least significat bit. The exception is the `simd_bitmask` intrinsics, which already used the most signifiant bit. Since sse/avx instructions are defined to use the most significant bit, truncating means that llvm has to insert a left shift to move the bit into the most significant position, before the mask can actually be used. Similarly on aarch64, mask operations like blend work bit by bit, repeating the least significant bit across the whole lane involves shifting it into the sign position and then comparing against zero. By shifting before truncating to <N x i1>, we tell llvm that we only consider the most significant bit, removing the need for additional shift instructions in the assembly.
2025-01-26tidy up html structureRémy Rakic-4/+4
- invert pre/code which was an invalid combination, that works fine in practice - remove unneeded code wrapper for graphs
2025-01-26add NLL SCCs to polonius MIR dumpRémy Rakic-0/+49
2025-01-26add NLL region graph to the polonius MIR dumpRémy Rakic-1/+83
2025-01-26Compiler: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-10/+8