Skip to content

Subtree update of rust-analyzer #131832

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

Merged
merged 59 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0012480
feat: Highlight exit points of async blocks
CryZe Sep 19, 2024
8115a18
Comment out cast checks for unknown ptr kind
ChayimFriedman2 Sep 30, 2024
22129b1
fix: correctly parse `use` in generic parameters
SabrinaJewson Oct 1, 2024
96d667b
fix: Join rustfmt overrideCommand with project root
mrkajetanp Oct 2, 2024
090a03a
Remove ImportSource::ExternCrate as the fixed point loop can't affect it
Veykril Oct 5, 2024
6b286bc
Turn ImportSource into a struct
Veykril Oct 5, 2024
a219568
Add excluded extern-prelude IDE resolution test
Veykril Oct 5, 2024
96b3402
Fix IDE layer not correctly resolving opt-in extern crates
Veykril Oct 5, 2024
429d46d
Include description in label details when detail field is marked for …
Oct 5, 2024
2982141
Fix `prettify_macro_expansion()` when the node isn't the whole file
ChayimFriedman2 Oct 5, 2024
5544bf5
lsp: fix completion_item something_to_resolve not being a latch to true
jhgg Oct 5, 2024
3eea7af
fix: Do not consider mutable usage of deref to `*mut T` as deref_mut
ShoyuVanilla Oct 6, 2024
87baa0e
add knownEngines lldb-dap
kouhe3 Oct 7, 2024
90e3c88
lldbdap env dict to string
kouhe3 Oct 8, 2024
63b0e27
fix array sourceMap
kouhe3 Oct 8, 2024
3918e29
semicolon
kouhe3 Oct 8, 2024
a2304ba
prettier format
kouhe3 Oct 8, 2024
4c5b250
hir-ty: change struct constructor formatting.
jhgg Oct 8, 2024
35e268d
include fn prefix for all callable defs
jhgg Oct 8, 2024
4b30d25
Only Highlight Exit Points on `async` Token
CryZe Oct 8, 2024
64f510c
Auto merge of #18269 - jhgg:hir-ty/change-struct-constructor-formatti…
bors Oct 9, 2024
bd1c7e9
Auto merge of #18246 - ChayimFriedman2:fix-18238, r=Veykril
bors Oct 9, 2024
3e42fc5
Auto merge of #18247 - jhgg:lsp/fix-something-to-resolve, r=Veykril
bors Oct 9, 2024
ee7c8b9
Auto merge of #18245 - boattime:master, r=davidbarsky
bors Oct 9, 2024
ee684c1
Skip #[test_case] expansion
darichey Oct 10, 2024
0460ff7
Run subprocesses async in vscode extension
darichey Oct 11, 2024
0865296
Fix panic when json project has relative buildfile paths
darichey Oct 12, 2024
7562b17
Auto merge of #18289 - darichey:fix-relative-buildfiles, r=lnicola
bors Oct 12, 2024
aacf840
Auto merge of #18281 - darichey:async-subprocess, r=lnicola
bors Oct 12, 2024
7bc6150
feat: respect references.exclude_tests in call-hierarchy
roife Oct 12, 2024
e2c3ce5
Auto merge of #18226 - SabrinaJewson:fix-impl-use, r=Veykril
bors Oct 14, 2024
540891b
Auto merge of #18152 - CryZe:highlight-async-block-exit-points, r=Vey…
bors Oct 14, 2024
0b99f29
Auto merge of #18217 - ChayimFriedman2:cast-unknown-ptr, r=Veykril
bors Oct 14, 2024
1ef2712
Auto merge of #18229 - mrkajetanp:rustfmt-path, r=Veykril
bors Oct 14, 2024
a672968
Auto merge of #18242 - Veykril:veykril/push-tnynzqsmtnqw, r=Veykril
bors Oct 14, 2024
b85026b
Auto merge of #18252 - ShoyuVanilla:issue-15799, r=Veykril
bors Oct 14, 2024
a4df972
Auto merge of #18265 - kouhe3:master, r=Veykril
bors Oct 14, 2024
b2048df
Auto merge of #18275 - darichey:fix-test-case-hang, r=Veykril
bors Oct 14, 2024
d764d87
Auto merge of #18291 - roife:fix-issue-18212, r=Veykril
bors Oct 14, 2024
efd8e15
internal: switch remaining OpQueues to use named structs
davidbarsky Sep 30, 2024
1a354f6
Auto merge of #18216 - davidbarsky:davidbarsky/push-ustyovtqrpoq, r=d…
bors Oct 14, 2024
d28811b
chore: rename salsa to ra_salsa
davidbarsky Oct 4, 2024
23ef13d
Auto merge of #18239 - davidbarsky:davidbarsky/push-lswkwuyrpuqv, r=d…
bors Oct 14, 2024
2ee4925
feat: handle self-param outside of methods when renaming
roife Oct 12, 2024
d4e5c24
Auto merge of #18292 - roife:fix-issue-17427, r=Veykril
bors Oct 14, 2024
3c8e146
Do not consider match/let/ref of place that evaluates to ! to diverge…
ShoyuVanilla Oct 10, 2024
004e974
minor: `ra-salsa` in `profile.dev.package`
ShoyuVanilla Oct 14, 2024
12d63d9
Auto merge of #18297 - ShoyuVanilla:salsa-package-profile, r=davidbarsky
bors Oct 14, 2024
d381df4
fix: autofix for missing wrapped unit in return expr
roife Oct 15, 2024
be1c31d
Auto merge of #18299 - roife:fix-issue-18298, r=Veykril
bors Oct 15, 2024
6bb6fd8
Auto merge of #18278 - ShoyuVanilla:never-place, r=Veykril
bors Oct 15, 2024
929d5bc
internal: Use local time when formatting logs
Wilfred Aug 30, 2024
0be1e95
Auto merge of #17990 - Wilfred:local_time_logs, r=Veykril
bors Oct 16, 2024
08a5dc4
Bump version of scip crate
varungandhi-src Oct 17, 2024
ecf6fc5
Auto merge of #18315 - varungandhi-src:vg/bump-scip, r=lnicola
bors Oct 17, 2024
aff69cc
Preparing for merge from rust-lang/rust
lnicola Oct 17, 2024
1b7cd2b
Merge from rust-lang/rust
lnicola Oct 17, 2024
6e4f8fe
Bump rustc crates
lnicola Oct 17, 2024
e09bf4c
Auto merge of #18317 - lnicola:sync-from-rust, r=Veykril
bors Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 42 additions & 18 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,15 @@ dependencies = [
"libc",
]

