diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir_ty/Cargo.toml | 6 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk.rs | 19 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk/mapping.rs | 22 | ||||
-rw-r--r-- | crates/ra_syntax/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/expr_ext.rs | 3 | ||||
-rw-r--r-- | crates/rust-analyzer/Cargo.toml | 4 |
6 files changed, 31 insertions, 25 deletions
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 | ||
29 | scoped-tls = "1" | 29 | scoped-tls = "1" |
30 | 30 | ||
31 | chalk-solve = { version = "0.18.0" } | 31 | chalk-solve = { version = "0.19.0" } |
32 | chalk-ir = { version = "0.18.0" } | 32 | chalk-ir = { version = "0.19.0" } |
33 | chalk-recursive = { version = "0.18.0" } | 33 | chalk-recursive = { version = "0.19.0" } |
34 | 34 | ||
35 | [dev-dependencies] | 35 | [dev-dependencies] |
36 | expect = { path = "../expect" } | 36 | expect = { 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] |
14 | itertools = "0.9.0" | 14 | itertools = "0.9.0" |
15 | rowan = "0.10.0" | 15 | rowan = "0.10.0" |
16 | rustc_lexer = { version = "669.0.0", package = "rustc-ap-rustc_lexer" } | 16 | rustc_lexer = { version = "671.0.0", package = "rustc-ap-rustc_lexer" } |
17 | rustc-hash = "1.1.0" | 17 | rustc-hash = "1.1.0" |
18 | arrayvec = "0.5.1" | 18 | arrayvec = "0.5.1" |
19 | once_cell = "1.3.1" | 19 | once_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 } | |||
20 | itertools = "0.9.0" | 20 | itertools = "0.9.0" |
21 | jod-thread = "0.1.0" | 21 | jod-thread = "0.1.0" |
22 | log = "0.4.8" | 22 | log = "0.4.8" |
23 | lsp-types = { version = "0.78.0", features = ["proposed"] } | 23 | lsp-types = { version = "0.79.0", features = ["proposed"] } |
24 | parking_lot = "0.11.0" | 24 | parking_lot = "0.11.0" |
25 | pico-args = "0.3.1" | 25 | pico-args = "0.3.1" |
26 | oorandom = "11.1.2" | 26 | oorandom = "11.1.2" |
@@ -42,7 +42,7 @@ ra_syntax = { path = "../ra_syntax" } | |||
42 | ra_text_edit = { path = "../ra_text_edit" } | 42 | ra_text_edit = { path = "../ra_text_edit" } |
43 | vfs = { path = "../vfs" } | 43 | vfs = { path = "../vfs" } |
44 | vfs-notify = { path = "../vfs-notify" } | 44 | vfs-notify = { path = "../vfs-notify" } |
45 | ra_cfg = { path = "../ra_cfg"} | 45 | ra_cfg = { path = "../ra_cfg" } |
46 | ra_toolchain = { path = "../ra_toolchain" } | 46 | ra_toolchain = { path = "../ra_toolchain" } |
47 | 47 | ||
48 | # This should only be used in CLI | 48 | # This should only be used in CLI |