Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtree update of rust-analyzer #119988

Merged
merged 73 commits into from
Jan 15, 2024
Merged

Subtree update of rust-analyzer #119988

merged 73 commits into from
Jan 15, 2024

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Jan 15, 2024

r? ghost

l1nxy and others added 30 commits December 29, 2023 18:32
implement the predicate set on the case function from traits
internal: VFS no longer stores all source files in memory

Turns out there is no need to keep the files around. We either upload them to salsa once processed, or we need to keep them around for the `DidChangeTextDocumentNotification`, but that notification is only valid for opened documents, so instead we can just keep the files around in the `MemDocs`!

Fixes rust-lang/rust-analyzer#16301
minor: Remove newline and add dot in syntax docs

While reading through the docs I came across these two small typos.
Patryk27 and others added 7 commits January 10, 2024 18:21
rust-analyzer has logic that discounts suggesting `use`s for private
imports, but that logic is unnecessarily strict - for instance given
this code:

```rust
mod foo {
    pub struct Foo;
}

pub(crate) use self::foo::*;

mod bar {
    fn main() {
        Foo$0;
    }
}
```

... RA will suggest to add `use crate::foo::Foo;`, which not only makes
the code overly verbose (especially in larger code bases), but also is
disjoint with what rustc itself suggests.

This commit adjusts the logic, so that `pub(crate)` imports are taken
into account when generating the suggestions; considering rustc's
behavior, I think this change doesn't warrant any extra configuration
flag.

Note that this is my first commit to RA, so I guess the approach taken
here might be suboptimal - certainly feels somewhat hacky, maybe there's
some better way of finding out the optimal import path 😅
…=Veykril

fix: Acknowledge `pub(crate)` imports in import suggestions

rust-analyzer has logic that discounts suggesting `use`s for private imports, but that logic is unnecessarily strict - for instance given this code:

```rust
mod foo {
    pub struct Foo;
}

pub(crate) use self::foo::*;

mod bar {
    fn main() {
        Foo$0;
    }
}
```

... RA will suggest to add `use crate::foo::Foo;`, which not only makes the code overly verbose (especially in larger code bases), but also is disjoint with what rustc itself suggests.

This commit adjusts the logic, so that `pub(crate)` imports are taken into account when generating the suggestions; considering rustc's behavior, I think this change doesn't warrant any extra configuration flag.

Note that this is my first commit to RA, so I guess the approach taken here might be suboptimal - certainly feels somewhat hacky, maybe there's some better way of finding out the optimal import path 😅
internal: Consider all kinds of explicit private imports in find_path

Builds on top of rust-lang/rust-analyzer#16265 to make things a bit more general, now we consider all explicit private imports.
fix: Fix nested includes resolving from the wrong base file

Fixes rust-lang/rust-analyzer#16109
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 15, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 15, 2024

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@lnicola
Copy link
Member Author

lnicola commented Jan 15, 2024

@bors r+ p=1 subtree sync

@bors
Copy link
Contributor

bors commented Jan 15, 2024

📌 Commit 32bd51e has been approved by lnicola

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 15, 2024
@bors
Copy link
Contributor

bors commented Jan 15, 2024

⌛ Testing commit 32bd51e with merge 24a329c...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 15, 2024
Subtree update of `rust-analyzer`

r? ghost
@rust-log-analyzer
Copy link
Collaborator

The job i686-mingw failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests\ui\runtime\backtrace-debuginfo.rs stdout ----