[[package]]
name = "num_threads"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9"
dependencies = [
"libc",
]

[[package]]
name = "object"
version = "0.33.0"
Expand Down Expand Up @@ -1439,9 +1448,9 @@ dependencies = [

[[package]]
name = "protobuf"
version = "3.2.0"
version = "3.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b55bad9126f378a853655831eb7363b7b01b81d19f8cb1218861086ca4a1a61e"
checksum = "a3a7c64d9bf75b1b8d981124c14c179074e8caa7dfe7b6a12e6222ddcd0c8f72"
dependencies = [
"once_cell",
"protobuf-support",
Expand All @@ -1450,9 +1459,9 @@ dependencies = [

[[package]]
name = "protobuf-support"
version = "3.2.0"
version = "3.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5d4d7b8601c814cfb36bcebb79f0e61e45e1e93640cf778837833bbed05c372"
checksum = "b088fd20b938a875ea00843b6faf48579462630015c3788d397ad6a786663252"
dependencies = [
"thiserror",
]
Expand Down Expand Up @@ -1488,9 +1497,9 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_abi"
version = "0.68.0"
version = "0.71.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a8cb51bb4534ac3e9c74f1d9bd90e607e60f94f734b1cf1a66f753ad2af6ed7"
checksum = "c6999d098000b98415939f13158dac78cb3eeeb7b0c073847f3e4b623866e27c"
dependencies = [
"bitflags 2.6.0",
"ra-ap-rustc_index",
Expand All @@ -1499,9 +1508,9 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_index"
version = "0.68.0"
version = "0.71.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b640fba2b7ef4f875459e2e76daeb846ef341d1d376fa758962ac0eba79bce6"
checksum = "ae9fb312d942817dab10790881f555928c1f6a11a85186e8e573ad4a86c7d3be"
dependencies = [
"arrayvec",
"ra-ap-rustc_index_macros",
Expand All @@ -1510,9 +1519,9 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_index_macros"
version = "0.68.0"
version = "0.71.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "faef502419ba5ac9d3079b1a835c6e5b4e605388254bbe55eb5683936f541be9"
checksum = "766e3990eb1066a06deefc561b5a01b32ca5c9211feea31cbf4ed50611519872"
dependencies = [
"proc-macro2",
"quote",
Expand All @@ -1521,29 +1530,29 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_lexer"
version = "0.68.0"
version = "0.71.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5da7f9d533b8d5be6704558da741ff20b982ad4647b1e9e08632853e4fecf9d5"
checksum = "f4afa98eb7889c137d5a3f1cd189089e16da04d1e4837d358a67aa3dab10ffbe"
dependencies = [
"unicode-properties",
"unicode-xid",
]

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

[[package]]
name = "ra-ap-rustc_pattern_analysis"
version = "0.68.0"
version = "0.71.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3679d8dd0114ed6000918309f843782738e51c99d8e4baec0d0f706e4d948819"
checksum = "273d5f72926a58c7eea27aebc898d1d5b32d23d2342f692a94a2cf8746aa4a2f"
dependencies = [
"ra-ap-rustc_index",
"rustc-hash",
Expand Down Expand Up @@ -1765,9 +1774,9 @@ dependencies = [

[[package]]
name = "scip"
version = "0.3.3"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5dc1bd66649133af84ab62436ddd2856c2605182b02dec2cd197f684dfe15ef"
checksum = "8dfafd2fa14c6237fa1fc4310f739d02fa915d92977fa069426591f1de046f81"
dependencies = [
"protobuf",
]
Expand Down Expand Up @@ -2093,10 +2102,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [
"deranged",
"itoa",
"libc",
"num-conv",
"num_threads",
"powerfmt",
"serde",
"time-core",
"time-macros",
]

[[package]]
Expand All @@ -2105,6 +2118,16 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"

[[package]]
name = "time-macros"
version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [
"num-conv",
"time-core",
]

[[package]]
name = "tinyvec"
version = "1.8.0"
Expand Down Expand Up @@ -2213,6 +2236,7 @@ checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b"
dependencies = [
"sharded-slab",
"thread_local",
"time",
"tracing-core",
"tracing-log",
]
Expand Down
15 changes: 9 additions & 6 deletions src/tools/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ proc-macro-srv = { path = "./crates/proc-macro-srv", version = "0.0.0" }
proc-macro-srv-cli = { path = "./crates/proc-macro-srv-cli", version = "0.0.0" }
profile = { path = "./crates/profile", version = "0.0.0" }
project-model = { path = "./crates/project-model", version = "0.0.0" }
salsa = { path = "./crates/salsa", version = "0.0.0" }
ra-salsa = { path = "./crates/ra-salsa", package = "salsa", version = "0.0.0" }
span = { path = "./crates/span", version = "0.0.0" }
stdx = { path = "./crates/stdx", version = "0.0.0" }
syntax = { path = "./crates/syntax", version = "0.0.0" }
Expand All @@ -85,11 +85,11 @@ tt = { path = "./crates/tt", version = "0.0.0" }
vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
vfs = { path = "./crates/vfs", version = "0.0.0" }

ra-ap-rustc_lexer = { version = "0.68.0", default-features = false }
ra-ap-rustc_parse_format = { version = "0.68.0", default-features = false }
ra-ap-rustc_index = { version = "0.68.0", default-features = false }
ra-ap-rustc_abi = { version = "0.68.0", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.68.0", default-features = false }
ra-ap-rustc_lexer = { version = "0.71.0", default-features = false }
ra-ap-rustc_parse_format = { version = "0.71.0", default-features = false }
ra-ap-rustc_index = { version = "0.71.0", default-features = false }
ra-ap-rustc_abi = { version = "0.71.0", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.71.0", default-features = false }

# local crates that aren't published to crates.io. These should not have versions.
test-fixture = { path = "./crates/test-fixture" }
Expand Down Expand Up @@ -153,6 +153,9 @@ tracing-tree = "0.3.0"
tracing-subscriber = { version = "0.3.18", default-features = false, features = [
"registry",
"fmt",
"local-time",
"std",
"time",
"tracing-log",
] }
triomphe = { version = "0.1.10", default-features = false, features = ["std"] }
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/base-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ doctest = false
lz4_flex = { version = "0.11", default-features = false }

la-arena.workspace = true
salsa.workspace = true
ra-salsa.workspace = true
rustc-hash.workspace = true
triomphe.workspace = true
semver.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/base-db/src/change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

use std::fmt;

use ra_salsa::Durability;
use rustc_hash::FxHashMap;
use salsa::Durability;
use triomphe::Arc;
use vfs::FileId;

Expand Down
5 changes: 5 additions & 0 deletions src/tools/rust-analyzer/crates/base-db/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ pub struct CrateData {
/// The cfg options that could be used by the crate
pub potential_cfg_options: Option<Arc<CfgOptions>>,
pub env: Env,
/// The dependencies of this crate.
///
/// Note that this may contain more dependencies than the crate actually uses.
/// A common example is the test crate which is included but only actually is active when
/// declared in source via `extern crate test`.
pub dependencies: Vec<Dependency>,
pub origin: CrateOrigin,
pub is_proc_macro: bool,
Expand Down
30 changes: 15 additions & 15 deletions src/tools/rust-analyzer/crates/base-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ mod input;

use std::panic;

use ra_salsa::Durability;
use rustc_hash::FxHashMap;
use salsa::Durability;
use span::EditionedFileId;
use syntax::{ast, Parse, SourceFile, SyntaxError};
use triomphe::Arc;
Expand All @@ -20,19 +20,19 @@ pub use crate::{
TargetLayoutLoadResult,
},
};
pub use salsa::{self, Cancelled};
pub use ra_salsa::{self, Cancelled};
pub use vfs::{file_set::FileSet, AnchoredPath, AnchoredPathBuf, VfsPath};

pub use semver::{BuildMetadata, Prerelease, Version, VersionReq};

#[macro_export]
macro_rules! impl_intern_key {
($name:ident) => {
impl $crate::salsa::InternKey for $name {
fn from_intern_id(v: $crate::salsa::InternId) -> Self {
impl $crate::ra_salsa::InternKey for $name {
fn from_intern_id(v: $crate::ra_salsa::InternId) -> Self {
$name(v)
}
fn as_intern_id(&self) -> $crate::salsa::InternId {
fn as_intern_id(&self) -> $crate::ra_salsa::InternId {
self.0
}
}
Expand All @@ -55,30 +55,30 @@ pub trait FileLoader {

/// Database which stores all significant input facts: source code and project
/// model. Everything else in rust-analyzer is derived from these queries.
#[salsa::query_group(SourceDatabaseStorage)]
#[ra_salsa::query_group(SourceDatabaseStorage)]
pub trait SourceDatabase: FileLoader + std::fmt::Debug {
#[salsa::input]
#[ra_salsa::input]
fn compressed_file_text(&self, file_id: FileId) -> Arc<[u8]>;

/// Text of the file.
#[salsa::lru]
#[ra_salsa::lru]
fn file_text(&self, file_id: FileId) -> Arc<str>;

/// Parses the file into the syntax tree.
#[salsa::lru]
#[ra_salsa::lru]
fn parse(&self, file_id: EditionedFileId) -> Parse<ast::SourceFile>;

/// Returns the set of errors obtained from parsing the file including validation errors.
fn parse_errors(&self, file_id: EditionedFileId) -> Option<Arc<[SyntaxError]>>;

/// The crate graph.
#[salsa::input]
#[ra_salsa::input]
fn crate_graph(&self) -> Arc<CrateGraph>;

#[salsa::input]
#[ra_salsa::input]
fn crate_workspace_data(&self) -> Arc<FxHashMap<CrateId, Arc<CrateWorkspaceData>>>;

#[salsa::transparent]
#[ra_salsa::transparent]
fn toolchain_channel(&self, krate: CrateId) -> Option<ReleaseChannel>;
}

Expand Down Expand Up @@ -126,14 +126,14 @@ fn file_text(db: &dyn SourceDatabase, file_id: FileId) -> Arc<str> {

/// We don't want to give HIR knowledge of source roots, hence we extract these
/// methods into a separate DB.
#[salsa::query_group(SourceRootDatabaseStorage)]
#[ra_salsa::query_group(SourceRootDatabaseStorage)]
pub trait SourceRootDatabase: SourceDatabase {
/// Path to a file, relative to the root of its source root.
/// Source root of the file.
#[salsa::input]
#[ra_salsa::input]
fn file_source_root(&self, file_id: FileId) -> SourceRootId;
/// Contents of the source root.
#[salsa::input]
#[ra_salsa::input]
fn source_root(&self, id: SourceRootId) -> Arc<SourceRoot>;

/// Crates whose root fool is in `id`.
Expand Down
13 changes: 8 additions & 5 deletions src/tools/rust-analyzer/crates/hir-def/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,17 @@ impl ExternCrateDeclData {
let crate_id = if name == sym::self_.clone() {
Some(krate)
} else {
db.crate_def_map(krate)
.extern_prelude()
.find(|&(prelude_name, ..)| *prelude_name == name)
.map(|(_, (root, _))| root.krate())
db.crate_graph()[krate].dependencies.iter().find_map(|dep| {
if dep.name.symbol() == name.symbol() {
Some(dep.crate_id)
} else {
None
}
})
};

Arc::new(Self {
name: extern_crate.name.clone(),
name,
visibility: item_tree[extern_crate.visibility].clone(),
alias: extern_crate.alias.clone(),
crate_id,
Expand Down
Loading
Loading