rust-analyzer/crates
bors da6f7e2c7b Auto merge of #16275 - davidsemakula:ast-path-segments, r=Veykril
fix: Fix `ast::Path::segments` implementation

calling `ast::Path::segments` on a qualifier currently returns all the segments of the top path instead of just the segments of the qualifier.

The issue can be summarized by the simple failing test below:
```rust
#[test]
fn path_segments() {
    //use ra_ap_syntax::ast;
    let path: ast::Path = ...; // e.g. `ast::Path` for "foo::bar::item".

    let path_segments: Vec<_> = path.segments().collect();
    let qualifier_segments: Vec<_> = path.qualifier().unwrap().segments().collect();
    assert_eq!(path_segments.len(), qualifier_segments.len() + 1); // Fails because `LHS = RHS`.
}
```

This PR:
- Fixes the implementation of `ast::Path::segments`
- Fixes `ast::Path::segments` callers that either implicitly relied on behavior of previous implementation or exhibited other "wrong" behavior directly related to the result of `ast::Path::segments` (all callers have been reviewed, only one required modification)
- Removes unnecessary (and now unused) `ast::Path::segments` alternatives
2024-01-09 15:41:48 +00:00
..
base-db Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
cfg Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
flycheck Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
hir Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
hir-def Auto merge of #16311 - Veykril:rustc-deps, r=Veykril 2024-01-09 09:37:48 +00:00
hir-expand Builtin derives are hygienic 2024-01-08 12:50:11 +01:00
hir-ty Auto merge of #16311 - Veykril:rustc-deps, r=Veykril 2024-01-09 09:37:48 +00:00
ide Builtin derives are hygienic 2024-01-08 12:50:11 +01:00
ide-assists Auto merge of #16275 - davidsemakula:ast-path-segments, r=Veykril 2024-01-09 15:41:48 +00:00
ide-completion Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
ide-db Auto merge of #16275 - davidsemakula:ast-path-segments, r=Veykril 2024-01-09 15:41:48 +00:00
ide-diagnostics Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
ide-ssr Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
intern Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
limit Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
load-cargo fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00
mbe Set the in-rust-tree` feature for all rust-analyzer{-proc-macro-srv} steps 2024-01-04 11:02:20 +01:00
parser Auto merge of #16310 - Veykril:range-access-parse, r=Veykril 2024-01-09 09:49:25 +00:00
paths Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
proc-macro-api Auto merge of #16312 - Veykril:win-proc-macro-srv, r=Veykril 2024-01-09 10:12:57 +00:00
proc-macro-srv Try to fix feature gates 2024-01-09 09:52:58 +02:00
proc-macro-srv-cli Recognize proc macro server unexpectedly exiting and report the exit code 2024-01-09 10:37:26 +01:00
profile Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
project-model fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00
rust-analyzer Auto merge of #16319 - Veykril:no-double-load, r=Veykril 2024-01-09 10:24:23 +00:00
sourcegen Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
span Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
stdx Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
syntax Auto merge of #16275 - davidsemakula:ast-path-segments, r=Veykril 2024-01-09 15:41:48 +00:00
test-fixture Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
test-utils Builtin derives are hygienic 2024-01-08 12:50:11 +01:00
text-edit Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
toolchain Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
tt Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
vfs fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00
vfs-notify fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00