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

⬆️ rust-analyzer #102912

Merged
merged 111 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
ba64c93
Lower generator expression to HIR
lowr Sep 5, 2022
aeeb9e0
Add `TyBuilder` method to build `Substitution` for generator
lowr Sep 9, 2022
77c40f8
Implement type inference for generator and yield expressions
lowr Sep 6, 2022
447596c
Implement `RustIrDatabase::generator_datum()`
lowr Sep 9, 2022
4b5a66e
Add tests for type inference for generators
lowr Sep 9, 2022
997fc46
Implemented basic enum const eval
OleStrohm Aug 6, 2022
e28046c
Removed unnecessary TODO
OleStrohm Aug 6, 2022
b63234e
Cleaned up code
OleStrohm Aug 6, 2022
2f84b6e
Almost there
OleStrohm Aug 6, 2022
ad0a6bf
Added consteval tests
OleStrohm Aug 7, 2022
301b889
Added more consteval tests and fixed consteval result
OleStrohm Aug 7, 2022
5313bd1
Cleaned up code based on feedback
OleStrohm Sep 12, 2022
177ec82
Rebased
OleStrohm Sep 12, 2022
3931e55
Fixed lints
OleStrohm Sep 12, 2022
ed0cf1c
Add functionality to unwrap tuple declarations
harudagondi Sep 17, 2022
d9f5709
Simplify feature representation in CargoConfig
Veykril Sep 19, 2022
bc6d574
Auto merge of #13259 - Veykril:cargo-config-simplify, r=Veykril
bors Sep 19, 2022
a6c067c
Simplify
Veykril Sep 19, 2022
4f2c86e
Auto merge of #13260 - Veykril:simplify, r=Veykril
bors Sep 19, 2022
cdc362e
docs(inlay-hints): remove reference to Toggle inlay hints
didibear Sep 19, 2022
4d989b5
Auto merge of #13262 - DidiBear:master, r=lnicola
bors Sep 19, 2022
f87ad8d
Added FIXME for the repr type of the enum
OleStrohm Sep 19, 2022
9845e37
Ensure at least one trait bound in `TyKind::DynTy`
lowr Sep 19, 2022
bde76b9
Auto merge of #13264 - lowr:patch/no-dyn-without-trait, r=Veykril
bors Sep 19, 2022
7e8eac3
Simplify
Veykril Sep 20, 2022
027bfd6
Fix operator highlighting tags applying too broadly
Veykril Sep 20, 2022
09600a3
Auto merge of #13268 - Veykril:simplify, r=Veykril
bors Sep 20, 2022
817a6a8
Auto merge of #12966 - OleStrohm:master, r=Veykril
bors Sep 20, 2022
6d0d051
Simplify
Veykril Sep 20, 2022
9f233cd
Parse more repr options
Veykril Sep 20, 2022
b25f0ba
Properly set the enum variant body expected type
Veykril Sep 20, 2022
2119c1f
Fix using incorrect type for variants in DefWithBody::body_type
Veykril Sep 20, 2022
9bf386f
Fix default enum representation not being isize
Veykril Sep 20, 2022
5b49745
Auto merge of #13269 - Veykril:repr, r=Veykril
bors Sep 20, 2022
c2dc32c
return None instead of assert
harudagondi Sep 21, 2022
9ede5f0
Implement `HirDisplay` for `TyKind::Generator`
lowr Sep 21, 2022
40e8f03
docs(guide): fix Analysis and AnalysisHost doc links
oknozor Sep 22, 2022
729a9eb
Fix find_path using the wrong module for visibility calculations
Veykril Sep 22, 2022
fb0ce25
Add RequestFailed error code, as per spec 3.17
alanz Sep 23, 2022
f57cd83
Don't run proc-macro-srv tests on the rust-analyzer repo
Veykril Sep 23, 2022
1440078
Auto merge of #13286 - Veykril:proc-macro-srv-tests, r=Veykril
bors Sep 23, 2022
7ec9ffa
Properly support IDE functionality in enum variants
Veykril Sep 23, 2022
4e7bb5e
Auto merge of #13285 - Veykril:variant-body, r=Veykril
bors Sep 24, 2022
0231d19
Fix diagnostics not working in enum variant bodies
Veykril Sep 24, 2022
fa38c10
Auto merge of #13288 - Veykril:variant-body, r=Veykril
bors Sep 24, 2022
73f6af5
Use the sysroot proc-macro server for analysis-stats
Veykril Sep 24, 2022
73ab709
Auto merge of #13289 - rust-lang:analysis-stats-proc-server, r=Veykril
bors Sep 24, 2022
1f92965
Auto merge of #13209 - lowr:feat/inference-for-generator, r=Veykril
bors Sep 26, 2022
7929e9c
Remove obsolete in-rust-tree feature from sourcegen
Veykril Sep 26, 2022
1a24003
Auto merge of #13248 - harudagondi:unwrap-tuple, r=Veykril
bors Sep 26, 2022
aa093f5
Fix PackageInformation having the crate name instead of package name
Strum355 Sep 26, 2022
60b432b
fix model tests
Strum355 Sep 26, 2022
651c586
formatting
Strum355 Sep 26, 2022
89107d5
Emit unconfigured code diagnostics for fields
unexge Sep 4, 2022
b21bf25
Collect diagnostics in queries instead of nameres
unexge Sep 21, 2022
3a8d84b
Use `Arc<[DefDiagnostic]>` instead of `Arc<Vec<DefDiagnostic>>`
unexge Sep 26, 2022
7e5e517
Generate `From` impls manually
unexge Sep 26, 2022
8c7e376
Auto merge of #13275 - Veykril:find-path, r=Veykril
bors Sep 27, 2022
f972cdd
Auto merge of #13295 - rust-lang:sourcegen, r=Veykril
bors Sep 27, 2022
fb73644
Use cfg(any()) instead of cfg(FALSE) for disabling proc-macro test
Veykril Sep 27, 2022
b01cdd8
Auto merge of #13189 - unexge:unconfigured-diagnostics-for-fields, r=…
bors Sep 27, 2022
8805d05
Auto merge of #13296 - Strum355:package-information-package-name, r=V…
bors Sep 27, 2022
bd8c5b6
Auto merge of #13300 - Veykril:cfg-false, r=Veykril
bors Sep 27, 2022
c3a6c96
Amalgamate file changes for the same file ids in process_changes
Veykril Sep 15, 2022
093de32
Auto merge of #13237 - Veykril:process-changes, r=Veykril
bors Sep 27, 2022
03aa704
Auto merge of #13280 - alanz:errorcode-requestfailed, r=Veykril
bors Sep 27, 2022
b16b041
Auto merge of #13272 - oknozor:master, r=Veykril
bors Sep 27, 2022
1a6c159
Don't retry requests that have already been cancelled
Veykril Sep 7, 2022
9ba55ba
Auto merge of #13202 - Veykril:cancelled-retry, r=Veykril
bors Sep 27, 2022
f5fe6b1
Make assist tests panic again on empty source changes
Veykril Sep 27, 2022
ad752bd
Auto merge of #13301 - Veykril:empty-assist-source-changes, r=Veykril
bors Sep 27, 2022
6d8903a
fix: infer for-loop item type with `IntoIterator` and `Iterator`
lowr Sep 29, 2022
97f8f4a
Auto merge of #13311 - lowr:fix/for-loop-item-resolution, r=Veykril
bors Sep 29, 2022
8c433c7
Fix requests not being retried anymore
Veykril Sep 30, 2022
8132b42
Auto merge of #13319 - Veykril:req-retry, r=Veykril
bors Sep 30, 2022
3cd57c4
Fix annotations not resolving when lens location is set to whole item
Veykril Sep 30, 2022
77cfc9b
Fix type alias hovers not rendering generic parameters
Veykril Sep 30, 2022
17363b3
Auto merge of #13320 - Veykril:ty-alias-hover, r=Veykril
bors Sep 30, 2022
2293949
Auto merge of #13318 - Veykril:annotations, r=Veykril
bors Sep 30, 2022
3ad0334
Fix move_format_string_arg being tokentree unaware
Veykril Sep 30, 2022
5b7e400
Auto merge of #13321 - Veykril:format-str-args, r=Veykril
bors Sep 30, 2022
bfd5f00
Fix trait impl item completions using macro file text ranges
Veykril Oct 1, 2022
f88293f
Auto merge of #13324 - Veykril:trait-impl-completion, r=Veykril
bors Oct 1, 2022
26cf250
Do not use the sysroot proc-macro server when a server path is given …
Veykril Oct 1, 2022
bf5cad8
Auto merge of #13326 - Veykril:proc-macro-srv-config, r=Veykril
bors Oct 1, 2022
5424c51
Add config for supplying sysroot path
Veykril Oct 1, 2022
cdc5493
Auto merge of #13327 - Veykril:proc-macro-srv-config, r=Veykril
bors Oct 1, 2022
870825b
Add proc-macro dependency to rustc crates
Veykril Oct 1, 2022
5c28ad1
Auto merge of #13328 - Veykril:rustc-proc-macro, r=Veykril
bors Oct 1, 2022
f8f5a5e
refactor: use `cast()` instead of interning `GenericArgData`
lowr Oct 2, 2022
4385d3d
Change generic parameter/argument order
lowr Oct 2, 2022
78977cd
Adapt to the new generic parameter/argument order
lowr Oct 2, 2022
7556f74
Remove hack
lowr Oct 2, 2022
5916803
Prioritize restart messages in flycheck
Veykril Oct 3, 2022
f087ebe
Auto merge of #13338 - Veykril:flycheck, r=Veykril
bors Oct 3, 2022
5bd98e3
Auto merge of #13335 - lowr:patch/change-generic-param-order, r=Veykril
bors Oct 3, 2022
e0a161b
fix: treat enum variants as generic item on their own
lowr Oct 3, 2022
974caaf
Auto merge of #13339 - lowr:patch/change-generic-param-order, r=Veykril
bors Oct 3, 2022
e0c9e28
Revert "Add proc-macro dependency to rustc crates"
Veykril Oct 4, 2022
b429df2
Auto merge of #13342 - rust-lang:revert-13328-rustc-proc-macro, r=Vey…
bors Oct 4, 2022
ded3326
fix: use `BoundVar`s from current generic scope
lowr Oct 4, 2022
476d043
Auto merge of #13344 - lowr:patch/change-generic-param-order, r=Veykril
bors Oct 4, 2022
8862fe6
Fix assertion failure in type inference (#13352)
wildbook Oct 5, 2022
a57ef6b
Fix go-to-def for shadowed `include*!`
WaffleLapkin Oct 6, 2022
f2f3528
Auto merge of #13356 - WaffleLapkin:go_to_def_shadow_include, r=Veykril
bors Oct 6, 2022
a415fb4
Auto merge of #13353 - wildbook:fix_type_inference_panic, r=Veykril
bors Oct 6, 2022
1c0ec9f
Fix go-to-def for `#[doc = include_str!("path")]`
WaffleLapkin Oct 7, 2022
8437e4b
Auto merge of #13362 - WaffleLapkin:go_to_def_fix_doc_include_str, r=…
bors Oct 7, 2022
39fa8b5
internal: :arrow_up: xflags
matklad Oct 8, 2022
61504c8
Auto merge of #13366 - matklad:xflags, r=lnicola
bors Oct 8, 2022
c867288
:arrow_up: rust-analyzer
lnicola Oct 11, 2022
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
22 changes: 11 additions & 11 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ dependencies = [

[[package]]
name = "lsp-server"
version = "0.6.0"
version = "0.7.0"
dependencies = [
"crossbeam-channel",
"log",
Expand Down Expand Up @@ -1502,18 +1502,18 @@ dependencies = [

[[package]]
name = "serde"
version = "1.0.143"
version = "1.0.144"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553"
checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860"
dependencies = [
"serde_derive",
]

[[package]]
name = "serde_derive"
version = "1.0.143"
version = "1.0.144"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391"
checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00"
dependencies = [
"proc-macro2",
"quote",
Expand All @@ -1522,9 +1522,9 @@ dependencies = [

[[package]]
name = "serde_json"
version = "1.0.83"
version = "1.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7"
checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
dependencies = [
"indexmap",
"itoa",
Expand Down Expand Up @@ -2082,18 +2082,18 @@ checksum = "06069a848f95fceae3e5e03c0ddc8cb78452b56654ee0c8e68f938cf790fb9e3"

[[package]]
name = "xflags"
version = "0.2.4"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f14fe1ed41a5a2b5ef3f565586c4a8a559ee55d3953faab360a771135bdee00"
checksum = "cbf19f5031a1a812e96fede16f8161218883079946cea87619d3613db1efd268"
dependencies = [
"xflags-macros",
]

[[package]]
name = "xflags-macros"
version = "0.2.4"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45d11d5fc2a97287eded8b170ca80533b3c42646dd7fa386a5eb045817921022"
checksum = "2afbd7f2039bb6cad2dd45f0c5dff49c0d4e26118398768b7a605524d4251809"

[[package]]
name = "xshell"
Expand Down
8 changes: 4 additions & 4 deletions src/tools/rust-analyzer/crates/base-db/src/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl ChangeFixture {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
} else {
for (from, to, prelude) in crate_deps {
Expand Down Expand Up @@ -270,7 +270,7 @@ impl ChangeFixture {
Env::default(),
Ok(proc_macro),
true,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);

for krate in all_crates {
Expand Down Expand Up @@ -398,7 +398,7 @@ fn parse_crate(crate_str: String) -> (String, CrateOrigin, Option<String>) {
let (version, origin) = match b.split_once(':') {
Some(("CratesIo", data)) => match data.split_once(',') {
Some((version, url)) => {
(version, CrateOrigin::CratesIo { repo: Some(url.to_owned()) })
(version, CrateOrigin::CratesIo { repo: Some(url.to_owned()), name: None })
}
_ => panic!("Bad crates.io parameter: {}", data),
},
Expand All @@ -409,7 +409,7 @@ fn parse_crate(crate_str: String) -> (String, CrateOrigin, Option<String>) {
let crate_origin = match &*crate_str {
"std" => CrateOrigin::Lang(LangCrateOrigin::Std),
"core" => CrateOrigin::Lang(LangCrateOrigin::Core),
_ => CrateOrigin::CratesIo { repo: None },
_ => CrateOrigin::CratesIo { repo: None, name: None },
};
(crate_str, crate_origin, None)
}
Expand Down
22 changes: 11 additions & 11 deletions src/tools/rust-analyzer/crates/base-db/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl ops::Deref for CrateName {
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum CrateOrigin {
/// Crates that are from crates.io official registry,
CratesIo { repo: Option<String> },
CratesIo { repo: Option<String>, name: Option<String> },
/// Crates that are provided by the language, like std, core, proc-macro, ...
Lang(LangCrateOrigin),
}
Expand Down Expand Up @@ -648,7 +648,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
let crate2 = graph.add_crate_root(
FileId(2u32),
Expand All @@ -660,7 +660,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
let crate3 = graph.add_crate_root(
FileId(3u32),
Expand All @@ -672,7 +672,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
assert!(graph
.add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
Expand All @@ -698,7 +698,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
let crate2 = graph.add_crate_root(
FileId(2u32),
Expand All @@ -710,7 +710,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
assert!(graph
.add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
Expand All @@ -733,7 +733,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
let crate2 = graph.add_crate_root(
FileId(2u32),
Expand All @@ -745,7 +745,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
let crate3 = graph.add_crate_root(
FileId(3u32),
Expand All @@ -757,7 +757,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
assert!(graph
.add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
Expand All @@ -780,7 +780,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
let crate2 = graph.add_crate_root(
FileId(2u32),
Expand All @@ -792,7 +792,7 @@ mod tests {
Env::default(),
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None },
CrateOrigin::CratesIo { repo: None, name: None },
);
assert!(graph
.add_dep(
Expand Down
13 changes: 11 additions & 2 deletions src/tools/rust-analyzer/crates/flycheck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,30 @@ impl FlycheckActor {
}
fn next_event(&self, inbox: &Receiver<Restart>) -> Option<Event> {
let check_chan = self.cargo_handle.as_ref().map(|cargo| &cargo.receiver);
if let Ok(msg) = inbox.try_recv() {
// give restarts a preference so check outputs don't block a restart or stop
return Some(Event::Restart(msg));
}
select! {
recv(inbox) -> msg => msg.ok().map(Event::Restart),
recv(check_chan.unwrap_or(&never())) -> msg => Some(Event::CheckEvent(msg.ok())),
}
}
fn run(mut self, inbox: Receiver<Restart>) {
while let Some(event) = self.next_event(&inbox) {
'event: while let Some(event) = self.next_event(&inbox) {
match event {
Event::Restart(Restart::No) => {
self.cancel_check_process();
}
Event::Restart(Restart::Yes) => {
// Cancel the previously spawned process
self.cancel_check_process();
while let Ok(_) = inbox.recv_timeout(Duration::from_millis(50)) {}
while let Ok(restart) = inbox.recv_timeout(Duration::from_millis(50)) {
// restart chained with a stop, so just cancel
if let Restart::No = restart {
continue 'event;
}
}

let command = self.check_command();
tracing::debug!(?command, "will restart flycheck");
Expand Down
Loading