aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/mbe/src/benchmark.rs2
-rw-r--r--crates/rust-analyzer/tests/rust-analyzer/main.rs18
-rw-r--r--crates/rust-analyzer/tests/rust-analyzer/support.rs12
3 files changed, 19 insertions, 13 deletions
diff --git a/crates/mbe/src/benchmark.rs b/crates/mbe/src/benchmark.rs
index 0d0acd589..6d81be880 100644
--- a/crates/mbe/src/benchmark.rs
+++ b/crates/mbe/src/benchmark.rs
@@ -177,7 +177,7 @@ fn invocation_fixtures(rules: &FxHashMap<String, MacroRules>) -> Vec<(String, tt
177 let c = 1013904223; 177 let c = 1013904223;
178 *seed = usize::wrapping_add(usize::wrapping_mul(*seed, a), c); 178 *seed = usize::wrapping_add(usize::wrapping_mul(*seed, a), c);
179 return *seed; 179 return *seed;
180 }; 180 }
181 fn make_ident(ident: &str) -> tt::TokenTree { 181 fn make_ident(ident: &str) -> tt::TokenTree {
182 tt::Leaf::Ident(tt::Ident { id: tt::TokenId::unspecified(), text: SmolStr::new(ident) }) 182 tt::Leaf::Ident(tt::Ident { id: tt::TokenId::unspecified(), text: SmolStr::new(ident) })
183 .into() 183 .into()
diff --git a/crates/rust-analyzer/tests/rust-analyzer/main.rs b/crates/rust-analyzer/tests/rust-analyzer/main.rs
index 80bde29b9..7545b4a34 100644
--- a/crates/rust-analyzer/tests/rust-analyzer/main.rs
+++ b/crates/rust-analyzer/tests/rust-analyzer/main.rs
@@ -54,7 +54,9 @@ version = "0.0.0"
54use std::collections::Spam; 54use std::collections::Spam;
55"#, 55"#,
56 ) 56 )
57 .with_sysroot(true) 57 .with_config(serde_json::json!({
58 "cargo": { "noSysroot": false }
59 }))
58 .server() 60 .server()
59 .wait_until_workspace_is_loaded(); 61 .wait_until_workspace_is_loaded();
60 62
@@ -451,7 +453,9 @@ fn main() {{}}
451"#, 453"#,
452 librs, libs 454 librs, libs
453 )) 455 ))
454 .with_sysroot(true) 456 .with_config(serde_json::json!({
457 "cargo": { "noSysroot": false }
458 }))
455 .server() 459 .server()
456 .wait_until_workspace_is_loaded(); 460 .wait_until_workspace_is_loaded();
457 461
@@ -574,7 +578,10 @@ fn main() {
574"###, 578"###,
575 ) 579 )
576 .with_config(serde_json::json!({ 580 .with_config(serde_json::json!({
577 "cargo": { "loadOutDirsFromCheck": true } 581 "cargo": {
582 "loadOutDirsFromCheck": true,
583 "noSysroot": true,
584 }
578 })) 585 }))
579 .server() 586 .server()
580 .wait_until_workspace_is_loaded(); 587 .wait_until_workspace_is_loaded();
@@ -717,7 +724,10 @@ pub fn foo(_input: TokenStream) -> TokenStream {
717"###, 724"###,
718 ) 725 )
719 .with_config(serde_json::json!({ 726 .with_config(serde_json::json!({
720 "cargo": { "loadOutDirsFromCheck": true }, 727 "cargo": {
728 "loadOutDirsFromCheck": true,
729 "noSysroot": true,
730 },
721 "procMacro": { 731 "procMacro": {
722 "enable": true, 732 "enable": true,
723 "server": PathBuf::from(env!("CARGO_BIN_EXE_rust-analyzer")), 733 "server": PathBuf::from(env!("CARGO_BIN_EXE_rust-analyzer")),
diff --git a/crates/rust-analyzer/tests/rust-analyzer/support.rs b/crates/rust-analyzer/tests/rust-analyzer/support.rs
index 453ce4fa8..6b774073d 100644
--- a/crates/rust-analyzer/tests/rust-analyzer/support.rs
+++ b/crates/rust-analyzer/tests/rust-analyzer/support.rs
@@ -20,7 +20,6 @@ use crate::testdir::TestDir;
20 20
21pub(crate) struct Project<'a> { 21pub(crate) struct Project<'a> {
22 fixture: &'a str, 22 fixture: &'a str,
23 with_sysroot: bool,
24 tmp_dir: Option<TestDir>, 23 tmp_dir: Option<TestDir>,
25 roots: Vec<PathBuf>, 24 roots: Vec<PathBuf>,
26 config: serde_json::Value, 25 config: serde_json::Value,
@@ -32,8 +31,10 @@ impl<'a> Project<'a> {
32 fixture, 31 fixture,
33 tmp_dir: None, 32 tmp_dir: None,
34 roots: vec![], 33 roots: vec![],
35 with_sysroot: false, 34 config: serde_json::json!({
36 config: serde_json::Value::Null, 35 // Loading standard library is costly, let's ignore it by default
36 "cargo": { "noSysroot": true }
37 }),
37 } 38 }
38 } 39 }
39 40
@@ -47,11 +48,6 @@ impl<'a> Project<'a> {
47 self 48 self
48 } 49 }
49 50
50 pub(crate) fn with_sysroot(mut self, yes: bool) -> Project<'a> {
51 self.with_sysroot = yes;
52 self
53 }
54
55 pub(crate) fn with_config(mut self, config: serde_json::Value) -> Project<'a> { 51 pub(crate) fn with_config(mut self, config: serde_json::Value) -> Project<'a> {
56 self.config = config; 52 self.config = config;
57 self 53 self