aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock12
-rw-r--r--crates/ra_ide/src/references.rs4
2 files changed, 9 insertions, 7 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a0444e97a..090454658 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -739,7 +739,7 @@ dependencies = [
739 739
740[[package]] 740[[package]]
741name = "once_cell" 741name = "once_cell"
742version = "1.2.0" 742version = "1.3.0"
743source = "registry+https://github.com/rust-lang/crates.io-index" 743source = "registry+https://github.com/rust-lang/crates.io-index"
744 744
745[[package]] 745[[package]]
@@ -981,7 +981,7 @@ dependencies = [
981 "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", 981 "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
982 "insta 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 982 "insta 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
983 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 983 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
984 "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 984 "once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
985 "ra_arena 0.1.0", 985 "ra_arena 0.1.0",
986 "ra_cfg 0.1.0", 986 "ra_cfg 0.1.0",
987 "ra_db 0.1.0", 987 "ra_db 0.1.0",
@@ -1043,7 +1043,7 @@ dependencies = [
1043 "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", 1043 "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
1044 "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 1044 "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
1045 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 1045 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
1046 "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 1046 "once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
1047 "proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", 1047 "proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)",
1048 "ra_assists 0.1.0", 1048 "ra_assists 0.1.0",
1049 "ra_cfg 0.1.0", 1049 "ra_cfg 0.1.0",
@@ -1117,7 +1117,7 @@ dependencies = [
1117 "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", 1117 "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
1118 "jemalloc-ctl 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 1118 "jemalloc-ctl 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
1119 "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 1119 "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
1120 "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 1120 "once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
1121] 1121]
1122 1122
1123[[package]] 1123[[package]]
@@ -1140,7 +1140,7 @@ version = "0.1.0"
1140dependencies = [ 1140dependencies = [
1141 "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 1141 "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
1142 "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", 1142 "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
1143 "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 1143 "once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
1144 "ra_parser 0.1.0", 1144 "ra_parser 0.1.0",
1145 "ra_text_edit 0.1.0", 1145 "ra_text_edit 0.1.0",
1146 "rowan 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", 1146 "rowan 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1863,7 +1863,7 @@ dependencies = [
1863"checksum notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" 1863"checksum notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd"
1864"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" 1864"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
1865"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" 1865"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72"
1866"checksum once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "891f486f630e5c5a4916c7e16c4b24a53e78c860b646e9f8e005e4f16847bfed" 1866"checksum once_cell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5941ec2d5ee5916c709580d71553b81a633df245bcc73c04dcbd62152ceefc4"
1867"checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" 1867"checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
1868"checksum parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" 1868"checksum parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc"
1869"checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" 1869"checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1"
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs
index b995913af..5e2fe1905 100644
--- a/crates/ra_ide/src/references.rs
+++ b/crates/ra_ide/src/references.rs
@@ -196,7 +196,9 @@ fn process_definition(
196 196
197 for (file_id, search_range) in scope { 197 for (file_id, search_range) in scope {
198 let text = db.file_text(file_id); 198 let text = db.file_text(file_id);
199
199 let parse = Lazy::new(|| SourceFile::parse(&text)); 200 let parse = Lazy::new(|| SourceFile::parse(&text));
201 let mut sb = Lazy::new(|| SourceBinder::new(db));
200 202
201 for (idx, _) in text.match_indices(pat) { 203 for (idx, _) in text.match_indices(pat) {
202 let offset = TextUnit::from_usize(idx); 204 let offset = TextUnit::from_usize(idx);
@@ -212,7 +214,7 @@ fn process_definition(
212 } 214 }
213 // FIXME: reuse sb 215 // FIXME: reuse sb
214 // See https://github.com/rust-lang/rust/pull/68198#issuecomment-574269098 216 // See https://github.com/rust-lang/rust/pull/68198#issuecomment-574269098
215 let mut sb = SourceBinder::new(db); 217
216 if let Some(d) = classify_name_ref(&mut sb, InFile::new(file_id.into(), &name_ref)) 218 if let Some(d) = classify_name_ref(&mut sb, InFile::new(file_id.into(), &name_ref))
217 { 219 {
218 if d == def { 220 if d == def {