about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-07-22rewrite pointer-auth-link-with-c to rmakeOneirical-1/+0
2024-07-22internal: Shrink size of `Binding`Lukas Wirth-56/+94
2024-07-22Auto merge of #128041 - compiler-errors:uplift-errors-into-trait-sel, r=lcnrbors-5/+7
Uplift most type-system related error reporting from `rustc_infer` to `rustc_trait_selection` Completes the major part of #127492. The only cleanup that's needed afterwards is to actually use normalization in favor of the callback where needed, and deleting `can_eq_shallow`. r? lcnr Sorry for the large diff! Would prefer if comments can be handled in a follow-up (unless they're absolutely dealbreakers) because it seems bitrotty to let this sit.
2024-07-22Auto merge of #17670 - Veykril:mem, r=Veykrilbors-26/+19
LRU `body_with_source_map` query This query is being invalidated all the time anyways (we have an extra query on top of it for the body incrementality that is not source dependent), so there is little reason to keep these around all the time when only some IDE features are interested in them.
2024-07-22LRU `body_with_source_map` queryLukas Wirth-26/+19
2024-07-22Move rustbook to its own workspace.Eric Huss-0/+1772
2024-07-22rewrite and rename issue-107094 to rmakeOneirical-1/+0
2024-07-22rewrite and rename issue-33329 to ui testOneirical-1/+0
2024-07-22rewrite and rename issue-14698 to rmakeOneirical-1/+0
2024-07-22rewrite no-duplicate-libs to rmakeOneirical-1/+0
2024-07-22rewrite lto-linkage-used-attr to rmakeOneirical-1/+0
2024-07-22Always pass the visitor as the first argument to walk* functionsOli Scherer-4/+4
2024-07-22Sync `mut_visit` function names with immut `visit` ones (s/noop_visit/walk/)Oli Scherer-4/+4
2024-07-22Fix testАртём Павлов [Artyom Pavlov]-1/+1
2024-07-22Add `O_NOFOLLOW` flag supportАртём Павлов [Artyom Pavlov]-3/+55
2024-07-22Removed CondensedDirectory support from license tools.Jonathan Pallant-89/+11
Now that we have reuse-tool 4.0, we no longer need to massage the JSON license data to collapse LLVM into a single copyright notice and license - reuse-tool can do it for us using an annotation in REUSE.toml. This effectively reverts c6eb03b.
2024-07-22Auto merge of #17668 - Veykril:incorrect-nevers, r=Veykrilbors-3/+2
Remove incorrect never! invocations These can crop up when the `Future` related lang items are missing
2024-07-22Auto merge of #17542 - roife:fix-issue-17517, r=Veykrilbors-194/+1209
feat: go-to-def and find-references on control-flow keywords fix #17517. This PR implements **go-to-definition** and **find-references** functionalities for control flow keywords, which is similar to the behaviors in the `highlight-related` module. Besides, this PR also fixes some incorrect behaviors in `highlight-related`. ## Changes 1. **Support for go-to-definition on control flow keywords**: This PR introduces functionality allowing users to navigate on the definition of control flow keywords (`return`, `break`, `continue`). Commit: 2a3244ee147f898dd828c06352645ae1713c260f..7391e7a608634709db002a4cb09229de4d12c056. 2. **Bug fixes and refactoring in highlight-related**: - **Handling return/break/continue within try_blocks**: This PR adjusted the behavior of these keywords when they occur within `try_blocks`. When encounter these keywords, the program should exit the outer function or loop which containing the `try_blocks`, rather than the `try_blocks` itself; while the `?` will cause the program to exit `try_blocks`. Commit: 59d697e807f0197f59814b37dca1563959da4aa1. - **Support highlighting keywords in macro expansion for highlight-related**: Commit: 88df24f01727c23a667a763ee3ee0cec22d5ad52. - Detailed description for the bug fixes + The previous implementation of `preorder_expr` incorrectly treated `try_blocks` as new contexts, thereby r-a will not continue to traverse inner `return` and `break/continue` statements. To resolve this, a new function `preorder_expr_with_ctx_checker` has been added, allowing users to specify which expressions to skip. * For example, when searching for the `?` in the context, r-a should skip `try_blocks` where the `?` insides just works for `try_blocks`. But when search for the `return` keyword, r-a should collect both the `return` keywords inside and outside the `try_blocks` + Thus, this PR added `WalkExpandedExprCtx` (builder pattern). It offers the following improvements: customizable context skipping, maintenance of loop depth (for `break`/`continue`), and handling macro expansion during traversal. 3. **Support for find-references on control flow keywords**: This PR enables users to find all references to control flow keywords. Commit: 9202a33f81218fb9c2edb5d42e6b4de85b0323a8.
2024-07-22Auto merge of #17586 - ShoyuVanilla:tuple-arg-macro-rest, r=Veykrilbors-5/+108
Allow macro expansions into `RestPat` in tuple args work as ellipsis like plain `RestPat` Fixes #17292 Currently, Rust Analyzer lowers `ast::Pat::RestPat` into `Pat::Missing` in general cases on the following lines; https://github.com/rust-lang/rust-analyzer/blob/ffbc5ad993d5cd2f3b8bcf9a511165470944ab91/crates/hir-def/src/body/lower.rs#L1359-L1367 And in some proper positions such as `TupleStruct(..)`, it is specially handed on the following lines; https://github.com/rust-lang/rust-analyzer/blob/ffbc5ad993d5cd2f3b8bcf9a511165470944ab91/crates/hir-def/src/body/lower.rs#L1429-L1437 This behavior is reasonable because rustc does similar things in https://github.com/rust-lang/rust/blob/62c068feeafd1f4abbf87243d69cf8862e4dd277/compiler/rustc_ast_lowering/src/pat.rs#L108-L111 and https://github.com/rust-lang/rust/blob/62c068feeafd1f4abbf87243d69cf8862e4dd277/compiler/rustc_ast_lowering/src/pat.rs#L123-L142 But this sometimes works differently because Rust Analyzer expands macros while ast lowering; https://github.com/rust-lang/rust-analyzer/blob/ffbc5ad993d5cd2f3b8bcf9a511165470944ab91/crates/hir-def/src/body/lower.rs#L1386-L1398 https://github.com/rust-lang/rust-analyzer/blob/ffbc5ad993d5cd2f3b8bcf9a511165470944ab91/crates/hir-def/src/body/lower.rs#L941-L963 but rustc uses expanded ast in the corresponding tuple-handling process, so it does not have macro patterns there. https://github.com/rust-lang/rust/blob/62c068feeafd1f4abbf87243d69cf8862e4dd277/compiler/rustc_ast_lowering/src/pat.rs#L114 So, if a macro expansion in a tuple arg results in `..`, rustc permits it like plain `..` pattern, but Rust Analyzer rejects it. This is the root cause of #17292 and this PR allows macros expanded into `..` in a tuple arg position work as ellipsis like that.
2024-07-22Auto merge of #17667 - Veykril:r-a-component-override, r=Veykrilbors-18/+44
Use rustup rust-analyzer component when there is a toolchain file override for the opened workspace Fixes https://github.com/rust-lang/rust-analyzer/issues/17663
2024-07-22Remove incorrect never! invocationsLukas Wirth-3/+2
2024-07-22Use rustup rust-analyzer component when there is a toolchain file override ↵Lukas Wirth-18/+44
for the opened workspace
2024-07-22Rollup merge of #127985 - Oneirical:testibule-of-hell, r=Kobzol许杰友 Jieyou Xu (Joe)-3/+0
Migrate `test-benches`, `c-unwind-abi-catch-panic` and `compiler-lookup-paths-2` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
2024-07-22Rollup merge of #127510 - tgross35:test-float-parse-update, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-1/+1
Rewrite `test-float-parse` in Rust Migrate from the currently broken Rust + Python `test-float-parse` to a Rust implementation. This newer version should be significantly faster (tests execute in parallel with threads, rather than series across multiple processes, which also eliminates the "...the worker processes are leaked and stick around forever" message), and should be significantly easier to extend to the new float types. Since this is faster and hopefully more stable, we should be able to launch it with `x` and run the faster tests in CI.
2024-07-22Auto merge of #17647 - joshka:jm/rename-commands, r=Veykrilbors-9/+9
Rename rust-analyzer commands The commands `editor.action.triggerParameterHints` and `editor.action.rename` are now renamed to `rust-analyzer.triggerParameterHints` and `rust-analyzer.rename` This change helps make it clear that these commands are specific to rust-analyzer and not part of the default set of commands provided by VSCode. Fixes: https://github.com/rust-lang/rust-analyzer/issues/17644 Note: This seems like it will be a breaking change for any RA client that previously reacted to `editor.action.triggerParameterHints` - naive search: https://github.com/search?q=editor.action.triggerParameterHints+AND+%28NOT+is%3Afork%29+rust-analyzer&type=code
2024-07-22Auto merge of #17666 - Veykril:simplify, r=Veykrilbors-139/+65
Simplify
2024-07-22SimplifyLukas Wirth-139/+65
2024-07-22Auto merge of #17660 - ObsidianMinor:fix/17645, r=Veykrilbors-1/+71
Fix more path resolution for included submodules Now with more comprehensive testing! This adds tests for includes within modules. Previous testing was not comprehensive enough since submodules that use `include!` didn't actually work either! The `ModDir` used for resolving mods relative to included files has to be `ModDir::root()`. The original test just so happened to put the submodules in the root which made this work, but if you put the `include!` inside a `mod` block it didn't work. With this change, when collecting a macro expansion, if the macro call is an `include!`, we use the `ModDir::root()` instead of the current module we're in.
2024-07-22Auto merge of #17658 - alibektas:rename_get_field, r=Veykrilbors-3/+3
minor: Rename `config::get_field` to `config::get_field_json`
2024-07-21Fix toolsMichael Goulet-3/+6
2024-07-21Move all error reporting into rustc_trait_selectionMichael Goulet-2/+1
2024-07-22Read rust-analyzer.toml files on startupAli Bektas-8/+40
2024-07-21Fix more path resolution for included submodulesSydney Acksman-1/+71
Now with much more comprehensive testing! This adds tests for includes within modules.
2024-07-22Add FIXME to root ratoml tests.Ali Bektas-9/+8
2024-07-22Apply changes to ratoml/fixesAli Bektas-5/+9
2024-07-22Minor fixes for ratoml moduleAli Bektas-115/+90
- Parse errors are reflected as such by defining a new variant called `ConfigError::ParseError` - New error collection has been added to store config level agnostic errors.
2024-07-21Auto merge of #120812 - compiler-errors:impl-sorting, r=lcnrbors-8/+7
Remove unnecessary impl sorting in queries and metadata Removes unnecessary impl sorting because queries already return their keys in HIR definition order: https://github.com/rust-lang/rust/issues/120371#issuecomment-1926422838 r? `@cjgillot` or `@lcnr` -- unless I totally misunderstood what was being asked for here? 😆 fixes #120371
2024-07-21Rename `config::get_field` to `config::get_field_json`Ali Bektas-3/+3
2024-07-21Auto merge of #17657 - Veykril:cfg-slim, r=lnicolabors-64/+77
internal: Make `CfgExpr` slimmer
2024-07-21Make `CfgExpr` slimmerLukas Wirth-64/+77
2024-07-21Auto merge of #17656 - Veykril:flyimport-builtin-mod, r=Veykrilbors-2/+28
fix: Allow flyimport to import primitive shadowing modules Fixes https://github.com/rust-lang/rust-analyzer/issues/16371
2024-07-21fix: Allow flyimport to import primitive shadowing modulesLukas Wirth-2/+28
2024-07-21Auto merge of #17655 - Veykril:std-find-path, r=Veykrilbors-224/+320
More `find_path` improvements
2024-07-21Optimize `find_path` for sysroot library search some moreLukas Wirth-98/+112
2024-07-21Fix visited module tracking not clearing itself on backtrackingLukas Wirth-46/+86
2024-07-21Use out parameter instead of return value for `find_path` choiceLukas Wirth-56/+53
2024-07-21Fix using wrong length for max_len argLukas Wirth-2/+7
2024-07-21Specialize `find_path` local searchLukas Wirth-28/+45
2024-07-21Auto merge of #127993 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 9 commits in a2b58c3dad4d554ba01ed6c45c41ff85390560f2..5f6b9a92201d78af75dc24f14662c3e2dacbbbe1 2024-07-16 00:52:02 +0000 to 2024-07-19 18:09:17 +0000 - Add `TomlPackage::new`, `Default` for `TomlWorkspace` (rust-lang/cargo#14271) - fix(test): Move 'cargo_home' from 'install' to 'paths' (rust-lang/cargo#14270) - fix(test)!: Clarify extension trait role with rename (rust-lang/cargo#14269) - feat(test): Re-export ProcessBuilder (rust-lang/cargo#14268) - fix(test): Move path2url to CargoPathExt::to_url (rust-lang/cargo#14266) - Fix passing of links-overrides with target-applies-to-host and an implicit target (rust-lang/cargo#14205) - fix(toml): Improve error on missing package and workspace (rust-lang/cargo#14261) - Migrate global_cache_tracker snapbox (rust-lang/cargo#14244) - make summary sync by using Arc not Rc (rust-lang/cargo#14260)
2024-07-21Optimize `find_path` choice selectionLukas Wirth-122/+145