Skip to content

Commit

Permalink
Merge commit '258b15c506a2d3ad862fd17ae24eaf272443f477' into sync-fro…
Browse files Browse the repository at this point in the history
…m-ra
  • Loading branch information
lnicola committed Sep 18, 2023
2 parents 078eb11 + 258b15c commit b18db7a
Show file tree
Hide file tree
Showing 195 changed files with 5,763 additions and 2,740 deletions.
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ lint = "clippy --all-targets -- -Aclippy::collapsible_if -Aclippy::needless_pass
linker = "rust-lld"

[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }
CARGO_WORKSPACE_DIR = { value = "", relative = true }
8 changes: 8 additions & 0 deletions src/tools/rust-analyzer/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,20 @@ jobs:
- name: Test
run: cargo test ${{ env.USE_SYSROOT_ABI }} -- --nocapture --quiet

- name: Switch to stable toolchain
run: |
rustup update --no-self-update stable
rustup component add --toolchain stable rust-src
rustup default stable
- name: Run analysis-stats on rust-analyzer
if: matrix.os == 'ubuntu-latest'
run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats .

- name: Run analysis-stats on rust std library
if: matrix.os == 'ubuntu-latest'
env:
RUSTC_BOOTSTRAP: 1
run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std

# Weird targets to catch non-portable code
Expand Down
23 changes: 14 additions & 9 deletions src/tools/rust-analyzer/.github/workflows/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
other_metrics:
strategy:
matrix:
names: [self, ripgrep, webrender, diesel]
names: [self, ripgrep-13.0.0, webrender-2022, diesel-1.4.8, hyper-0.14.18]
runs-on: ubuntu-latest
needs: [setup_cargo, build_metrics]

Expand All @@ -92,7 +92,7 @@ jobs:
key: ${{ runner.os }}-target-${{ github.sha }}

- name: Collect metrics
run: cargo xtask metrics ${{ matrix.names }}
run: cargo xtask metrics "${{ matrix.names }}"

- name: Upload metrics
uses: actions/upload-artifact@v3
Expand All @@ -118,25 +118,30 @@ jobs:
with:
name: self-${{ github.sha }}

- name: Download ripgrep metrics
- name: Download ripgrep-13.0.0 metrics
uses: actions/download-artifact@v3
with:
name: ripgrep-${{ github.sha }}
name: ripgrep-13.0.0-${{ github.sha }}

- name: Download webrender metrics
- name: Download webrender-2022 metrics
uses: actions/download-artifact@v3
with:
name: webrender-${{ github.sha }}
name: webrender-2022-${{ github.sha }}

- name: Download diesel metrics
- name: Download diesel-1.4.8 metrics
uses: actions/download-artifact@v3
with:
name: diesel-${{ github.sha }}
name: diesel-1.4.8-${{ github.sha }}

- name: Download hyper-0.14.18 metrics
uses: actions/download-artifact@v3
with:
name: hyper-0.14.18-${{ github.sha }}

- name: Combine json
run: |
git clone --depth 1 https://$METRICS_TOKEN@github.com/rust-analyzer/metrics.git
jq -s ".[0] * .[1] * .[2] * .[3] * .[4]" build.json self.json ripgrep.json webrender.json diesel.json -c >> metrics/metrics.json
jq -s ".[0] * .[1] * .[2] * .[3] * .[4] * .[5]" build.json self.json ripgrep-13.0.0.json webrender-2022.json diesel-1.4.8.json hyper-0.14.18.json -c >> metrics/metrics.json
cd metrics
git add .
git -c user.name=Bot -c user.email=dummy@example.com commit --message 📈
Expand Down
2 changes: 2 additions & 0 deletions src/tools/rust-analyzer/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ jobs:

- name: Run analysis-stats on rust std library
if: matrix.target == 'x86_64-unknown-linux-gnu'
env:
RUSTC_BOOTSTRAP: 1
run: target/${{ matrix.target }}/release/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std

