aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock28
-rw-r--r--crates/ra_hir_ty/Cargo.toml6
-rw-r--r--crates/ra_hir_ty/src/traits/chalk.rs19
-rw-r--r--crates/ra_hir_ty/src/traits/chalk/mapping.rs22
-rw-r--r--crates/ra_syntax/Cargo.toml2
-rw-r--r--crates/ra_syntax/src/ast/expr_ext.rs3
-rw-r--r--crates/rust-analyzer/Cargo.toml4
7 files changed, 45 insertions, 39 deletions
diff --git a/Cargo.lock b/Cargo.lock
index e63dcc530..234c31406 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -125,9 +125,9 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
125 125
126[[package]] 126[[package]]
127name = "chalk-derive" 127name = "chalk-derive"
128version = "0.18.0" 128version = "0.19.0"
129source = "registry+https://github.com/rust-lang/crates.io-index" 129source = "registry+https://github.com/rust-lang/crates.io-index"
130checksum = "eea3a22f0c30b2504ac4ab58934dac0d00b92a4d7788df32795cabca24c3f929" 130checksum = "654c611946ba2629c5028cb7708687af975faf2c29d731824cb294c873df4697"
131dependencies = [ 131dependencies = [
132 "proc-macro2", 132 "proc-macro2",
133 "quote", 133 "quote",
@@ -137,9 +137,9 @@ dependencies = [
137 137
138[[package]] 138[[package]]
139name = "chalk-ir" 139name = "chalk-ir"
140version = "0.18.0" 140version = "0.19.0"
141source = "registry+https://github.com/rust-lang/crates.io-index" 141source = "registry+https://github.com/rust-lang/crates.io-index"
142checksum = "fb617b643e145e3b151502799e91a9625dd5daf1cf05dc2cb821bc75ae0c9cbd" 142checksum = "0a5341fbc654ca886b73b804a36aebf0e621057ccc1a68e9815b5b39b3ac9ae8"
143dependencies = [ 143dependencies = [
144 "chalk-derive", 144 "chalk-derive",
145 "lazy_static", 145 "lazy_static",
@@ -147,9 +147,9 @@ dependencies = [
147 147
148[[package]] 148[[package]]
149name = "chalk-recursive" 149name = "chalk-recursive"
150version = "0.18.0" 150version = "0.19.0"
151source = "registry+https://github.com/rust-lang/crates.io-index" 151source = "registry+https://github.com/rust-lang/crates.io-index"
152checksum = "d280565c8eefbf9b2bc615df49c7dfd971faad37774bf65734e626fd23864bd6" 152checksum = "4484807b155b5a411e6135d330295f9ba5042e2920b8712c6574ca6ea91e9ee5"
153dependencies = [ 153dependencies = [
154 "chalk-derive", 154 "chalk-derive",
155 "chalk-ir", 155 "chalk-ir",
@@ -160,9 +160,9 @@ dependencies = [
160 160
161[[package]] 161[[package]]
162name = "chalk-solve" 162name = "chalk-solve"
163version = "0.18.0" 163version = "0.19.0"
164source = "registry+https://github.com/rust-lang/crates.io-index" 164source = "registry+https://github.com/rust-lang/crates.io-index"
165checksum = "be906fbca3f3077dce0e76d9864771d0f450c946af0d86b569fb9504148a065a" 165checksum = "281f82facd2538997fbe52132b1941ed213d266748215c31d15f62a8664429ad"
166dependencies = [ 166dependencies = [
167 "chalk-derive", 167 "chalk-derive",
168 "chalk-ir", 168 "chalk-ir",
@@ -607,9 +607,9 @@ dependencies = [
607 607
608[[package]] 608[[package]]
609name = "lsp-types" 609name = "lsp-types"
610version = "0.78.0" 610version = "0.79.0"
611source = "registry+https://github.com/rust-lang/crates.io-index" 611source = "registry+https://github.com/rust-lang/crates.io-index"
612checksum = "d2e6cf68e3492cfa2035f0382c1da1b6ab045db0320feca505b86b4f13d66c27" 612checksum = "7f1f86677fdbe8df5f88b99131b1424e50aad27bbe3e5900d221bc414bd72e9b"
613dependencies = [ 613dependencies = [
614 "base64", 614 "base64",
615 "bitflags", 615 "bitflags",
@@ -842,9 +842,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
842 842
843[[package]] 843[[package]]
844name = "perf-event" 844name = "perf-event"
845version = "0.4.3" 845version = "0.4.4"
846source = "registry+https://github.com/rust-lang/crates.io-index" 846source = "registry+https://github.com/rust-lang/crates.io-index"
847checksum = "0cb38a2f363560fb3cfcb47f28848b245a41c7e0d63e0b190918b712b6bf6803" 847checksum = "76c42ba5d85a2f4472b99f475fb60cf336d9b4c85b1ea8bb300fef2e3c7c8f89"
848dependencies = [ 848dependencies = [
849 "libc", 849 "libc",
850 "perf-event-open-sys", 850 "perf-event-open-sys",
@@ -1344,9 +1344,9 @@ dependencies = [
1344 1344
1345[[package]] 1345[[package]]
1346name = "rustc-ap-rustc_lexer" 1346name = "rustc-ap-rustc_lexer"
1347version = "669.0.0" 1347version = "671.0.0"
1348source = "registry+https://github.com/rust-lang/crates.io-index" 1348source = "registry+https://github.com/rust-lang/crates.io-index"
1349checksum = "456af5f09c006cf6c22c1a433ee0232c4bb74bdc6c647a010166a47c94ed2a63" 1349checksum = "22e1221f3bfa2943c942cf8da319ab2346887f8757778c29c7f1822cd27b521f"
1350dependencies = [ 1350dependencies = [
1351 "unicode-xid", 1351 "unicode-xid",
1352] 1352]
diff --git a/crates/ra_hir_ty/Cargo.toml b/crates/ra_hir_ty/Cargo.toml
index 7242e2cb6..623ce261a 100644
--- a/crates/ra_hir_ty/Cargo.toml
+++ b/crates/ra_hir_ty/Cargo.toml
@@ -28,9 +28,9 @@ test_utils = { path = "../test_utils" }
28 28
29scoped-tls = "1" 29scoped-tls = "1"
30 30
31chalk-solve = { version = "0.18.0" } 31chalk-solve = { version = "0.19.0" }
32chalk-ir = { version = "0.18.0" } 32chalk-ir = { version = "0.19.0" }
33chalk-recursive = { version = "0.18.0" } 33chalk-recursive = { version = "0.19.0" }
34 34
35[dev-dependencies] 35[dev-dependencies]
36expect = { path = "../expect" } 36expect = { path = "../expect" }
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs
index 5298dbecf..1c7065364 100644
--- a/crates/ra_hir_ty/src/traits/chalk.rs
+++ b/crates/ra_hir_ty/src/traits/chalk.rs
@@ -183,6 +183,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
183 .collect(), 183 .collect(),
184 1, 184 1,
185 ), 185 ),
186 where_clauses: make_binders(vec![], 0),
186 }; 187 };
187 let num_vars = datas.num_binders; 188 let num_vars = datas.num_binders;
188 Arc::new(OpaqueTyDatum { opaque_ty_id: id, bound: make_binders(bound, num_vars) }) 189 Arc::new(OpaqueTyDatum { opaque_ty_id: id, bound: make_binders(bound, num_vars) })
@@ -193,15 +194,6 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
193 Ty::Unknown.to_chalk(self.db) 194 Ty::Unknown.to_chalk(self.db)
194 } 195 }
195 196
196 fn force_impl_for(
197 &self,
198 _well_known: rust_ir::WellKnownTrait,
199 _ty: &chalk_ir::TyData<Interner>,
200 ) -> Option<bool> {
201 // this method is mostly for rustc
202 None
203 }
204
205 fn is_object_safe(&self, _trait_id: chalk_ir::TraitId<Interner>) -> bool { 197 fn is_object_safe(&self, _trait_id: chalk_ir::TraitId<Interner>) -> bool {
206 // FIXME: implement actual object safety 198 // FIXME: implement actual object safety
207 true 199 true
@@ -547,8 +539,13 @@ pub(crate) fn fn_def_datum_query(
547 ), 539 ),
548 where_clauses, 540 where_clauses,
549 }; 541 };
550 let datum = 542 let datum = FnDefDatum {
551 FnDefDatum { id: fn_def_id, binders: make_binders(bound, sig.num_binders), abi: () }; 543 id: fn_def_id,
544 abi: (),
545 safety: chalk_ir::Safety::Safe,
546 variadic: sig.value.is_varargs,
547 binders: make_binders(bound, sig.num_binders),
548 };
552 Arc::new(datum) 549 Arc::new(datum)
553} 550}
554 551
diff --git a/crates/ra_hir_ty/src/traits/chalk/mapping.rs b/crates/ra_hir_ty/src/traits/chalk/mapping.rs
index 09d8347ca..b3e92993d 100644
--- a/crates/ra_hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/ra_hir_ty/src/traits/chalk/mapping.rs
@@ -30,11 +30,16 @@ impl ToChalk for Ty {
30 Ty::Apply(apply_ty) => match apply_ty.ctor { 30 Ty::Apply(apply_ty) => match apply_ty.ctor {
31 TypeCtor::Ref(m) => ref_to_chalk(db, m, apply_ty.parameters), 31 TypeCtor::Ref(m) => ref_to_chalk(db, m, apply_ty.parameters),
32 TypeCtor::Array => array_to_chalk(db, apply_ty.parameters), 32 TypeCtor::Array => array_to_chalk(db, apply_ty.parameters),
33 TypeCtor::FnPtr { num_args: _, is_varargs: _ } => { 33 TypeCtor::FnPtr { num_args: _, is_varargs } => {
34 // FIXME: handle is_varargs
35 let substitution = apply_ty.parameters.to_chalk(db).shifted_in(&Interner); 34 let substitution = apply_ty.parameters.to_chalk(db).shifted_in(&Interner);
36 chalk_ir::TyData::Function(chalk_ir::Fn { num_binders: 0, substitution }) 35 chalk_ir::TyData::Function(chalk_ir::FnPointer {
37 .intern(&Interner) 36 num_binders: 0,
37 abi: (),
38 safety: chalk_ir::Safety::Safe,
39 variadic: is_varargs,
40 substitution,
41 })
42 .intern(&Interner)
38 } 43 }
39 _ => { 44 _ => {
40 let name = apply_ty.ctor.to_chalk(db); 45 let name = apply_ty.ctor.to_chalk(db);
@@ -118,7 +123,12 @@ impl ToChalk for Ty {
118 let parameters = from_chalk(db, opaque_ty.substitution); 123 let parameters = from_chalk(db, opaque_ty.substitution);
119 Ty::Opaque(OpaqueTy { opaque_ty_id: impl_trait_id, parameters }) 124 Ty::Opaque(OpaqueTy { opaque_ty_id: impl_trait_id, parameters })
120 } 125 }
121 chalk_ir::TyData::Function(chalk_ir::Fn { num_binders, substitution }) => { 126 chalk_ir::TyData::Function(chalk_ir::FnPointer {
127 num_binders,
128 variadic,
129 substitution,
130 ..
131 }) => {
122 assert_eq!(num_binders, 0); 132 assert_eq!(num_binders, 0);
123 let parameters: Substs = from_chalk( 133 let parameters: Substs = from_chalk(
124 db, 134 db,
@@ -127,7 +137,7 @@ impl ToChalk for Ty {
127 Ty::Apply(ApplicationTy { 137 Ty::Apply(ApplicationTy {
128 ctor: TypeCtor::FnPtr { 138 ctor: TypeCtor::FnPtr {
129 num_args: (parameters.len() - 1) as u16, 139 num_args: (parameters.len() - 1) as u16,
130 is_varargs: false, 140 is_varargs: variadic,
131 }, 141 },
132 parameters, 142 parameters,
133 }) 143 })
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml
index 670f04578..fc4d7aa04 100644
--- a/crates/ra_syntax/Cargo.toml
+++ b/crates/ra_syntax/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
13[dependencies] 13[dependencies]
14itertools = "0.9.0" 14itertools = "0.9.0"
15rowan = "0.10.0" 15rowan = "0.10.0"
16rustc_lexer = { version = "669.0.0", package = "rustc-ap-rustc_lexer" } 16rustc_lexer = { version = "671.0.0", package = "rustc-ap-rustc_lexer" }
17rustc-hash = "1.1.0" 17rustc-hash = "1.1.0"
18arrayvec = "0.5.1" 18arrayvec = "0.5.1"
19once_cell = "1.3.1" 19once_cell = "1.3.1"
diff --git a/crates/ra_syntax/src/ast/expr_ext.rs b/crates/ra_syntax/src/ast/expr_ext.rs
index 365f94287..f5ba87223 100644
--- a/crates/ra_syntax/src/ast/expr_ext.rs
+++ b/crates/ra_syntax/src/ast/expr_ext.rs
@@ -333,13 +333,12 @@ impl ast::Literal {
333 333
334 match token.kind() { 334 match token.kind() {
335 INT_NUMBER => { 335 INT_NUMBER => {
336 // FYI: there was a bug here previously, thus an if statement bellow is necessary. 336 // FYI: there was a bug here previously, thus the if statement below is necessary.
337 // The lexer treats e.g. `1f64` as an integer literal. See 337 // The lexer treats e.g. `1f64` as an integer literal. See
338 // https://github.com/rust-analyzer/rust-analyzer/issues/1592 338 // https://github.com/rust-analyzer/rust-analyzer/issues/1592
339 // and the comments on the linked PR. 339 // and the comments on the linked PR.
340 340
341 let text = token.text(); 341 let text = token.text();
342
343 if let suffix @ Some(_) = Self::find_suffix(&text, &FLOAT_SUFFIXES) { 342 if let suffix @ Some(_) = Self::find_suffix(&text, &FLOAT_SUFFIXES) {
344 LiteralKind::FloatNumber { suffix } 343 LiteralKind::FloatNumber { suffix }
345 } else { 344 } else {
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index 931fc61ed..02c1371ac 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -20,7 +20,7 @@ env_logger = { version = "0.7.1", default-features = false }
20itertools = "0.9.0" 20itertools = "0.9.0"
21jod-thread = "0.1.0" 21jod-thread = "0.1.0"
22log = "0.4.8" 22log = "0.4.8"
23lsp-types = { version = "0.78.0", features = ["proposed"] } 23lsp-types = { version = "0.79.0", features = ["proposed"] }
24parking_lot = "0.11.0" 24parking_lot = "0.11.0"
25pico-args = "0.3.1" 25pico-args = "0.3.1"
26oorandom = "11.1.2" 26oorandom = "11.1.2"
@@ -42,7 +42,7 @@ ra_syntax = { path = "../ra_syntax" }
42ra_text_edit = { path = "../ra_text_edit" } 42ra_text_edit = { path = "../ra_text_edit" }
43vfs = { path = "../vfs" } 43vfs = { path = "../vfs" }
44vfs-notify = { path = "../vfs-notify" } 44vfs-notify = { path = "../vfs-notify" }
45ra_cfg = { path = "../ra_cfg"} 45ra_cfg = { path = "../ra_cfg" }
46ra_toolchain = { path = "../ra_toolchain" } 46ra_toolchain = { path = "../ra_toolchain" }
47 47
48# This should only be used in CLI 48# This should only be used in CLI