error: test run failed!
status: exit code: 101
command: PATH="C:\a\rust\rust\build\i686-pc-windows-gnu\stage2\lib\rustlib\i686-pc-windows-gnu\lib;C:\a\rust\rust\build\i686-pc-windows-gnu\stage0-bootstrap-tools\i686-pc-windows-gnu\release\deps;C:\a\rust\rust\build\i686-pc-windows-gnu\stage0\bin;C:\a\rust\rust\ninja;C:\a\rust\rust\mingw32\bin;C:\hostedtoolcache\windows\Python\3.12.1\x64\Scripts;C:\hostedtoolcache\windows\Python\3.12.1\x64;C:\msys64\usr\bin;C:\a\rust\rust\sccache;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\2.13.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\R\R-4.3.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.20.12\x64\bin;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Ruby\2.5.9\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.392-8\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files (x86)\Microsoft BizTalk Server;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps" "C:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\test\\ui\\runtime\\backtrace-debuginfo\\a.exe"
---------------------------------------
trace does not match position list
trace does not match position list
still need to find ["backtrace-debuginfo.rs:184"]
--- stdout
backtrace-debuginfo-aux.rs:13
backtrace-debuginfo.rs:109
backtrace-debuginfo.rs:121
---
   8:   0x153480 - std::panicking::begin_panic::he68d0ddf97f95064
                       at /rustc/FAKE_PREFIX\library\std\src/panicking.rs:688:12
   9:   0x16674e - backtrace_debuginfo::inner_inlined::{{closure}}::h45563682bb90bb96
                       at C:\a\rust\rust\tests\ui\runtime\backtrace-debuginfo.rs:110:9
  10:   0x166c31 - backtrace_debuginfo::aux::callback_inlined::h99af8f3c81a5476e
  11:   0x166c31 - backtrace_debuginfo::inner_inlined::h55411b2de0d92a78
                       at C:\a\rust\rust\tests\ui\runtime\backtrace-debuginfo.rs:109:29
  12:   0x166c31 - backtrace_debuginfo::outer::hb144f59b805e2ef5
                       at C:\a\rust\rust\tests\ui\runtime\backtrace-debuginfo.rs:121:5
                       at C:\a\rust\rust\tests\ui\runtime\backtrace-debuginfo.rs:121:5
  13:  0x104ba10 - <unknown>
  14:   0x154339 - core::ops::function::FnOnce::call_once::h7a46ecbc47ff076e
                       at /rustc/FAKE_PREFIX\library\core\src\ops/function.rs:250:5
  15:   0x153101 - std::sys_common::backtrace::__rust_begin_short_backtrace::hc9dab8c948502b1e
                       at /rustc/FAKE_PREFIX\library\std\src\sys_common/backtrace.rs:155:18
  16:   0x153173 - std::rt::lang_start::{{closure}}::h4571464e16ba6489
                       at /rustc/FAKE_PREFIX\library\std\src/rt.rs:166:18
  17: 0x71d07ede - std::rt::lang_start_internal::h000185e90b970f68
  18:   0x15314b - std::rt::lang_start::h29c9a3d887f24c8b
                       at /rustc/FAKE_PREFIX\library\std\src/rt.rs:165:17
  19:   0x167e2e - _main
  20:   0x151386 - ___tmainCRTStartup
  21: 0x75c405c9 - <unknown>
  22: 0x77d478bd - <unknown>
  23: 0x77d4788d - <unknown>
--- stderr -------------------------------
thread 'main' panicked at C:\a\rust\rust\tests\ui\runtime\backtrace-debuginfo.rs:174:9:
found some errors
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@bors
Copy link
Contributor

bors commented Jan 15, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 15, 2024
@lnicola
Copy link
Member Author

lnicola commented Jan 15, 2024

@bors retry #117097

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 15, 2024
@bors
Copy link
Contributor

bors commented Jan 15, 2024

⌛ Testing commit 32bd51e with merge bfcc027...

@bors
Copy link
Contributor

bors commented Jan 15, 2024

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing bfcc027 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 15, 2024
@bors bors merged commit bfcc027 into rust-lang:master Jan 15, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 15, 2024
@lnicola lnicola deleted the sync-from-ra branch January 15, 2024 20:44
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bfcc027): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
4.0% [4.0%, 4.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-5.2%, -1.9%] 3
All ❌✅ (primary) 4.0% [4.0%, 4.0%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.9% [0.9%, 0.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 666.532s -> 667.719s (0.18%)
Artifact size: 308.23 MiB -> 308.26 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.