- name: Upload artifacts
Expand Down
114 changes: 54 additions & 60 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,14 @@ dependencies = [

[[package]]
name = "filetime"
version = "0.2.19"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9"
checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"windows-sys 0.42.0",
"redox_syscall 0.3.5",
"windows-sys 0.48.0",
]

[[package]]
Expand Down Expand Up @@ -541,6 +541,7 @@ dependencies = [
"mbe",
"once_cell",
"profile",
"ra-ap-rustc_parse_format",
"rustc-hash",
"smallvec",
"stdx",
Expand Down Expand Up @@ -854,7 +855,6 @@ version = "0.0.0"
dependencies = [
"dashmap",
"hashbrown 0.12.3",
"once_cell",
"rustc-hash",
"triomphe",
]
Expand Down Expand Up @@ -999,7 +999,7 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"

[[package]]
name = "lsp-server"
version = "0.7.3"
version = "0.7.4"
dependencies = [
"crossbeam-channel",
"log",
Expand All @@ -1010,9 +1010,9 @@ dependencies = [

[[package]]
name = "lsp-server"
version = "0.7.3"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72417faa455bfb4e5bf14b157d8e2ca2ed74b4e89b8cf42ea2d864825ae5c8a2"
checksum = "b52dccdf3302eefab8c8a1273047f0a3c3dca4b527c8458d00c09484c8371928"
dependencies = [
"crossbeam-channel",
"log",
Expand Down Expand Up @@ -1149,20 +1149,21 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"

[[package]]
name = "notify"
version = "5.1.0"
version = "6.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9"
checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d"
dependencies = [
"bitflags 1.3.2",
"bitflags 2.3.2",
"crossbeam-channel",
"filetime",
"fsevent-sys",
"inotify",
"kqueue",
"libc",
"log",
"mio",
"walkdir",
"windows-sys 0.42.0",
"windows-sys 0.48.0",
]

[[package]]
Expand Down Expand Up @@ -1251,7 +1252,7 @@ dependencies = [
"cfg-if",
"instant",
"libc",
"redox_syscall",
"redox_syscall 0.2.16",
"smallvec",
"winapi",
]
Expand All @@ -1264,7 +1265,7 @@ checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"redox_syscall 0.2.16",
"smallvec",
"windows-sys 0.42.0",
]
Expand Down Expand Up @@ -1481,16 +1482,36 @@ dependencies = [
"proc-macro2",
]

[[package]]
name = "ra-ap-rustc_index"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07b5fa61d34da18e148dc3a81f654488ea07f40938d8aefb17f8b64bb78c6120"
dependencies = [
"arrayvec",
"smallvec",
]

[[package]]
name = "ra-ap-rustc_lexer"
version = "0.1.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1c145702ed3f237918e512685185dc8a4d0edc3a5326c63d20361d8ba9b45b3"
checksum = "f2e2f6b48422e4eed5218277ab7cc9733e60dd8f3167f4f36a49a0cafe4dc195"
dependencies = [
"unic-emoji-char",
"unicode-properties",
"unicode-xid",
]

[[package]]
name = "ra-ap-rustc_parse_format"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3c7369ad01cc79f9e3513c9f6a6326f6b980100e4862a7ac71b9991c88108bb"
dependencies = [
"ra-ap-rustc_index",
"ra-ap-rustc_lexer",
]

[[package]]
name = "rayon"
version = "1.7.0"
Expand Down Expand Up @@ -1522,6 +1543,15 @@ dependencies = [
"bitflags 1.3.2",
]

[[package]]
name = "redox_syscall"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
dependencies = [
"bitflags 1.3.2",
]

[[package]]
name = "rowan"
version = "0.15.11"
Expand All @@ -1545,7 +1575,6 @@ dependencies = [
"crossbeam-channel",
"dissimilar",
"expect-test",
"filetime",
"flycheck",
"hir",
"hir-def",
Expand All @@ -1555,7 +1584,7 @@ dependencies = [
"ide-ssr",
"itertools",
"load-cargo",
"lsp-server 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"lsp-server 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lsp-types",
"mbe",
"mimalloc",
Expand Down Expand Up @@ -2056,47 +2085,6 @@ version = "1.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3e5df347f0bf3ec1d670aad6ca5c6a1859cd9ea61d2113125794654ccced68f"

[[package]]
name = "unic-char-property"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221"
dependencies = [
"unic-char-range",
]

[[package]]
name = "unic-char-range"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc"

[[package]]
name = "unic-common"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc"

[[package]]
name = "unic-emoji-char"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b07221e68897210270a38bde4babb655869637af0f69407f96053a34f76494d"
dependencies = [
"unic-char-property",
"unic-char-range",
"unic-ucd-version",
]

[[package]]
name = "unic-ucd-version"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4"
dependencies = [
"unic-common",
]

[[package]]
name = "unicase"
version = "2.6.0"
Expand Down Expand Up @@ -2127,6 +2115,12 @@ dependencies = [
"tinyvec",
]

[[package]]
name = "unicode-properties"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7f91c8b21fbbaa18853c3d0801c78f4fc94cdb976699bb03e832e75f7fd22f0"

[[package]]
name = "unicode-segmentation"
version = "1.10.1"
Expand Down
12 changes: 8 additions & 4 deletions src/tools/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ proc-macro-test = { path = "./crates/proc-macro-test" }
# In-tree crates that are published separately and follow semver. See lib/README.md
line-index = { version = "0.1.0-pre.1" }
la-arena = { version = "0.3.1" }
lsp-server = { version = "0.7.3" }
lsp-server = { version = "0.7.4" }

# non-local crates
smallvec = { version = "1.10.0", features = [
Expand All @@ -97,11 +97,15 @@ smallvec = { version = "1.10.0", features = [
smol_str = "0.2.0"
nohash-hasher = "0.2.0"
text-size = "1.1.0"
# See https://github.com/serde-rs/serde/issues/2538#issuecomment-1684517372 for why we pin serde
serde = { version = "1.0.156, < 1.0.172", features = ["derive"] }
serde = { version = "1.0.156", features = ["derive"] }
serde_json = "1.0.96"
triomphe = { version = "0.1.8", default-features = false, features = ["std"] }
# can't upgrade due to dashmap depending on 0.12.3 currently
hashbrown = { version = "0.12.3", features = ["inline-more"], default-features = false }

rustc_lexer = { version = "0.1.0", package = "ra-ap-rustc_lexer" }
rustc_lexer = { version = "0.10.0", package = "ra-ap-rustc_lexer" }
rustc_parse_format = { version = "0.10.0", package = "ra-ap-rustc_parse_format", default-features = false }

# Upstream broke this for us so we can't update it
rustc_abi = { version = "0.0.20221221", package = "hkalbasi-rustc-ap-rustc_abi", default-features = false }
rustc_index = { version = "0.0.20221221", package = "hkalbasi-rustc-ap-rustc_index", default-features = false }
10 changes: 5 additions & 5 deletions src/tools/rust-analyzer/crates/base-db/src/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ impl ChangeFixture {
meta.edition,
Some(crate_name.clone().into()),
version,
meta.cfg,
Default::default(),
meta.cfg.clone(),
Some(meta.cfg),
meta.env,
false,
origin,
Expand All @@ -200,7 +200,7 @@ impl ChangeFixture {
} else if meta.path == "/main.rs" || meta.path == "/lib.rs" {
assert!(default_crate_root.is_none());
default_crate_root = Some(file_id);
default_cfg = meta.cfg;
default_cfg.extend(meta.cfg.into_iter());
default_env.extend(meta.env.iter().map(|(x, y)| (x.to_owned(), y.to_owned())));
default_target_data_layout = meta.target_data_layout;
}
Expand All @@ -220,8 +220,8 @@ impl ChangeFixture {
Edition::CURRENT,
Some(CrateName::new("test").unwrap().into()),
None,
default_cfg,
Default::default(),
default_cfg.clone(),
Some(default_cfg),
default_env,
false,
CrateOrigin::Local { repo: None, name: None },
Expand Down
Loading

0 comments on commit b18db7a

Please sign in to comment.