about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/ide-diagnostics
diff options
context:
space:
mode:
authorTavo Annus <tavo.annus@gmail.com>2024-06-29 12:24:08 +0300
committerTavo Annus <tavo.annus@gmail.com>2024-06-29 12:24:08 +0300
commit8fd7ae975973fcee75b4bc978b20e045c4fe5177 (patch)
tree8d1326103d3473a3203210afba5d0a5e0d8a8eab /src/tools/rust-analyzer/crates/ide-diagnostics
parentfde55648116f75eb44340047d48a191d0660a403 (diff)
downloadrust-8fd7ae975973fcee75b4bc978b20e045c4fe5177.tar.gz
rust-8fd7ae975973fcee75b4bc978b20e045c4fe5177.zip
Make borrow checking configurable for term search
Diffstat (limited to 'src/tools/rust-analyzer/crates/ide-diagnostics')
-rw-r--r--src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/typed_hole.rs7
-rw-r--r--src/tools/rust-analyzer/crates/ide-diagnostics/src/lib.rs2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/typed_hole.rs b/src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/typed_hole.rs
index 71917e09f07..a64bac29498 100644
--- a/src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/typed_hole.rs
+++ b/src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/typed_hole.rs
@@ -47,7 +47,12 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::TypedHole) -> Option<Vec<Assist>
         sema: &ctx.sema,
         scope: &scope,
         goal: d.expected.clone(),
-        config: TermSearchConfig { fuel: ctx.config.term_search_fuel, ..Default::default() },
+        config: TermSearchConfig {
+            fuel: ctx.config.term_search_fuel,
+            enable_borrowcheck: ctx.config.term_search_borrowck,
+
+            ..Default::default()
+        },
     };
     let paths = term_search(&term_search_ctx);
 
diff --git a/src/tools/rust-analyzer/crates/ide-diagnostics/src/lib.rs b/src/tools/rust-analyzer/crates/ide-diagnostics/src/lib.rs
index a419f04bfae..f176c30c4a3 100644
--- a/src/tools/rust-analyzer/crates/ide-diagnostics/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/ide-diagnostics/src/lib.rs
@@ -234,6 +234,7 @@ pub struct DiagnosticsConfig {
     pub prefer_no_std: bool,
     pub prefer_prelude: bool,
     pub term_search_fuel: u64,
+    pub term_search_borrowck: bool,
 }
 
 impl DiagnosticsConfig {
@@ -260,6 +261,7 @@ impl DiagnosticsConfig {
             prefer_no_std: false,
             prefer_prelude: true,
             term_search_fuel: 400,
+            term_search_borrowck: true,
         }
     }
 }