about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-09-11unify `llvm-bitcode-linker`, `wasm-component-ld` and llvm-tools logicsonur-ozkan-50/+121
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-11miri: fix overflow detection for unsigned pointer offsetRalf Jung-0/+22
2024-09-11Rollup merge of #130161 - onur-ozkan:fmt-changed-files, r=Kobzol,RalfJungMatthias Krüger-58/+79
refactor merge base logic and fix `x fmt` When remote upstream is not configured, using [get_git_modified_files](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L114) to find modified files fails because [get_rust_lang_rust_remote](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L46-L48) can not resolve "rust-lang/rust" from the git output. The changes in this PR makes bootstrap to find the latest bors commit, treating it as the "closest upstream commit" so that the change tracker logic can use it to find the diffs. In addition, [skips formatting](https://github.com/rust-lang/rust/commit/e3924544832668a6e239153a90d3be2077fbdce4) if there are no modified files. Fixes #130147
2024-09-11Auto merge of #18075 - roife:fix-issue-17858, r=Veykrilbors-24/+303
feat: render patterns in params for hovering Fix #17858 This PR introduces an option to [hir-def/src/body/pretty.rs](https://github.com/rust-lang/rust-analyzer/blob/08c7bbc2dbe4dcc8968484f1a0e1e6fe7a1d4f6d/crates/hir-def/src/body/pretty.rs) to render the result as a single line, which is then reused for rendering patterns in parameters for hovering.
2024-09-11Auto merge of #18080 - Veykril:dedup, r=Veykrilbors-19760/+133
Remove crate graph deduplication logic Fixes https://github.com/rust-lang/rust-analyzer/issues/17748
2024-09-11Auto merge of #18078 - cuishuang:master, r=Veykrilbors-3/+5
Remove unnecessary symbols and add missing symbols
2024-09-11Auto merge of #18057 - alibektas:better_ratoml_testing, r=Veykrilbors-103/+228
internal: Better testing infra for ratoml This PR makes some improvements on how we test configs that come from `rust-analyzer.toml` files. It was primarily used to solve #18021 but along the way I could not really determine the cause of the said issue which makes me think that it may not be related to the changes that I made earlier to the ratoml infra. In either way `custom_snippets` are now made `global` because we still don't have a tree that maps a `SourceRootId` to a set of `Snippet`s.
2024-09-11Auto merge of #130212 - DianQK:llvm-19, r=nikicbors-0/+0
Update LLVM to 19 327ca6c Fixes #129887. r? nikic
2024-09-11Auto merge of #18052 - Coekjan:fix-inline-const, r=Veykrilbors-4/+14
fix: Fix `inline_const_as_literal` error when the number >= 10 ## Description ### The Bug This PR fixes a small bug in the IDE assistence (`inline_const_as_literal`). When the being-inlined constant is a number and it is greater than or equal to 10, the assistence inserts unexpected string `(0x...)` after the number itself. A simple example is followed: Current `inline_const_as_literal` changes ```rs const A: usize = 16; fn f() -> usize { A // inline the constant } ``` into ```rs const A: usize = 16; fn f() -> usize { 16 (0x10) } ``` The bug originates from #14925 & #15306 . #14925 added some unittests, but it just tested the number-inlining behavior when the number is `0`. https://github.com/rust-lang/rust-analyzer/blob/50882fbfa204027c84753e6d51a1a12884dc1b19/crates/ide-assists/src/handlers/inline_const_as_literal.rs#L124-L138 And #15306 modified the behavior of `Const::render_eval` and added the `(0x...)` part after the number (if the number >= `10`). Because of insufficient unittests in #14925, changes about `Const::render_eval` in #15306 introduced this bug with no CI failure. ### The Fix I think `Const::render_eval` is intended for user-facing value displaying (e.g. hover) and not designed for `inline_const_as_literal`. To fix the bug, I defined a new function named `Const::eval`, which evaluates the value itself faithfully and simply and does nothing else. ## Thanks Thanks `@roife` for your kind help. Your guidance helped me better understand the code.
2024-09-11Auto merge of #18018 - ChayimFriedman2:unit-ret-complete-semi, r=Veykrilbors-40/+217
feat: Automatically add semicolon when completing unit-returning functions But provide a config to suppress that. I didn't check whether we are in statement expression position, because this is hard in completion (due to the natural incompleteness of source code when completion is invoked), and anyway using function returning unit as an argument to something seems... dubious. Fixes #17263.
2024-09-11Properly set the working directory for proc-macro executionLukas Wirth-5/+29
2024-09-11Auto merge of #17904 - darichey:unresolved-references, r=Veykrilbors-0/+200
Add command to report unresolved references Adds `rust-analyzer unresolved-references` which reports unresolved references. This is useful for debugging and regression testing for both rust-analyzer and project generators like Buck's rust-project. As discussed: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Command.20to.20report.20unresolved.20references
2024-09-11Lift out workspace related data into a separate query to preserve crategraph ↵Lukas Wirth-97/+98
deduplication
2024-09-11Auto merge of #18050 - rust-lang:davidbarsky/push-uyvtlsvoqrxw, r=Veykrilbors-9/+25
assist: ensure `replace_qualified_name_with_use` applies to the first path segment This change helps a bit with the discoverability of `replace_qualified_name_with_use`. Specifically, it ensures that a cursor on the first path segment (e.g., `$0std::fmt::Debug`, where `$0` is the cursor) would result in an import along the lines of `use std::fmt;` and `fmt::Debug;` at the usage sites.
2024-09-11Remove crate graph deduplication logicLukas Wirth-19658/+6
2024-09-11miri: support vector index arguments in simd_shuffleRalf Jung-9/+14
2024-09-11also allow illumos to use mmap for its stack guardRalf Jung-2/+2
2024-09-11Auto merge of #18093 - ShoyuVanilla:skip-dyn-trait-cast-check, r=Veykrilbors-0/+139
Skip checks for cast to dyn traits It seems that chalk fails to solve some obvious goals when there are some recursiveness in trait environments. And it doesn't support trait upcasting yet. rust-lang/chalk#796 This PR just skips for casting into types containing `dyn Trait` to prevent false positive diagnostics like #18047 and #18083
2024-09-11document the new git logic in more detailonur-ozkan-5/+18
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-11Merge from rustcThe Miri Cronjob Bot-409/+681
2024-09-11Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-09-11Auto merge of #129975 - notriddle:notriddle/lint-skip, r=GuillaumeGomezbors-202/+184
rustdoc: unify the short-circuit on all lints This is a bit of an experiment to see if it improves perf.
2024-09-10rustdoc: tweak spacing in toolbarMichael Howell-3/+9
2024-09-10rustdoc: make the header show all three buttonsMichael Howell-37/+67
This tweaks it to use less space for the breadcrumbs.
2024-09-10rustdoc: redesign toolbar and disclosure widgetsMichael Howell-155/+313
This adds labels to the icons and moves them away from the search box. These changes are made together, because they work together, but are based on several complaints: * The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <https://github.com/rust-lang/rust/issues/59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong) * The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <https://github.com/rust-lang/rust/issues/90310>, <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.") The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows. Settings and Help are also migrated, so that the whole group can benefit from being described using actual words. Additionally, the Help button is only shown on SERPs, not all the time. This is done for two major reasons: * Most of what's in there is search-related. The things that aren't are keyboard commands, and the search box tells you about that anyway. Pressing <kbd>?</kbd> will temporarily show the button and its popover. * I'm trading it off by showing the help button, even on mobile. It's useful since you can use the search engine suggestions there. * The three buttons were causing line wrapping on too many desktop layouts.
2024-09-11Update LLVM to 19 327ca6cDianQK-0/+0
2024-09-10Auto merge of #129403 - scottmcm:only-array-simd, r=compiler-errorsbors-30/+30
Ban non-array SIMD Nearing the end of https://github.com/rust-lang/compiler-team/issues/621 ! Currently blocked on ~~https://github.com/rust-lang/compiler-builtins/pull/673~~ ~~https://github.com/rust-lang/compiler-builtins/pull/674~~ ~~https://github.com/rust-lang/rust/pull/129400~~ ~~https://github.com/rust-lang/rust/pull/129481~~ for windows.
2024-09-10Add -Z small-data-thresholdPaul Menage-0/+20
This flag allows specifying the threshold size above which LLVM should not consider placing small objects in a .sdata or .sbss section. Support is indicated in the target options via the small-data-threshold-support target option, which can indicate either an LLVM argument or an LLVM module flag. To avoid duplicate specifications in a large number of targets, the default value for support is DefaultForArch, which is translated to a concrete value according to the target's architecture.
2024-09-11we standardized on this more reliable command (#2061)Tshepang Mbambo-2/+2
2024-09-10skip formatting if no files have been modifiedonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-10handle `GitConfig` for `tools/compiletest`onur-ozkan-2/+11
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-11Skip checks for cast to dyn traitsShoyu Vanilla-0/+139
2024-09-10add change entry for "tools" and "library" profile updateonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-10force ci-llvm by default on library and tools profilesonur-ozkan-2/+4
It's very rare for developers to need to modify LLVM, so "if-unchanged" isn't a good default since it fetches the LLVM submodule to track changes. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-10Correctly escape strings in our quote macroChayim Refael Friedman-6/+25
This is a small change, but it was the cause of 90% of the errors in `rust-analyzer diagnostics .` 🫢 With this change and #18085 together, all remaining errors are type errors. This may mean we can enable more errors, but this is out of scope for this PR.
2024-09-10Rollup merge of #130143 - RalfJung:miri-test-libstd, r=compiler-errorsMatthias Krüger-2/+6
miri-test-libstd: add missing BOOTSTRAP_ARGS Note sure if BOOTSTRAP_ARGS will make any difference here, but all the other x.py invocations have it and I did not *deliberately* leave it away when I added these, so... probably best to add them? Also don't unnecessarily set BOOTSTRAP_SKIP_TARGET_SANITY while we are at it.
2024-09-10Add test for S_OBJNAME and update test for LF_BUILDINFO cl and cmd forFlorian Schmiderer-0/+6
pdb files.
2024-09-10Auto merge of #18032 - DropDemBits:sed-tree-edits, r=davidbarskybors-0/+1251
internal: Add preliminary `SyntaxEditor` functionality Related to #15710 Implements a `SyntaxEditor` interface to abstract over the details of modifying syntax trees, to both simplify creating new code fixes and code actions, as well as start on the path of getting rid of mutable syntax nodes. `SyntaxEditor` relies on `SyntaxMappingBuilder`s to feed in the correct information to map AST nodes created by `make` constructors, as `make` constructors do not guarantee that node identity is preserved. This is to paper over the fact that `make` constructors simply re-parse text input instead of building AST nodes from the ground up and re-using the provided syntax nodes. `SyntaxAnnotation`s are used to find where syntax elements have ended up after edits are applied. This is primarily useful for the `add_{placeholder,tabstop}` set of methods on `SourceChangeBuilder`, as that currently relies on the nodes provided being in the final syntax tree. Eventually, the goal should be to move this into the `rowan` crate when we move away from mutable syntax nodes, but for now it'll stay in the `syntax` crate. --- Closes #14921 as `SyntaxEditor` ensures that all replace changes are disjoint Closes #9649 by implementing `SyntaxAnnotation`s
2024-09-10Auto merge of #129337 - EtomicBomb:rfc, r=notriddlebors-169/+435
rustdoc rfc#3662 changes under unstable flags * All new functionality is under unstable options * Adds `--merge=shared|none|finalize` flags * Adds `--parts-out-dir=<crate specific directory>` for `--merge=none` to write cross-crate info file for a single crate * Adds `--include-parts-dir=<previously specified directory>` for `--merge=finalize` to write cross-crate info files * `tests/rustdoc/` tests for the new flags
2024-09-10miri: treat non-memory local variables properly for data race detectionRalf Jung-7/+382
2024-09-10fmtRalf Jung-48/+62
2024-09-10Merge from rustcRalf Jung-1163/+2204
2024-09-10Preparing for merge from rustcRalf Jung-1/+1
2024-09-10Fix Typo and Remove Outdated Line About C VariadicsVeera-2/+1
This PR does two minor fixes: 1. Removes the line "c-variadic functions are declared with at least one named argument" since it is no longer true since 124048 got merged. 2. Fixes typo: "lingint" -> "linting".
2024-09-10Auto merge of #130179 - workingjubilee:rollup-l78cv44, r=workingjubileebors-6/+26
Rollup of 11 pull requests Successful merges: - #128316 (Stabilize most of `io_error_more`) - #129473 (use `download-ci-llvm=true` in the default compiler config) - #129529 (Add test to build crates used by r-a on stable) - #129981 (Remove `serialized_bitcode` from `LtoModuleCodegen`.) - #130094 (Inform the solver if evaluation is concurrent) - #130132 ([illumos] enable SIGSEGV handler to detect stack overflows) - #130146 (bootstrap `naked_asm!` for `compiler-builtins`) - #130149 (Helper function for formatting with `LifetimeSuggestionPosition`) - #130152 (adapt a test for llvm 20) - #130162 (bump download-ci-llvm-stamp) - #130164 (move some const fn out of the const_ptr_as_ref feature) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-10bootstrap: Print more debug info when `find_initial_libdir` failsZalathar-4/+8
2024-09-10Merge remote-tracking branch 'upstream/master' into ↵Yacin Tmimi-1324/+3212
subtree-push-nightly-2024-09-10
2024-09-09Update the MIRI testsScott McMurray-30/+30
2024-09-09Rollup merge of #130162 - onur-ozkan:bump-ci-llvm-stamp, r=KobzolJubilee-1/+1
bump download-ci-llvm-stamp This should trigger the download and extraction of the ci-llvm tarball, which should resolve https://github.com/rust-lang/rust/issues/130144.
2024-09-09Rollup merge of #129529 - lqd:stable-new-solver, r=KobzolJubilee-3/+16
Add test to build crates used by r-a on stable r? ````````@Kobzol```````` I've opened other PRs for this one to work and they've landed already. I cherry-picked your commit, and added the last remaining pieces we needed I think.