about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-04-05Merge pull request #19447 from Natural-selection1/add_impl_forLukas Wirth-0/+27
add more completion about "impl"
2025-04-05Merge pull request #19501 from ChayimFriedman2/macro-expansionLukas Wirth-11/+107
fix: Fix a bug in MBE expansion that arose from incorrect fixing of an older bug in MBE
2025-04-05 the rustdoc file prefix for constants is "constant" not "const"Jonathan Chan Kwan Yin-1/+1
2025-04-05Switch `time` to `jiff` for time formatting in ICE dumpsclubby789-6/+3
2025-04-05Rollup merge of #138024 - reitermarkus:unicode-panic-optimization, r=ibraheemdevStuart Cook-39/+98
Allow optimizing out `panic_bounds_check` in Unicode checks. Allow optimizing out `panic_bounds_check` in Unicode checks. For context, see https://github.com/japaric/ufmt/issues/52#issuecomment-2699207241.
2025-04-05Rollup merge of #136457 - calder:master, r=tgross35Stuart Cook-4/+4
Expose algebraic floating point intrinsics # Problem A stable Rust implementation of a simple dot product is 8x slower than C++ on modern x86-64 CPUs. The root cause is an inability to let the compiler reorder floating point operations for better vectorization. See https://github.com/calder/dot-bench for benchmarks. Measurements below were performed on a i7-10875H. ### C++: 10us ✅ With Clang 18.1.3 and `-O2 -march=haswell`: <table> <tr> <th>C++</th> <th>Assembly</th> </tr> <tr> <td> <pre lang="cc"> float dot(float *a, float *b, size_t len) { #pragma clang fp reassociate(on) float sum = 0.0; for (size_t i = 0; i < len; ++i) { sum += a[i] * b[i]; } return sum; } </pre> </td> <td> <img src="https://github.com/user-attachments/assets/739573c0-380a-4d84-9fd9-141343ce7e68" /> </td> </tr> </table> ### Nightly Rust: 10us ✅ With rustc 1.86.0-nightly (8239a37f9) and `-C opt-level=3 -C target-feature=+avx2,+fma`: <table> <tr> <th>Rust</th> <th>Assembly</th> </tr> <tr> <td> <pre lang="rust"> fn dot(a: &[f32], b: &[f32]) -> f32 { let mut sum = 0.0; for i in 0..a.len() { sum = fadd_algebraic(sum, fmul_algebraic(a[i], b[i])); } sum } </pre> </td> <td> <img src="https://github.com/user-attachments/assets/9dcf953a-2cd7-42f3-bc34-7117de4c5fb9" /> </td> </tr> </table> ### Stable Rust: 84us ❌ With rustc 1.84.1 (e71f9a9a9) and `-C opt-level=3 -C target-feature=+avx2,+fma`: <table> <tr> <th>Rust</th> <th>Assembly</th> </tr> <tr> <td> <pre lang="rust"> fn dot(a: &[f32], b: &[f32]) -> f32 { let mut sum = 0.0; for i in 0..a.len() { sum += a[i] * b[i]; } sum } </pre> </td> <td> <img src="https://github.com/user-attachments/assets/936a1f7e-33e4-4ff8-a732-c3cdfe068dca" /> </td> </tr> </table> # Proposed Change Add `core::intrinsics::f*_algebraic` wrappers to `f16`, `f32`, `f64`, and `f128` gated on a new `float_algebraic` feature. # Alternatives Considered https://github.com/rust-lang/rust/issues/21690 has a lot of good discussion of various options for supporting fast math in Rust, but is still open a decade later because any choice that opts in more than individual operations is ultimately contrary to Rust's design principles. In the mean time, processors have evolved and we're leaving major performance on the table by not supporting vectorization. We shouldn't make users choose between an unstable compiler and an 8x performance hit. # References * https://github.com/rust-lang/rust/issues/21690 * https://github.com/rust-lang/libs-team/issues/532 * https://github.com/rust-lang/rust/issues/136469 * https://github.com/calder/dot-bench * https://www.felixcloutier.com/x86/vfmadd132ps:vfmadd213ps:vfmadd231ps try-job: x86_64-gnu-nopt try-job: x86_64-gnu-aux
2025-04-04Expose algebraic floating point intrinsicsCalder Coalson-4/+4
2025-04-04Add `rustc-literal-escaper` to allowed crates listsGuillaume Gomez-0/+2
2025-04-04Update `rustc-literal-escaper` version to `0.0.2`Guillaume Gomez-4/+4
2025-04-04Merge pull request #19519 from snprajwal/project-control-no-depsLukas Wirth-2/+31
feat(project-model): provide flag for no deps
2025-04-04Update windows-bindgen to 0.61.0Chris Denton-1/+1
2025-04-04Merge pull request #4251 from RalfJung/cargo-updateRalf Jung-710/+673
Cargo update
2025-04-04internal: fix salsa-ified crate graph working with lazy project discoveryDavid Barsky-31/+23
2025-04-04Solaris does not have flockRalf Jung-0/+3
2025-04-04Merge pull request #19522 from ↵Lukas Wirth-1/+3
davidbarsky/davidbarsky/fix-panic-in-view-crate-graph internal: fix panic in `view_crate_graph`
2025-04-04Merge pull request #19515 from jrmuizel/multiple-definitionsLukas Wirth-7/+102
fix: don't drop references with more than one definition.
2025-04-04internal: fix panic in `view_crate_graph`David Barsky-1/+3
2025-04-04fix: don't drop references with more than one definition.Jeff Muizelaar-7/+102
Implicit field references during struct initialization were being dropped because get_definition was returning None because there were multiple definitions. This adds a new helper, `get_defintions`, that supports returning more than one definition for a given token and hooks it up. Fixes #19393
2025-04-04prefer default over newBenjaminBrienen-125/+98
2025-04-04fix windows_join_multipleRalf Jung-2/+8
2025-04-04feat(project-model): provide flag for no depsPrajwal S N-2/+31
A Cargo project can now be built without any dependency metadata being fetched. Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-04Merge pull request #4250 from asomers/patch-1Ralf Jung-0/+1
Add another Miri-detected bug to README.md
2025-04-04Remove usage of `rustc_lexer::unescape` in rust-analyzerGuillaume Gomez-18/+21
2025-04-04Update README.md Alan Somers-1/+1
verb -> participle Co-authored-by: Ralf Jung <post@ralfj.de>
2025-04-04bump parts of test-cargo-miri to edition 2024Ralf Jung-44/+59
2025-04-04chore: clean up some FIXMEsPrajwal S N-47/+36
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-04cargo updateRalf Jung-495/+546
2025-04-04semver-bump some dependenciesRalf Jung-230/+133
2025-04-04Rollup merge of #139322 - Kobzol:run-make-lld-refactor, r=jieyouxuMatthias Krüger-0/+37
Add helper function for checking LLD usage to `run-make-support` Extracted out of https://github.com/rust-lang/rust/pull/138645, should be a simple refactoring. r? ``@jieyouxu``
2025-04-04Rollup merge of #139317 - Zalathar:hide-libtest, r=jieyouxuMatthias Krüger-105/+208
compiletest: Encapsulate all of the code that touches libtest Compiletest currently relies on unstable libtest APIs in order to actually execute tests. That's unfortunate, but removing the dependency isn't trivial. However, we can make a small step towards removing the libtest dependency by encapsulating the libtest interactions into a single dedicated module. That makes it easier to see what parts of libtest are actually used. --- As a side-effect of moving the `test_opts` function into that dedicated module, this PR also ends up allowing `--fail-fast` to be passed on the command line, instead of requiring an environment variable. --- There is still (at least) one other aspect of the libtest dependency that this PR does not address, namely the fact that we rely on libtest's output capture (via unstable std APIs) to capture the output that we print during individual tests. I hope to do something about that at some point. r? jieyouxu
2025-04-04fix language-configuration.jsonBenjaminBrienen-3/+3
2025-04-03Stabilize the `cell_update` featureTrevor Gross-1/+0
Included API: impl<T: Copy> Cell<T> { pub fn update(&self, f: impl FnOnce(T) -> T); } Closes: https://github.com/rust-lang/rust/issues/50186
2025-04-03Rollup merge of #138610 - oli-obk:no-sort-hir-ids, r=compiler-errorsMatthias Krüger-27/+46
impl !PartialOrd for HirId revive of https://github.com/rust-lang/rust/pull/92233 Another checkbox of https://github.com/rust-lang/rust/issues/90317, another small step in making incremental less likely to die in horrible ways
2025-04-03Rollup merge of #138017 - nnethercote:tighten-assignment-op, r=spastorinoMatthias Krüger-35/+62
Tighten up assignment operator representations. This is step 3 of [MCP 831](https://github.com/rust-lang/compiler-team/issues/831). r? `@spastorino`
2025-04-03Stabilize `cfg_boolean_literals`clubby789-29/+0
2025-04-03Add another Miri-detected bug to README.mdAlan Somers-0/+1
Miri detected this bug in Mockall: https://github.com/asomers/mockall/issues/647 [skip ci]
2025-04-03test-cargo-miri: permissive provenance should not be needed any moreRalf Jung-7/+2
2025-04-03fix comment nitRalf Jung-2/+1
2025-04-03Add a helper function for checking if LLD was used to `run-make-support`Jakub Beránek-0/+37
2025-04-03compiletest: Encapsulate all of the code that touches libtestZalathar-98/+194
2025-04-03compiletest: Allow `--fail-fast` as a command-line optionZalathar-8/+15
2025-04-03feat(proc-macro-srv): support metadata version 10Prajwal S N-4/+4
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-03impl !PartialOrd for HirIdOli Scherer-10/+28
2025-04-03Remove `LintExpectationId` from `Level` variantsOli Scherer-11/+11
2025-04-03Make LevelAndSource a structOli Scherer-7/+8
2025-04-03fix(ide-assists): remove `AssistKind::None`Prajwal S N-15/+5
This was being used by a single assist, which qualifies under the "refactor" kind. The variant has been removed, and all usages updated accordingly. Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-03compiletest: Require `//~` annotations even if `error-pattern` is specifiedVadim Petrochenkov-10/+6
2025-04-03visit_freeze_sensitive: add commentRalf Jung-0/+3
2025-04-03Tighten up assignment operator representations.Nicholas Nethercote-22/+49
In the AST, currently we use `BinOpKind` within `ExprKind::AssignOp` and `AssocOp::AssignOp`, even though this allows some nonsensical combinations. E.g. there is no `&&=` operator. Likewise for HIR and THIR. This commit introduces `AssignOpKind` which only includes the ten assignable operators, and uses it in `ExprKind::AssignOp` and `AssocOp::AssignOp`. (And does similar things for `hir::ExprKind` and `thir::ExprKind`.) This avoids the possibility of nonsensical combinations, as seen by the removal of the `bug!` case in `lang_item_for_binop`. The commit is mostly plumbing, including: - Adds an `impl From<AssignOpKind> for BinOpKind` (AST) and `impl From<AssignOp> for BinOp` (MIR/THIR). - `BinOpCategory` can now be created from both `BinOpKind` and `AssignOpKind`. - Replaces the `IsAssign` type with `Op`, which has more information and a few methods. - `suggest_swapping_lhs_and_rhs`: moves the condition to the call site, it's easier that way. - `check_expr_inner`: had to factor out some code into a separate method. I'm on the fence about whether avoiding the nonsensical combinations is worth the extra code.
2025-04-03Use `BinOpKind` instead of `BinOp` for function args where possible.Nicholas Nethercote-13/+13
Because it's nice to avoid passing in unnecessary data.