From 0bcf47b22b01f66c2f2056f5871e32071ba95b01 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 1 May 2019 23:26:42 +0200 Subject: Update Chalk --- Cargo.lock | 46 +++++++++++++++---------------- crates/ra_hir/Cargo.toml | 9 ++---- crates/ra_hir/src/ty/method_resolution.rs | 1 - crates/ra_hir/src/ty/traits/chalk.rs | 17 +++++++++--- 4 files changed, 39 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0bb62cb88..98c349dec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -146,9 +146,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chalk-engine" version = "0.9.0" -source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" +source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef" dependencies = [ - "chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", + "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "stacker 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -156,17 +156,17 @@ dependencies = [ [[package]] name = "chalk-ir" version = "0.1.0" -source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" +source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef" dependencies = [ - "chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", - "chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", + "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", + "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", "lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "chalk-macros" version = "0.1.1" -source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" +source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -174,22 +174,22 @@ dependencies = [ [[package]] name = "chalk-rust-ir" version = "0.1.0" -source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" +source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef" dependencies = [ - "chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", - "chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", - "chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", + "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", + "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", + "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", ] [[package]] name = "chalk-solve" version = "0.1.0" -source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" +source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef" dependencies = [ - "chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", - "chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", - "chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", - "chalk-rust-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", + "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", + "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", + "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", + "chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "ena 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1074,9 +1074,9 @@ name = "ra_hir" version = "0.1.0" dependencies = [ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", - "chalk-rust-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", - "chalk-solve 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", + "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", + "chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", + "chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)", "ena 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "flexi_logger 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", "insta 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1997,11 +1997,11 @@ dependencies = [ "checksum cargo_metadata 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "178d62b240c34223f265a4c1e275e37d62da163d421fc8d7f7e3ee340f803c57" "checksum cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)" = "5e5f3fee5eeb60324c2781f1e41286bdee933850fff9b3c672587fed5ec58c83" "checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4" -"checksum chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "" -"checksum chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "" -"checksum chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "" -"checksum chalk-rust-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "" -"checksum chalk-solve 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "" +"checksum chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)" = "" +"checksum chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "" +"checksum chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)" = "" +"checksum chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "" +"checksum chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "" "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" "checksum ci_info 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e5e881307a989a3a5e20d52a32cc05950e3c2178cccfcc9428271a6cde09f902" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml index ae7e7df62..68ffcb2e9 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml @@ -21,12 +21,9 @@ tt = { path = "../ra_tt", package = "ra_tt" } test_utils = { path = "../test_utils" } ra_prof = { path = "../ra_prof" } -# chalk-solve = { git = "https://github.com/rust-lang/chalk.git" } -# chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git" } -# chalk-ir = { git = "https://github.com/rust-lang/chalk.git" } -chalk-solve = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" } -chalk-rust-ir = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" } -chalk-ir = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" } +chalk-solve = { git = "https://github.com/rust-lang/chalk.git" } +chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git" } +chalk-ir = { git = "https://github.com/rust-lang/chalk.git" } [dev-dependencies] flexi_logger = "0.11.0" diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index bc5033be6..607e9ba79 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs @@ -202,7 +202,6 @@ fn iterate_trait_method_candidates( } } known_implemented = true; - // TODO the self type is now canonicalized... if let Some(result) = callback(&ty.value, m) { return Some(result); } diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index 1adc1d601..c77db9202 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs @@ -40,9 +40,7 @@ impl ToChalk for Ty { Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"), // FIXME this is clearly incorrect, but probably not too incorrect // and I'm not sure what to actually do with Ty::Unknown - Ty::Unknown => { - PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty() - }, + Ty::Unknown => PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty(), } } fn from_chalk(db: &impl HirDatabase, chalk: chalk_ir::Ty) -> Self { @@ -189,7 +187,9 @@ where fundamental: false, }; let where_clauses = Vec::new(); // FIXME add where clauses - let trait_datum_bound = chalk_rust_ir::TraitDatumBound { trait_ref, where_clauses, flags }; + let associated_ty_ids = Vec::new(); // FIXME add associated tys + let trait_datum_bound = + chalk_rust_ir::TraitDatumBound { trait_ref, where_clauses, flags, associated_ty_ids }; let trait_datum = TraitDatum { binders: make_binders(trait_datum_bound, bound_vars.len()) }; Arc::new(trait_datum) } @@ -289,6 +289,15 @@ where debug!("split_projection {:?}", projection); unimplemented!() } + fn custom_clauses(&self) -> Vec { + debug!("custom_clauses"); + vec![] + } + fn all_structs(&self) -> Vec { + debug!("all_structs"); + // FIXME + vec![] + } } fn id_from_chalk(chalk_id: chalk_ir::RawId) -> T { -- cgit v1.2.3